diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-02-06 05:06:47 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-02-06 05:06:47 +0000 |
commit | ca4d8a396e6d41716be75fc324c3bcb6aeb8ce3c (patch) | |
tree | 4003b23594b30cc0f8a348eb78dc334403dbfa4f /java/com/android/dialer | |
parent | 2afb85a26b214343b8cc7e06ea02db26943ce505 (diff) | |
parent | 0c060578e586e84ff07e3bd0f2b133f27746cd6a (diff) |
Merge "Visual Voicemail notifications now go to MainActivity when enabled."
Diffstat (limited to 'java/com/android/dialer')
-rw-r--r-- | java/com/android/dialer/app/MainComponent.java | 8 | ||||
-rw-r--r-- | java/com/android/dialer/app/calllog/VisualVoicemailNotifier.java | 10 |
2 files changed, 16 insertions, 2 deletions
diff --git a/java/com/android/dialer/app/MainComponent.java b/java/com/android/dialer/app/MainComponent.java index 9d328491d..3bd48bf15 100644 --- a/java/com/android/dialer/app/MainComponent.java +++ b/java/com/android/dialer/app/MainComponent.java @@ -111,6 +111,14 @@ public class MainComponent { return intent; } + public static Intent getShowVoicemailIntent(Context context) { + Intent intent = new Intent(); + intent.setComponent(new ComponentName(context, getComponentName())); + intent.setAction("ACTION_SHOW_TAB"); + intent.putExtra("EXTRA_SHOW_TAB", 3); + return intent; + } + private static String getComponentName() { return "com.android.dialer.main.impl.MainActivity"; } diff --git a/java/com/android/dialer/app/calllog/VisualVoicemailNotifier.java b/java/com/android/dialer/app/calllog/VisualVoicemailNotifier.java index f9cb4bf6c..78d307521 100644 --- a/java/com/android/dialer/app/calllog/VisualVoicemailNotifier.java +++ b/java/com/android/dialer/app/calllog/VisualVoicemailNotifier.java @@ -34,6 +34,7 @@ import android.telephony.TelephonyManager; import android.text.TextUtils; import com.android.contacts.common.util.ContactDisplayUtils; import com.android.dialer.app.DialtactsActivity; +import com.android.dialer.app.MainComponent; import com.android.dialer.app.R; import com.android.dialer.app.calllog.CallLogNotificationsQueryHelper.NewCall; import com.android.dialer.app.contactinfo.ContactPhotoLoader; @@ -272,8 +273,13 @@ final class VisualVoicemailNotifier { private static PendingIntent newVoicemailIntent( @NonNull Context context, @Nullable NewCall voicemail) { - Intent intent = - DialtactsActivity.getShowTabIntent(context, DialtactsPagerAdapter.TAB_INDEX_VOICEMAIL); + Intent intent; + if (MainComponent.isNuiComponentEnabled(context)) { + intent = MainComponent.getShowVoicemailIntent(context); + } else { + intent = + DialtactsActivity.getShowTabIntent(context, DialtactsPagerAdapter.TAB_INDEX_VOICEMAIL); + } // TODO (a bug): scroll to this voicemail if (voicemail != null) { intent.setData(voicemail.voicemailUri); |