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
diff --git a/api/current.txt b/api/current.txt
index 64d6c79..dbf28db 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -28068,6 +28068,7 @@
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 @@
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 5a41acb..cbc8339 100644
--- a/telecomm/java/android/telecomm/Call.java
+++ b/telecomm/java/android/telecomm/Call.java
@@ -79,6 +79,7 @@
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 @@
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 @@
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 @@
Objects.hashCode(mDisconnectCauseMsg) +
Objects.hashCode(mConnectTimeMillis) +
Objects.hashCode(mGatewayInfo) +
- Objects.hashCode(mVideoState);
+ Objects.hashCode(mVideoState) +
+ Objects.hashCode(mStatusHints);
}
/** {@hide} */
@@ -214,7 +224,8 @@
String disconnectCauseMsg,
long connectTimeMillis,
GatewayInfo gatewayInfo,
- int videoState) {
+ int videoState,
+ StatusHints statusHints) {
mHandle = handle;
mHandlePresentation = handlePresentation;
mCallerDisplayName = callerDisplayName;
@@ -226,6 +237,7 @@
mConnectTimeMillis = connectTimeMillis;
mGatewayInfo = gatewayInfo;
mVideoState = videoState;
+ mStatusHints = statusHints;
}
}
@@ -572,7 +584,8 @@
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 028b6e4..27d92b2 100644
--- a/telecomm/java/android/telecomm/InCallService.java
+++ b/telecomm/java/android/telecomm/InCallService.java
@@ -56,7 +56,7 @@
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 b50c1d7..0ede387 100644
--- a/telecomm/java/android/telecomm/TelecommConstants.java
+++ b/telecomm/java/android/telecomm/TelecommConstants.java
@@ -111,6 +111,16 @@
"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.
+ * <p>
+ * 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.
*/