Merge "Add Verstat fields to Telecom call/connection classes." am: 4efe689e4c
am: 86445ea5c3
Change-Id: I0a74b0709f5b646a27f668e40426110805783985
This commit is contained in:
@@ -43113,6 +43113,7 @@ package android.telecom {
|
||||
method public int getCallProperties();
|
||||
method public String getCallerDisplayName();
|
||||
method public int getCallerDisplayNamePresentation();
|
||||
method public int getCallerNumberVerificationStatus();
|
||||
method public final long getConnectTimeMillis();
|
||||
method public long getCreationTimeMillis();
|
||||
method public android.telecom.DisconnectCause getDisconnectCause();
|
||||
@@ -43294,6 +43295,7 @@ package android.telecom {
|
||||
method public final android.telecom.CallAudioState getCallAudioState();
|
||||
method public final String getCallerDisplayName();
|
||||
method public final int getCallerDisplayNamePresentation();
|
||||
method public int getCallerNumberVerificationStatus();
|
||||
method public final android.telecom.Conference getConference();
|
||||
method public final java.util.List<android.telecom.Conferenceable> getConferenceables();
|
||||
method public final int getConnectionCapabilities();
|
||||
@@ -43345,6 +43347,7 @@ package android.telecom {
|
||||
method public final void setAudioModeIsVoip(boolean);
|
||||
method public final void setAudioRoute(int);
|
||||
method public final void setCallerDisplayName(String, int);
|
||||
method public void setCallerNumberVerificationStatus(int);
|
||||
method public final void setConferenceableConnections(java.util.List<android.telecom.Connection>);
|
||||
method public final void setConferenceables(java.util.List<android.telecom.Conferenceable>);
|
||||
method public final void setConnectionCapabilities(int);
|
||||
@@ -43440,6 +43443,9 @@ package android.telecom {
|
||||
field public static final int STATE_NEW = 1; // 0x1
|
||||
field public static final int STATE_PULLING_CALL = 7; // 0x7
|
||||
field public static final int STATE_RINGING = 2; // 0x2
|
||||
field public static final int VERIFICATION_STATUS_FAILED = 2; // 0x2
|
||||
field public static final int VERIFICATION_STATUS_NOT_VERIFIED = 0; // 0x0
|
||||
field public static final int VERIFICATION_STATUS_PASSED = 1; // 0x1
|
||||
}
|
||||
|
||||
public static final class Connection.RttModifyStatus {
|
||||
|
||||
@@ -291,7 +291,6 @@ public final class Call {
|
||||
*/
|
||||
public static final int DIRECTION_OUTGOING = 1;
|
||||
|
||||
|
||||
/** Call can currently be put on hold or unheld. */
|
||||
public static final int CAPABILITY_HOLD = 0x00000001;
|
||||
|
||||
@@ -571,6 +570,7 @@ public final class Call {
|
||||
private final Bundle mIntentExtras;
|
||||
private final long mCreationTimeMillis;
|
||||
private final @CallDirection int mCallDirection;
|
||||
private final @Connection.VerificationStatus int mCallerNumberVerificationStatus;
|
||||
|
||||
/**
|
||||
* Whether the supplied capabilities supports the specified capability.
|
||||
@@ -880,6 +880,15 @@ public final class Call {
|
||||
return mCallDirection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the verification status for the phone number of an incoming call as identified in
|
||||
* ATIS-1000082.
|
||||
* @return the verification status.
|
||||
*/
|
||||
public @Connection.VerificationStatus int getCallerNumberVerificationStatus() {
|
||||
return mCallerNumberVerificationStatus;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (o instanceof Details) {
|
||||
@@ -901,7 +910,9 @@ public final class Call {
|
||||
areBundlesEqual(mExtras, d.mExtras) &&
|
||||
areBundlesEqual(mIntentExtras, d.mIntentExtras) &&
|
||||
Objects.equals(mCreationTimeMillis, d.mCreationTimeMillis) &&
|
||||
Objects.equals(mCallDirection, d.mCallDirection);
|
||||
Objects.equals(mCallDirection, d.mCallDirection) &&
|
||||
Objects.equals(mCallerNumberVerificationStatus,
|
||||
d.mCallerNumberVerificationStatus);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -923,7 +934,8 @@ public final class Call {
|
||||
mExtras,
|
||||
mIntentExtras,
|
||||
mCreationTimeMillis,
|
||||
mCallDirection);
|
||||
mCallDirection,
|
||||
mCallerNumberVerificationStatus);
|
||||
}
|
||||
|
||||
/** {@hide} */
|
||||
@@ -944,7 +956,8 @@ public final class Call {
|
||||
Bundle extras,
|
||||
Bundle intentExtras,
|
||||
long creationTimeMillis,
|
||||
int callDirection) {
|
||||
int callDirection,
|
||||
int callerNumberVerificationStatus) {
|
||||
mTelecomCallId = telecomCallId;
|
||||
mHandle = handle;
|
||||
mHandlePresentation = handlePresentation;
|
||||
@@ -962,6 +975,7 @@ public final class Call {
|
||||
mIntentExtras = intentExtras;
|
||||
mCreationTimeMillis = creationTimeMillis;
|
||||
mCallDirection = callDirection;
|
||||
mCallerNumberVerificationStatus = callerNumberVerificationStatus;
|
||||
}
|
||||
|
||||
/** {@hide} */
|
||||
@@ -983,7 +997,8 @@ public final class Call {
|
||||
parcelableCall.getExtras(),
|
||||
parcelableCall.getIntentExtras(),
|
||||
parcelableCall.getCreationTimeMillis(),
|
||||
parcelableCall.getCallDirection());
|
||||
parcelableCall.getCallDirection(),
|
||||
parcelableCall.getCallerNumberVerificationStatus());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package android.telecom;
|
||||
|
||||
import android.annotation.IntDef;
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.annotation.SystemApi;
|
||||
@@ -48,6 +49,8 @@ import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.nio.channels.Channels;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -150,6 +153,32 @@ public abstract class Connection extends Conferenceable {
|
||||
*/
|
||||
public static final int STATE_PULLING_CALL = 7;
|
||||
|
||||
/**
|
||||
* Indicates that the network could not perform verification.
|
||||
*/
|
||||
public static final int VERIFICATION_STATUS_NOT_VERIFIED = 0;
|
||||
|
||||
/**
|
||||
* Indicates that verification by the network passed. This indicates there is a high likelihood
|
||||
* that the call originated from a valid source.
|
||||
*/
|
||||
public static final int VERIFICATION_STATUS_PASSED = 1;
|
||||
|
||||
/**
|
||||
* Indicates that verification by the network failed. This indicates there is a high likelihood
|
||||
* that the call did not originate from a valid source.
|
||||
*/
|
||||
public static final int VERIFICATION_STATUS_FAILED = 2;
|
||||
|
||||
/**@hide*/
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@IntDef(prefix = "VERIFICATION_STATUS_", value = {
|
||||
VERIFICATION_STATUS_NOT_VERIFIED,
|
||||
VERIFICATION_STATUS_PASSED,
|
||||
VERIFICATION_STATUS_FAILED
|
||||
})
|
||||
public @interface VerificationStatus {}
|
||||
|
||||
/**
|
||||
* Connection can currently be put on hold or unheld. This is distinct from
|
||||
* {@link #CAPABILITY_SUPPORT_HOLD} in that although a connection may support 'hold' most times,
|
||||
@@ -1853,6 +1882,12 @@ public abstract class Connection extends Conferenceable {
|
||||
*/
|
||||
private Set<String> mPreviousExtraKeys;
|
||||
|
||||
/**
|
||||
* The verification status for an incoming call's phone number.
|
||||
*/
|
||||
private @VerificationStatus int mCallerNumberVerificationStatus;
|
||||
|
||||
|
||||
/**
|
||||
* Create a new Connection.
|
||||
*/
|
||||
@@ -3355,4 +3390,26 @@ public abstract class Connection extends Conferenceable {
|
||||
public void setCallDirection(@Call.Details.CallDirection int callDirection) {
|
||||
mCallDirection = callDirection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the verification status for the phone number of an incoming call as identified in
|
||||
* ATIS-1000082.
|
||||
* @return the verification status.
|
||||
*/
|
||||
public @VerificationStatus int getCallerNumberVerificationStatus() {
|
||||
return mCallerNumberVerificationStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the verification status for the phone number of an incoming call as identified in
|
||||
* ATIS-1000082.
|
||||
* <p>
|
||||
* This property can only be set at the time of creation of a {@link Connection} being returned
|
||||
* by
|
||||
* {@link ConnectionService#onCreateIncomingConnection(PhoneAccountHandle, ConnectionRequest)}.
|
||||
*/
|
||||
public void setCallerNumberVerificationStatus(
|
||||
@VerificationStatus int callerNumberVerificationStatus) {
|
||||
mCallerNumberVerificationStatus = callerNumberVerificationStatus;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1621,7 +1621,8 @@ public abstract class ConnectionService extends Service {
|
||||
connection.getStatusHints(),
|
||||
connection.getDisconnectCause(),
|
||||
createIdList(connection.getConferenceables()),
|
||||
connection.getExtras()));
|
||||
connection.getExtras(),
|
||||
connection.getCallerNumberVerificationStatus()));
|
||||
|
||||
if (isIncoming && request.shouldShowIncomingCallUi() && isSelfManaged) {
|
||||
// Tell ConnectionService to show its incoming call UX.
|
||||
@@ -2156,7 +2157,8 @@ public abstract class ConnectionService extends Service {
|
||||
emptyList,
|
||||
connection.getExtras(),
|
||||
conferenceId,
|
||||
connection.getCallDirection());
|
||||
connection.getCallDirection(),
|
||||
Connection.VERIFICATION_STATUS_NOT_VERIFIED);
|
||||
mAdapter.addExistingConnection(id, parcelableConnection);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package android.telecom;
|
||||
|
||||
import android.annotation.Nullable;
|
||||
import android.annotation.UnsupportedAppUsage;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
@@ -66,6 +65,7 @@ public final class ParcelableCall implements Parcelable {
|
||||
private final Bundle mExtras;
|
||||
private final long mCreationTimeMillis;
|
||||
private final int mCallDirection;
|
||||
private final int mCallerNumberVerificationStatus;
|
||||
|
||||
public ParcelableCall(
|
||||
String id,
|
||||
@@ -94,7 +94,8 @@ public final class ParcelableCall implements Parcelable {
|
||||
Bundle intentExtras,
|
||||
Bundle extras,
|
||||
long creationTimeMillis,
|
||||
int callDirection) {
|
||||
int callDirection,
|
||||
int callerNumberVerificationStatus) {
|
||||
mId = id;
|
||||
mState = state;
|
||||
mDisconnectCause = disconnectCause;
|
||||
@@ -122,6 +123,7 @@ public final class ParcelableCall implements Parcelable {
|
||||
mExtras = extras;
|
||||
mCreationTimeMillis = creationTimeMillis;
|
||||
mCallDirection = callDirection;
|
||||
mCallerNumberVerificationStatus = callerNumberVerificationStatus;
|
||||
}
|
||||
|
||||
/** The unique ID of the call. */
|
||||
@@ -322,6 +324,15 @@ public final class ParcelableCall implements Parcelable {
|
||||
return mCallDirection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the verification status for the phone number of an incoming call as identified in
|
||||
* ATIS-1000082.
|
||||
* @return the verification status.
|
||||
*/
|
||||
public @Connection.VerificationStatus int getCallerNumberVerificationStatus() {
|
||||
return mCallerNumberVerificationStatus;
|
||||
}
|
||||
|
||||
/** Responsible for creating ParcelableCall objects for deserialized Parcels. */
|
||||
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
|
||||
public static final @android.annotation.NonNull Parcelable.Creator<ParcelableCall> CREATOR =
|
||||
@@ -360,6 +371,7 @@ public final class ParcelableCall implements Parcelable {
|
||||
ParcelableRttCall rttCall = source.readParcelable(classLoader);
|
||||
long creationTimeMillis = source.readLong();
|
||||
int callDirection = source.readInt();
|
||||
int callerNumberVerificationStatus = source.readInt();
|
||||
return new ParcelableCall(
|
||||
id,
|
||||
state,
|
||||
@@ -387,7 +399,8 @@ public final class ParcelableCall implements Parcelable {
|
||||
intentExtras,
|
||||
extras,
|
||||
creationTimeMillis,
|
||||
callDirection);
|
||||
callDirection,
|
||||
callerNumberVerificationStatus);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -433,6 +446,7 @@ public final class ParcelableCall implements Parcelable {
|
||||
destination.writeParcelable(mRttCall, 0);
|
||||
destination.writeLong(mCreationTimeMillis);
|
||||
destination.writeInt(mCallDirection);
|
||||
destination.writeInt(mCallerNumberVerificationStatus);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -54,6 +54,7 @@ public final class ParcelableConnection implements Parcelable {
|
||||
private final Bundle mExtras;
|
||||
private String mParentCallId;
|
||||
private @Call.Details.CallDirection int mCallDirection;
|
||||
private @Connection.VerificationStatus int mCallerNumberVerificationStatus;
|
||||
|
||||
/** @hide */
|
||||
public ParcelableConnection(
|
||||
@@ -77,12 +78,13 @@ public final class ParcelableConnection implements Parcelable {
|
||||
List<String> conferenceableConnectionIds,
|
||||
Bundle extras,
|
||||
String parentCallId,
|
||||
@Call.Details.CallDirection int callDirection) {
|
||||
@Call.Details.CallDirection int callDirection,
|
||||
@Connection.VerificationStatus int callerNumberVerificationStatus) {
|
||||
this(phoneAccount, state, capabilities, properties, supportedAudioRoutes, address,
|
||||
addressPresentation, callerDisplayName, callerDisplayNamePresentation,
|
||||
videoProvider, videoState, ringbackRequested, isVoipAudioMode, connectTimeMillis,
|
||||
connectElapsedTimeMillis, statusHints, disconnectCause, conferenceableConnectionIds,
|
||||
extras);
|
||||
extras, callerNumberVerificationStatus);
|
||||
mParentCallId = parentCallId;
|
||||
mCallDirection = callDirection;
|
||||
}
|
||||
@@ -107,7 +109,8 @@ public final class ParcelableConnection implements Parcelable {
|
||||
StatusHints statusHints,
|
||||
DisconnectCause disconnectCause,
|
||||
List<String> conferenceableConnectionIds,
|
||||
Bundle extras) {
|
||||
Bundle extras,
|
||||
@Connection.VerificationStatus int callerNumberVerificationStatus) {
|
||||
mPhoneAccount = phoneAccount;
|
||||
mState = state;
|
||||
mConnectionCapabilities = capabilities;
|
||||
@@ -129,6 +132,7 @@ public final class ParcelableConnection implements Parcelable {
|
||||
mExtras = extras;
|
||||
mParentCallId = null;
|
||||
mCallDirection = Call.Details.DIRECTION_UNKNOWN;
|
||||
mCallerNumberVerificationStatus = callerNumberVerificationStatus;
|
||||
}
|
||||
|
||||
public PhoneAccountHandle getPhoneAccount() {
|
||||
@@ -227,6 +231,10 @@ public final class ParcelableConnection implements Parcelable {
|
||||
return mCallDirection;
|
||||
}
|
||||
|
||||
public @Connection.VerificationStatus int getCallerNumberVerificationStatus() {
|
||||
return mCallerNumberVerificationStatus;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new StringBuilder()
|
||||
@@ -276,6 +284,7 @@ public final class ParcelableConnection implements Parcelable {
|
||||
String parentCallId = source.readString();
|
||||
long connectElapsedTimeMillis = source.readLong();
|
||||
int callDirection = source.readInt();
|
||||
int callerNumberVerificationStatus = source.readInt();
|
||||
|
||||
return new ParcelableConnection(
|
||||
phoneAccount,
|
||||
@@ -298,7 +307,8 @@ public final class ParcelableConnection implements Parcelable {
|
||||
conferenceableConnectionIds,
|
||||
extras,
|
||||
parentCallId,
|
||||
callDirection);
|
||||
callDirection,
|
||||
callerNumberVerificationStatus);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -338,5 +348,6 @@ public final class ParcelableConnection implements Parcelable {
|
||||
destination.writeString(mParentCallId);
|
||||
destination.writeLong(mConnectElapsedTimeMillis);
|
||||
destination.writeInt(mCallDirection);
|
||||
destination.writeInt(mCallerNumberVerificationStatus);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user