Call Screening / Caller ID API Changes
- Fix bug in call identification parcelable; was reversing the app name and package name. - Add @hide RoleManager consts for the Telecom roles; this will be replaced by values in the library for public consumption as a later date. - Add new call direction attribute to the Call.Details class; this is needed so that a CallScreeningService can know if a call is incoming or outgoing. This way it knows whether it needs to perform call blocking or just caller ID. - Update CallScreeningService API docs to explain how to request the call screening role. - Update InCallService API docs to explain the 3 roles related to this service and how you declare an appropriate IncallService to fill each of them. Bug: 63966743 Test: Manual, CTS Change-Id: Ic4547b8ead791690305f7be58e43272c4155b7fb
This commit is contained in:
@@ -24,6 +24,7 @@ import android.os.Bundle;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.os.RemoteException;
|
||||
import android.telecom.Call.Details.CallDirection;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@@ -64,6 +65,7 @@ public final class ParcelableCall implements Parcelable {
|
||||
private final Bundle mExtras;
|
||||
private final long mCreationTimeMillis;
|
||||
private final CallIdentification mCallIdentification;
|
||||
private final int mCallDirection;
|
||||
|
||||
public ParcelableCall(
|
||||
String id,
|
||||
@@ -92,7 +94,8 @@ public final class ParcelableCall implements Parcelable {
|
||||
Bundle intentExtras,
|
||||
Bundle extras,
|
||||
long creationTimeMillis,
|
||||
CallIdentification callIdentification) {
|
||||
CallIdentification callIdentification,
|
||||
int callDirection) {
|
||||
mId = id;
|
||||
mState = state;
|
||||
mDisconnectCause = disconnectCause;
|
||||
@@ -120,6 +123,7 @@ public final class ParcelableCall implements Parcelable {
|
||||
mExtras = extras;
|
||||
mCreationTimeMillis = creationTimeMillis;
|
||||
mCallIdentification = callIdentification;
|
||||
mCallDirection = callDirection;
|
||||
}
|
||||
|
||||
/** The unique ID of the call. */
|
||||
@@ -318,6 +322,13 @@ public final class ParcelableCall implements Parcelable {
|
||||
return mCallIdentification;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether the call is an incoming or outgoing call.
|
||||
*/
|
||||
public @CallDirection int getCallDirection() {
|
||||
return mCallDirection;
|
||||
}
|
||||
|
||||
/** Responsible for creating ParcelableCall objects for deserialized Parcels. */
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
|
||||
public static final Parcelable.Creator<ParcelableCall> CREATOR =
|
||||
@@ -356,6 +367,7 @@ public final class ParcelableCall implements Parcelable {
|
||||
ParcelableRttCall rttCall = source.readParcelable(classLoader);
|
||||
long creationTimeMillis = source.readLong();
|
||||
CallIdentification callIdentification = source.readParcelable(classLoader);
|
||||
int callDirection = source.readInt();
|
||||
return new ParcelableCall(
|
||||
id,
|
||||
state,
|
||||
@@ -383,7 +395,8 @@ public final class ParcelableCall implements Parcelable {
|
||||
intentExtras,
|
||||
extras,
|
||||
creationTimeMillis,
|
||||
callIdentification);
|
||||
callIdentification,
|
||||
callDirection);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -429,6 +442,7 @@ public final class ParcelableCall implements Parcelable {
|
||||
destination.writeParcelable(mRttCall, 0);
|
||||
destination.writeLong(mCreationTimeMillis);
|
||||
destination.writeParcelable(mCallIdentification, 0);
|
||||
destination.writeInt(mCallDirection);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user