diff --git a/src/com/android/settings/notification/zen/ZenModePrioritySendersPreferenceController.java b/src/com/android/settings/notification/zen/ZenModePrioritySendersPreferenceController.java index 482865c40ab..d89163d0c1b 100644 --- a/src/com/android/settings/notification/zen/ZenModePrioritySendersPreferenceController.java +++ b/src/com/android/settings/notification/zen/ZenModePrioritySendersPreferenceController.java @@ -54,10 +54,13 @@ public class ZenModePrioritySendersPreferenceController @VisibleForTesting static final String KEY_NONE = "senders_none"; private static final Intent ALL_CONTACTS_INTENT = - new Intent(Contacts.Intents.UI.LIST_DEFAULT); + new Intent(Contacts.Intents.UI.LIST_DEFAULT) + .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); private static final Intent STARRED_CONTACTS_INTENT = - new Intent(Contacts.Intents.UI.LIST_STARRED_ACTION); - private static final Intent FALLBACK_INTENT = new Intent(Intent.ACTION_MAIN); + new Intent(Contacts.Intents.UI.LIST_STARRED_ACTION) + .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); + private static final Intent FALLBACK_INTENT = new Intent(Intent.ACTION_MAIN) + .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); private final PackageManager mPackageManager; private final boolean mIsMessages; // if this is false, then this preference is for calls diff --git a/src/com/android/settings/notification/zen/ZenRuleStarredContactsPreferenceController.java b/src/com/android/settings/notification/zen/ZenRuleStarredContactsPreferenceController.java index a6de68c2546..3ac66337eb4 100644 --- a/src/com/android/settings/notification/zen/ZenRuleStarredContactsPreferenceController.java +++ b/src/com/android/settings/notification/zen/ZenRuleStarredContactsPreferenceController.java @@ -43,10 +43,12 @@ public class ZenRuleStarredContactsPreferenceController extends mPriorityCategory = priorityCategory; mPackageManager = mContext.getPackageManager(); - mStarredContactsIntent = new Intent(Contacts.Intents.UI.LIST_STARRED_ACTION); + mStarredContactsIntent = new Intent(Contacts.Intents.UI.LIST_STARRED_ACTION) + .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); mFallbackIntent = new Intent(Intent.ACTION_MAIN); mFallbackIntent.addCategory(Intent.CATEGORY_APP_CONTACTS); + mFallbackIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); } @Override