From 5b49adea48b56f046125787ed4ff4cec02b4c285 Mon Sep 17 00:00:00 2001 From: Evan Charlton Date: Tue, 15 Jul 2014 17:03:20 -0700 Subject: [PATCH] Plumb through StatusHints change notifications When StatusHints are modified, inform listeners. Also expose two constants for passing optional strings from the CallService to the in-call UI. Bug: 13334257 Bug: 13334252 Change-Id: If7fde7c1ca6940cec8b7232469a22900c36dbb17 --- api/current.txt | 2 ++ telecomm/java/android/telecomm/Call.java | 21 +++++++++++++++---- .../java/android/telecomm/InCallService.java | 2 +- .../android/telecomm/TelecommConstants.java | 10 +++++++++ 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/api/current.txt b/api/current.txt index 64d6c794fe79c..dbf28dbd57336 100644 --- a/api/current.txt +++ b/api/current.txt @@ -28068,6 +28068,7 @@ package android.telecomm { method public android.telecomm.GatewayInfo getGatewayInfo(); method public android.net.Uri getHandle(); method public int getHandlePresentation(); + method public android.telecomm.StatusHints getStatusHints(); method public int getVideoState(); } @@ -28463,6 +28464,7 @@ package android.telecomm { field public static final java.lang.String EXTRA_CALL_DISCONNECT_CAUSE = "android.telecomm.extra.CALL_DISCONNECT_CAUSE"; field public static final java.lang.String EXTRA_CALL_DISCONNECT_MESSAGE = "android.telecomm.extra.CALL_DISCONNECT_MESSAGE"; field public static final java.lang.String EXTRA_CONNECTION_SERVICE = "android.telecomm.extra.CONNECTION_SERVICE"; + field public static final java.lang.String EXTRA_EMERGENCY_CALL_BACK_NUMBER = "android.telecomm.extra.EMERGENCY_CALL_BACK_NUMBER"; field public static final java.lang.String EXTRA_INCOMING_CALL_EXTRAS = "android.intent.extra.INCOMING_CALL_EXTRAS"; field public static final java.lang.String EXTRA_PHONE_ACCOUNT = "android.intent.extra.PHONE_ACCOUNT"; field public static final java.lang.String EXTRA_START_CALL_WITH_SPEAKERPHONE = "android.intent.extra.START_CALL_WITH_SPEAKERPHONE"; diff --git a/telecomm/java/android/telecomm/Call.java b/telecomm/java/android/telecomm/Call.java index 5a41acbdca6d9..cbc8339a8f354 100644 --- a/telecomm/java/android/telecomm/Call.java +++ b/telecomm/java/android/telecomm/Call.java @@ -79,6 +79,7 @@ public final class Call { private final long mConnectTimeMillis; private final GatewayInfo mGatewayInfo; private final int mVideoState; + private final StatusHints mStatusHints; /** * @return The handle (e.g., phone number) to which the {@code Call} is currently @@ -165,6 +166,13 @@ public final class Call { return mVideoState; } + /* + * @return The current {@link android.telecomm.StatusHints}, or null if none has been set. + */ + public StatusHints getStatusHints() { + return mStatusHints; + } + @Override public boolean equals(Object o) { if (o instanceof Details) { @@ -181,7 +189,8 @@ public final class Call { Objects.equals(mDisconnectCauseMsg, d.mDisconnectCauseMsg) && Objects.equals(mConnectTimeMillis, d.mConnectTimeMillis) && Objects.equals(mGatewayInfo, d.mGatewayInfo) && - Objects.equals(mVideoState, d.mVideoState); + Objects.equals(mVideoState, d.mVideoState) && + Objects.equals(mStatusHints, d.mStatusHints); } return false; } @@ -199,7 +208,8 @@ public final class Call { Objects.hashCode(mDisconnectCauseMsg) + Objects.hashCode(mConnectTimeMillis) + Objects.hashCode(mGatewayInfo) + - Objects.hashCode(mVideoState); + Objects.hashCode(mVideoState) + + Objects.hashCode(mStatusHints); } /** {@hide} */ @@ -214,7 +224,8 @@ public final class Call { String disconnectCauseMsg, long connectTimeMillis, GatewayInfo gatewayInfo, - int videoState) { + int videoState, + StatusHints statusHints) { mHandle = handle; mHandlePresentation = handlePresentation; mCallerDisplayName = callerDisplayName; @@ -226,6 +237,7 @@ public final class Call { mConnectTimeMillis = connectTimeMillis; mGatewayInfo = gatewayInfo; mVideoState = videoState; + mStatusHints = statusHints; } } @@ -572,7 +584,8 @@ public final class Call { inCallCall.getDisconnectCauseMsg(), inCallCall.getConnectTimeMillis(), inCallCall.getGatewayInfo(), - inCallCall.getVideoState()); + inCallCall.getVideoState(), + inCallCall.getStatusHints()); boolean detailsChanged = !Objects.equals(mDetails, details); if (detailsChanged) { mDetails = details; diff --git a/telecomm/java/android/telecomm/InCallService.java b/telecomm/java/android/telecomm/InCallService.java index 028b6e49e34e4..27d92b2a7d695 100644 --- a/telecomm/java/android/telecomm/InCallService.java +++ b/telecomm/java/android/telecomm/InCallService.java @@ -56,7 +56,7 @@ public abstract class InCallService { case MSG_UPDATE_CALL: mPhone.internalUpdateCall((InCallCall) msg.obj); break; - case MSG_SET_POST_DIAL: { + case MSG_SET_POST_DIAL: { SomeArgs args = (SomeArgs) msg.obj; try { String callId = (String) args.arg1; diff --git a/telecomm/java/android/telecomm/TelecommConstants.java b/telecomm/java/android/telecomm/TelecommConstants.java index b50c1d71212b9..0ede387aeb0ae 100644 --- a/telecomm/java/android/telecomm/TelecommConstants.java +++ b/telecomm/java/android/telecomm/TelecommConstants.java @@ -110,6 +110,16 @@ public final class TelecommConstants { public static final String EXTRA_CONNECTION_SERVICE = "android.telecomm.extra.CONNECTION_SERVICE"; + /** + * The number which emergency services will use to return calls, if necessary. The in-call UI + * will take care of displaying this to the user. + *

+ * Note that this should only be populated for emergency numbers, and if the number emergency + * services will see is different than the user's known phone number. + */ + public static final String EXTRA_EMERGENCY_CALL_BACK_NUMBER = + "android.telecomm.extra.EMERGENCY_CALL_BACK_NUMBER"; + /** * The dual tone multi-frequency signaling character sent to indicate the dialing system should * pause for a predefined period.