diff options
Diffstat (limited to 'telecomm/java/android/telecom/Connection.java')
-rw-r--r-- | telecomm/java/android/telecom/Connection.java | 114 |
1 files changed, 111 insertions, 3 deletions
diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java index 4c22ba9715b0..c06327995bc0 100644 --- a/telecomm/java/android/telecom/Connection.java +++ b/telecomm/java/android/telecom/Connection.java @@ -16,6 +16,7 @@ package android.telecom; +import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SystemApi; @@ -35,9 +36,7 @@ import android.os.Message; import android.os.ParcelFileDescriptor; import android.os.RemoteException; import android.os.SystemClock; -import android.telephony.Annotation.RilRadioTechnology; -import android.telephony.ServiceState; -import android.telephony.TelephonyManager; +import android.telephony.ims.ImsStreamMediaProfile; import android.util.ArraySet; import android.view.Surface; @@ -50,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; @@ -153,6 +154,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, * it does not at the moment support the function. This can be true while the call is in the @@ -475,6 +502,52 @@ public abstract class Connection extends Conferenceable { //********************************************************************************************** /** + * Define IMS Audio Codec + */ + // Current audio codec is NONE + public static final int AUDIO_CODEC_NONE = ImsStreamMediaProfile.AUDIO_QUALITY_NONE; // 0 + // Current audio codec is AMR + public static final int AUDIO_CODEC_AMR = ImsStreamMediaProfile.AUDIO_QUALITY_AMR; // 1 + // Current audio codec is AMR_WB + public static final int AUDIO_CODEC_AMR_WB = ImsStreamMediaProfile.AUDIO_QUALITY_AMR_WB; // 2 + // Current audio codec is QCELP13K + public static final int AUDIO_CODEC_QCELP13K = ImsStreamMediaProfile.AUDIO_QUALITY_QCELP13K; //3 + // Current audio codec is EVRC + public static final int AUDIO_CODEC_EVRC = ImsStreamMediaProfile.AUDIO_QUALITY_EVRC; // 4 + // Current audio codec is EVRC_B + public static final int AUDIO_CODEC_EVRC_B = ImsStreamMediaProfile.AUDIO_QUALITY_EVRC_B; // 5 + // Current audio codec is EVRC_WB + public static final int AUDIO_CODEC_EVRC_WB = ImsStreamMediaProfile.AUDIO_QUALITY_EVRC_WB; // 6 + // Current audio codec is EVRC_NW + public static final int AUDIO_CODEC_EVRC_NW = ImsStreamMediaProfile.AUDIO_QUALITY_EVRC_NW; // 7 + // Current audio codec is GSM_EFR + public static final int AUDIO_CODEC_GSM_EFR = ImsStreamMediaProfile.AUDIO_QUALITY_GSM_EFR; // 8 + // Current audio codec is GSM_FR + public static final int AUDIO_CODEC_GSM_FR = ImsStreamMediaProfile.AUDIO_QUALITY_GSM_FR; // 9 + // Current audio codec is GSM_HR + public static final int AUDIO_CODEC_GSM_HR = ImsStreamMediaProfile.AUDIO_QUALITY_GSM_HR; // 10 + // Current audio codec is G711U + public static final int AUDIO_CODEC_G711U = ImsStreamMediaProfile.AUDIO_QUALITY_G711U; // 11 + // Current audio codec is G723 + public static final int AUDIO_CODEC_G723 = ImsStreamMediaProfile.AUDIO_QUALITY_G723; // 12 + // Current audio codec is G711A + public static final int AUDIO_CODEC_G711A = ImsStreamMediaProfile.AUDIO_QUALITY_G711A; // 13 + // Current audio codec is G722 + public static final int AUDIO_CODEC_G722 = ImsStreamMediaProfile.AUDIO_QUALITY_G722; // 14 + // Current audio codec is G711AB + public static final int AUDIO_CODEC_G711AB = ImsStreamMediaProfile.AUDIO_QUALITY_G711AB; // 15 + // Current audio codec is G729 + public static final int AUDIO_CODEC_G729 = ImsStreamMediaProfile.AUDIO_QUALITY_G729; // 16 + // Current audio codec is EVS_NB + public static final int AUDIO_CODEC_EVS_NB = ImsStreamMediaProfile.AUDIO_QUALITY_EVS_NB; // 17 + // Current audio codec is EVS_WB + public static final int AUDIO_CODEC_EVS_WB = ImsStreamMediaProfile.AUDIO_QUALITY_EVS_WB; // 18 + // Current audio codec is EVS_SWB + public static final int AUDIO_CODEC_EVS_SWB = ImsStreamMediaProfile.AUDIO_QUALITY_EVS_SWB; // 19 + // Current audio codec is EVS_FB + public static final int AUDIO_CODEC_EVS_FB = ImsStreamMediaProfile.AUDIO_QUALITY_EVS_FB; // 20 + + /** * Connection extra key used to store the last forwarded number associated with the current * connection. Used to communicate to the user interface that the connection was forwarded via * the specified number. @@ -567,6 +640,13 @@ public abstract class Connection extends Conferenceable { "android.telecom.extra.IS_RTT_AUDIO_PRESENT"; /** + * The audio codec in use for the current {@link Connection}, if known. Valid values include + * {@link #AUDIO_CODEC_AMR_WB} and {@link #AUDIO_CODEC_EVS_WB}. + */ + public static final String EXTRA_AUDIO_CODEC = + "android.telecom.extra.AUDIO_CODEC"; + + /** * Connection event used to inform Telecom that it should play the on hold tone. This is used * to play a tone when the peer puts the current call on hold. Sent to Telecom via * {@link #sendConnectionEvent(String, Bundle)}. @@ -1803,6 +1883,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. */ public Connection() {} @@ -3304,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; + } } |