Loading src/com/android/settings/notification/modes/ZenModePrioritySendersPreferenceController.java +1 −0 Original line number Diff line number Diff line Loading @@ -299,6 +299,7 @@ class ZenModePrioritySendersPreferenceController List<UserHandle> userProfiles = mUserManager.getEnabledProfiles(); if (userProfiles.size() <= 1) { mContext.startActivity(intent); return; } mProfileSelectDialog = ProfileSelectDialog.createDialog(mContext, userProfiles, Loading tests/robotests/src/com/android/settings/notification/modes/ZenModePrioritySendersPreferenceControllerTest.java +15 −0 Original line number Diff line number Diff line Loading @@ -1545,6 +1545,21 @@ public final class ZenModePrioritySendersPreferenceControllerTest { assertThat(nextActivity.getAction()).isEqualTo(Intent.ACTION_MAIN); } @Test public void contactsSettingsClick_singleProfile_opensActivityWithoutDialog() { String contactsPackage = mContext.getString(R.string.config_contacts_package_name); setUpContactsApp(contactsPackage, /* withPreciseIntents= */ true); mCallsController.displayPreference(mPreferenceScreen); mCallsController.updateZenMode(mCallsPrefCategory, TestModeBuilder.EXAMPLE); SelectorWithWidgetPreference contactsPref = getBoundSelectorPreference(KEY_CONTACTS); contactsPref.getExtraWidget().performClick(); assertThat(ShadowDialog.getLatestDialog()).isNull(); assertThat(shadowOf(mActivity).getNextStartedActivity()).isNotNull(); } @Test public void contactsSettingsClick_multipleProfiles_showsProfileChooserDialog() { String contactsPackage = mContext.getString(R.string.config_contacts_package_name); Loading Loading
src/com/android/settings/notification/modes/ZenModePrioritySendersPreferenceController.java +1 −0 Original line number Diff line number Diff line Loading @@ -299,6 +299,7 @@ class ZenModePrioritySendersPreferenceController List<UserHandle> userProfiles = mUserManager.getEnabledProfiles(); if (userProfiles.size() <= 1) { mContext.startActivity(intent); return; } mProfileSelectDialog = ProfileSelectDialog.createDialog(mContext, userProfiles, Loading
tests/robotests/src/com/android/settings/notification/modes/ZenModePrioritySendersPreferenceControllerTest.java +15 −0 Original line number Diff line number Diff line Loading @@ -1545,6 +1545,21 @@ public final class ZenModePrioritySendersPreferenceControllerTest { assertThat(nextActivity.getAction()).isEqualTo(Intent.ACTION_MAIN); } @Test public void contactsSettingsClick_singleProfile_opensActivityWithoutDialog() { String contactsPackage = mContext.getString(R.string.config_contacts_package_name); setUpContactsApp(contactsPackage, /* withPreciseIntents= */ true); mCallsController.displayPreference(mPreferenceScreen); mCallsController.updateZenMode(mCallsPrefCategory, TestModeBuilder.EXAMPLE); SelectorWithWidgetPreference contactsPref = getBoundSelectorPreference(KEY_CONTACTS); contactsPref.getExtraWidget().performClick(); assertThat(ShadowDialog.getLatestDialog()).isNull(); assertThat(shadowOf(mActivity).getNextStartedActivity()).isNotNull(); } @Test public void contactsSettingsClick_multipleProfiles_showsProfileChooserDialog() { String contactsPackage = mContext.getString(R.string.config_contacts_package_name); Loading