summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--java/com/android/dialer/app/MainComponent.java8
-rw-r--r--java/com/android/dialer/app/calllog/VisualVoicemailNotifier.java10
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);