diff options
author | sail <sail@google.com> | 2017-07-05 18:01:29 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-07-10 10:46:27 -0700 |
commit | 061b6eb8dac57aa9d28dfdd1f8853879a2274b17 (patch) | |
tree | 7a12db7b53684f7fa64c583da1cae91ca0cfa2c3 | |
parent | 3128dea03a0e3981511dfed6f3ef555f0b574725 (diff) |
Update REASON_IMS_ACCESS_BLOCKED definition to match framework change.
This is changed in ag/2484808 to be defined by a constant telecom string. It
will be available to public in O MR. We have to hard code it until then.
(This is a take over of cl/161020406 from wangqi@)
Test: VideoCallNotAvailablePromptTest
PiperOrigin-RevId: 161030078
Change-Id: I0e1d8d98cb1f64b035d9063b28f8ba039c7378e4
-rw-r--r-- | java/com/android/contacts/common/compat/telecom/TelecomManagerCompat.java | 5 | ||||
-rw-r--r-- | java/com/android/incallui/disconnectdialog/VideoCallNotAvailablePrompt.java | 5 |
2 files changed, 7 insertions, 3 deletions
diff --git a/java/com/android/contacts/common/compat/telecom/TelecomManagerCompat.java b/java/com/android/contacts/common/compat/telecom/TelecomManagerCompat.java index e6f424788..172fb11e3 100644 --- a/java/com/android/contacts/common/compat/telecom/TelecomManagerCompat.java +++ b/java/com/android/contacts/common/compat/telecom/TelecomManagerCompat.java @@ -35,6 +35,11 @@ public class TelecomManagerCompat { public static final String EXTRA_HANDOVER_VIDEO_STATE = "android.telecom.extra.HANDOVER_VIDEO_STATE"; + // This is a hidden constant in android.telecom.DisconnectCause. Telecom sets this as a disconnect + // reason if it wants us to prompt the user that the video call is not available. + // TODO(wangqi): Reference it to constant in android.telecom.DisconnectCause. + public static final String REASON_IMS_ACCESS_BLOCKED = "REASON_IMS_ACCESS_BLOCKED"; + /** * Returns the current SIM call manager. Apps must be prepared for this method to return null, * indicating that there currently exists no registered SIM call manager. diff --git a/java/com/android/incallui/disconnectdialog/VideoCallNotAvailablePrompt.java b/java/com/android/incallui/disconnectdialog/VideoCallNotAvailablePrompt.java index 34db976b2..526d45ed7 100644 --- a/java/com/android/incallui/disconnectdialog/VideoCallNotAvailablePrompt.java +++ b/java/com/android/incallui/disconnectdialog/VideoCallNotAvailablePrompt.java @@ -24,6 +24,7 @@ import android.support.annotation.NonNull; import android.telecom.DisconnectCause; import android.telecom.PhoneAccountHandle; import android.util.Pair; +import com.android.contacts.common.compat.telecom.TelecomManagerCompat; import com.android.dialer.callintent.CallInitiationType; import com.android.dialer.callintent.CallIntentBuilder; import com.android.dialer.common.LogUtil; @@ -33,12 +34,10 @@ import com.android.incallui.call.DialerCall; /** Prompt user to make voice call if video call is not currently available. */ public class VideoCallNotAvailablePrompt implements DisconnectDialog { - private static final String REASON_IMS_ACCESS_BLOCKED = "IMS_ACCESS_BLOCKED"; - @Override public boolean shouldShow(DisconnectCause disconnectCause) { if (disconnectCause.getCode() == DisconnectCause.ERROR - && REASON_IMS_ACCESS_BLOCKED.equals(disconnectCause.getReason())) { + && TelecomManagerCompat.REASON_IMS_ACCESS_BLOCKED.equals(disconnectCause.getReason())) { LogUtil.i( "VideoCallNotAvailablePrompt.shouldShowPrompt", "showing prompt for disconnect cause: %s", |