Add CallerIdentification to CallScreeningService API.
Updating the CallScreeningService to support passing call identification
information for incoming/outgoing calls.
Updating call log to log call identification information.
Bug: 63966743
Test: Manual with test app.
Change-Id: Ie6c172c09007eb5f4853d36ae0a99b782bfb5ddb
diff --git a/telecomm/java/android/telecom/ParcelableCall.java b/telecomm/java/android/telecom/ParcelableCall.java
index 3ad0f0c..911786e 100644
--- a/telecomm/java/android/telecom/ParcelableCall.java
+++ b/telecomm/java/android/telecom/ParcelableCall.java
@@ -16,6 +16,7 @@
package android.telecom;
+import android.annotation.Nullable;
import android.annotation.UnsupportedAppUsage;
import android.net.Uri;
import android.os.Build;
@@ -62,6 +63,7 @@
private final Bundle mIntentExtras;
private final Bundle mExtras;
private final long mCreationTimeMillis;
+ private final CallIdentification mCallIdentification;
public ParcelableCall(
String id,
@@ -89,7 +91,8 @@
List<String> conferenceableCallIds,
Bundle intentExtras,
Bundle extras,
- long creationTimeMillis) {
+ long creationTimeMillis,
+ CallIdentification callIdentification) {
mId = id;
mState = state;
mDisconnectCause = disconnectCause;
@@ -116,6 +119,7 @@
mIntentExtras = intentExtras;
mExtras = extras;
mCreationTimeMillis = creationTimeMillis;
+ mCallIdentification = callIdentification;
}
/** The unique ID of the call. */
@@ -133,7 +137,7 @@
* Reason for disconnection, as described by {@link android.telecomm.DisconnectCause}. Valid
* when call state is {@link CallState#DISCONNECTED}.
*/
- @UnsupportedAppUsage
+ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
public DisconnectCause getDisconnectCause() {
return mDisconnectCause;
}
@@ -159,13 +163,13 @@
}
/** The time that the call switched to the active state. */
- @UnsupportedAppUsage
+ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
public long getConnectTimeMillis() {
return mConnectTimeMillis;
}
/** The endpoint to which the call is connected. */
- @UnsupportedAppUsage
+ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
public Uri getHandle() {
return mHandle;
}
@@ -305,8 +309,17 @@
return mCreationTimeMillis;
}
+ /**
+ * Contains call identification information returned by a {@link CallScreeningService}.
+ * @return The {@link CallIdentification} for this call, or {@code null} if a
+ * {@link CallScreeningService} did not provide information.
+ */
+ public @Nullable CallIdentification getCallIdentification() {
+ return mCallIdentification;
+ }
+
/** Responsible for creating ParcelableCall objects for deserialized Parcels. */
- @UnsupportedAppUsage
+ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
public static final Parcelable.Creator<ParcelableCall> CREATOR =
new Parcelable.Creator<ParcelableCall> () {
@Override
@@ -342,6 +355,7 @@
boolean isRttCallChanged = source.readByte() == 1;
ParcelableRttCall rttCall = source.readParcelable(classLoader);
long creationTimeMillis = source.readLong();
+ CallIdentification callIdentification = source.readParcelable(classLoader);
return new ParcelableCall(
id,
state,
@@ -368,7 +382,8 @@
conferenceableCallIds,
intentExtras,
extras,
- creationTimeMillis);
+ creationTimeMillis,
+ callIdentification);
}
@Override
@@ -413,6 +428,7 @@
destination.writeByte((byte) (mIsRttCallChanged ? 1 : 0));
destination.writeParcelable(mRttCall, 0);
destination.writeLong(mCreationTimeMillis);
+ destination.writeParcelable(mCallIdentification, 0);
}
@Override