Add action to the voicemail notification.
If there is only one voicemail, add an action to directly play the
voicemail.
Bug: 6288434
Change-Id: I654864d32f7f5fb64c946d23ad95b692aa950246
diff --git a/src/com/android/contacts/CallDetailActivity.java b/src/com/android/contacts/CallDetailActivity.java
index 1fac6c8..47441ce 100644
--- a/src/com/android/contacts/CallDetailActivity.java
+++ b/src/com/android/contacts/CallDetailActivity.java
@@ -97,6 +97,8 @@
public static final String EXTRA_VOICEMAIL_URI = "EXTRA_VOICEMAIL_URI";
/** If we should immediately start playback of the voicemail, this extra will be set to true. */
public static final String EXTRA_VOICEMAIL_START_PLAYBACK = "EXTRA_VOICEMAIL_START_PLAYBACK";
+ /** If the activity was triggered from a notification. */
+ public static final String EXTRA_FROM_NOTIFICATION = "EXTRA_FROM_NOTIFICATION";
private CallTypeHelper mCallTypeHelper;
private PhoneNumberHelper mPhoneNumberHelper;
@@ -273,6 +275,9 @@
mContactInfoHelper = new ContactInfoHelper(this, ContactsUtils.getCurrentCountryIso(this));
configureActionBar();
optionallyHandleVoicemail();
+ if (getIntent().getBooleanExtra(EXTRA_FROM_NOTIFICATION, false)) {
+ closeSystemDialogs();
+ }
}
@Override
@@ -879,6 +884,10 @@
mPhoneNumberActionMode = startActionMode(new PhoneNumberActionModeCallback(targetView));
}
+ private void closeSystemDialogs() {
+ sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));
+ }
+
private class PhoneNumberActionModeCallback implements ActionMode.Callback {
private final View mTargetView;
private final Drawable mOriginalViewBackground;