Loading services/core/java/com/android/server/notification/NotificationManagerService.java +2 −0 Original line number Diff line number Diff line Loading @@ -1020,6 +1020,7 @@ public class NotificationManagerService extends SystemService { } mAssistants.resetDefaultAssistantsIfNecessary(); mPreferencesHelper.syncChannelsBypassingDnd(); } @VisibleForTesting Loading Loading @@ -1859,6 +1860,7 @@ public class NotificationManagerService extends SystemService { mConditionProviders.onUserSwitched(userId); mListeners.onUserSwitched(userId); mZenModeHelper.onUserSwitched(userId); mPreferencesHelper.syncChannelsBypassingDnd(); } // assistant is the only thing that cares about managed profiles specifically mAssistants.onUserSwitched(userId); Loading services/core/java/com/android/server/notification/PreferencesHelper.java +32 −26 Original line number Diff line number Diff line Loading @@ -202,7 +202,7 @@ public class PreferencesHelper implements RankingConfig { private SparseBooleanArray mLockScreenShowNotifications; private SparseBooleanArray mLockScreenPrivateNotifications; private boolean mIsMediaNotificationFilteringEnabled = DEFAULT_MEDIA_NOTIFICATION_FILTERING; private boolean mAreChannelsBypassingDnd; private boolean mCurrentUserHasChannelsBypassingDnd; private boolean mHideSilentStatusBarIcons = DEFAULT_HIDE_SILENT_STATUS_BAR_ICONS; private boolean mShowReviewPermissionsNotification; Loading Loading @@ -230,7 +230,6 @@ public class PreferencesHelper implements RankingConfig { updateBadgingEnabled(); updateBubblesEnabled(); updateMediaNotificationFilteringEnabled(); syncChannelsBypassingDnd(Process.SYSTEM_UID, true); // init comes from system } public void readXml(TypedXmlPullParser parser, boolean forRestore, int userId) Loading Loading @@ -893,7 +892,7 @@ public class PreferencesHelper implements RankingConfig { r.groups.put(group.getId(), group); } if (needsDndChange) { updateChannelsBypassingDnd(callingUid, fromSystemOrSystemUi); updateCurrentUserHasChannelsBypassingDnd(callingUid, fromSystemOrSystemUi); } } Loading Loading @@ -972,7 +971,7 @@ public class PreferencesHelper implements RankingConfig { existing.setBypassDnd(bypassDnd); needsPolicyFileChange = true; if (bypassDnd != mAreChannelsBypassingDnd if (bypassDnd != mCurrentUserHasChannelsBypassingDnd || previousExistingImportance != existing.getImportance()) { needsDndChange = true; } Loading Loading @@ -1031,7 +1030,7 @@ public class PreferencesHelper implements RankingConfig { } r.channels.put(channel.getId(), channel); if (channel.canBypassDnd() != mAreChannelsBypassingDnd) { if (channel.canBypassDnd() != mCurrentUserHasChannelsBypassingDnd) { needsDndChange = true; } MetricsLogger.action(getChannelLog(channel, pkg).setType( Loading @@ -1041,7 +1040,7 @@ public class PreferencesHelper implements RankingConfig { } if (needsDndChange) { updateChannelsBypassingDnd(callingUid, fromSystemOrSystemUi); updateCurrentUserHasChannelsBypassingDnd(callingUid, fromSystemOrSystemUi); } return needsPolicyFileChange; Loading Loading @@ -1127,14 +1126,14 @@ public class PreferencesHelper implements RankingConfig { // relevantly affected without the parent channel already having been. } if (updatedChannel.canBypassDnd() != mAreChannelsBypassingDnd if (updatedChannel.canBypassDnd() != mCurrentUserHasChannelsBypassingDnd || channel.getImportance() != updatedChannel.getImportance()) { needsDndChange = true; changed = true; } } if (needsDndChange) { updateChannelsBypassingDnd(callingUid, fromSystemOrSystemUi); updateCurrentUserHasChannelsBypassingDnd(callingUid, fromSystemOrSystemUi); } if (changed) { updateConfig(); Loading Loading @@ -1321,7 +1320,7 @@ public class PreferencesHelper implements RankingConfig { } } if (channelBypassedDnd) { updateChannelsBypassingDnd(callingUid, fromSystemOrSystemUi); updateCurrentUserHasChannelsBypassingDnd(callingUid, fromSystemOrSystemUi); } return deletedChannel; } Loading Loading @@ -1538,7 +1537,7 @@ public class PreferencesHelper implements RankingConfig { } } if (groupBypassedDnd) { updateChannelsBypassingDnd(callingUid, fromSystemOrSystemUi); updateCurrentUserHasChannelsBypassingDnd(callingUid, fromSystemOrSystemUi); } return deletedChannels; } Loading Loading @@ -1685,8 +1684,8 @@ public class PreferencesHelper implements RankingConfig { } } } if (!deletedChannelIds.isEmpty() && mAreChannelsBypassingDnd) { updateChannelsBypassingDnd(callingUid, fromSystemOrSystemUi); if (!deletedChannelIds.isEmpty() && mCurrentUserHasChannelsBypassingDnd) { updateCurrentUserHasChannelsBypassingDnd(callingUid, fromSystemOrSystemUi); } return deletedChannelIds; } Loading Loading @@ -1788,21 +1787,28 @@ public class PreferencesHelper implements RankingConfig { } /** * Syncs {@link #mAreChannelsBypassingDnd} with the current user's notification policy before * updating * Syncs {@link #mCurrentUserHasChannelsBypassingDnd} with the current user's notification * policy before updating. Must be called: * <ul> * <li>On system init, after channels and DND configurations are loaded.</li> * <li>When the current user changes, after the corresponding DND config is loaded.</li> * </ul> */ private void syncChannelsBypassingDnd(int callingUid, boolean fromSystemOrSystemUi) { mAreChannelsBypassingDnd = (mZenModeHelper.getNotificationPolicy().state & NotificationManager.Policy.STATE_CHANNELS_BYPASSING_DND) == 1; void syncChannelsBypassingDnd() { mCurrentUserHasChannelsBypassingDnd = (mZenModeHelper.getNotificationPolicy().state & NotificationManager.Policy.STATE_CHANNELS_BYPASSING_DND) != 0; updateChannelsBypassingDnd(callingUid, fromSystemOrSystemUi); updateCurrentUserHasChannelsBypassingDnd(/* callingUid= */ Process.SYSTEM_UID, /* fromSystemOrSystemUi= */ true); } /** * Updates the user's NotificationPolicy based on whether the current userId * has channels bypassing DND * Updates the user's NotificationPolicy based on whether the current userId has channels * bypassing DND. It should be called whenever a channel is created, updated, or deleted, or * when the current user is switched. */ private void updateChannelsBypassingDnd(int callingUid, boolean fromSystemOrSystemUi) { private void updateCurrentUserHasChannelsBypassingDnd(int callingUid, boolean fromSystemOrSystemUi) { ArraySet<Pair<String, Integer>> candidatePkgs = new ArraySet<>(); final int currentUserId = getCurrentUser(); Loading @@ -1817,7 +1823,7 @@ public class PreferencesHelper implements RankingConfig { for (NotificationChannel channel : r.channels.values()) { if (channelIsLiveLocked(r, channel) && channel.canBypassDnd()) { candidatePkgs.add(new Pair(r.pkg, r.uid)); candidatePkgs.add(new Pair<>(r.pkg, r.uid)); break; } } Loading @@ -1830,9 +1836,9 @@ public class PreferencesHelper implements RankingConfig { } } boolean haveBypassingApps = candidatePkgs.size() > 0; if (mAreChannelsBypassingDnd != haveBypassingApps) { mAreChannelsBypassingDnd = haveBypassingApps; updateZenPolicy(mAreChannelsBypassingDnd, callingUid, fromSystemOrSystemUi); if (mCurrentUserHasChannelsBypassingDnd != haveBypassingApps) { mCurrentUserHasChannelsBypassingDnd = haveBypassingApps; updateZenPolicy(mCurrentUserHasChannelsBypassingDnd, callingUid, fromSystemOrSystemUi); } } Loading Loading @@ -1869,7 +1875,7 @@ public class PreferencesHelper implements RankingConfig { } public boolean areChannelsBypassingDnd() { return mAreChannelsBypassingDnd; return mCurrentUserHasChannelsBypassingDnd; } /** Loading services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java +20 −0 Original line number Diff line number Diff line Loading @@ -421,6 +421,7 @@ public class NotificationManagerServiceTest extends UiServiceTestCase { @Mock MultiRateLimiter mToastRateLimiter; BroadcastReceiver mPackageIntentReceiver; BroadcastReceiver mUserSwitchIntentReceiver; NotificationRecordLoggerFake mNotificationRecordLogger = new NotificationRecordLoggerFake(); TestableNotificationManagerService.StrongAuthTrackerFake mStrongAuthTracker; Loading Loading @@ -651,8 +652,12 @@ public class NotificationManagerServiceTest extends UiServiceTestCase { && filter.hasAction(Intent.ACTION_PACKAGES_SUSPENDED)) { mPackageIntentReceiver = broadcastReceivers.get(i); } if (filter.hasAction(Intent.ACTION_USER_SWITCHED)) { mUserSwitchIntentReceiver = broadcastReceivers.get(i); } } assertNotNull("package intent receiver should exist", mPackageIntentReceiver); assertNotNull("User-switch receiver should exist", mUserSwitchIntentReceiver); // Pretend the shortcut exists List<ShortcutInfo> shortcutInfos = new ArrayList<>(); Loading Loading @@ -12148,6 +12153,21 @@ public class NotificationManagerServiceTest extends UiServiceTestCase { any(), eq(FLAG_ACTIVITY_SENDER | FLAG_BROADCAST_SENDER | FLAG_SERVICE_SENDER)); } @Test public void onUserSwitched_updatesZenModeAndChannelsBypassingDnd() { Intent intent = new Intent(Intent.ACTION_USER_SWITCHED); intent.putExtra(Intent.EXTRA_USER_HANDLE, 20); mService.mZenModeHelper = mock(ZenModeHelper.class); mService.setPreferencesHelper(mPreferencesHelper); mUserSwitchIntentReceiver.onReceive(mContext, intent); InOrder inOrder = inOrder(mPreferencesHelper, mService.mZenModeHelper); inOrder.verify(mService.mZenModeHelper).onUserSwitched(eq(20)); inOrder.verify(mPreferencesHelper).syncChannelsBypassingDnd(); inOrder.verifyNoMoreInteractions(); } private static <T extends Parcelable> T parcelAndUnparcel(T source, Parcelable.Creator<T> creator) { Parcel parcel = Parcel.obtain(); services/tests/uiservicestests/src/com/android/server/notification/PreferencesHelperTest.java +4 −1 Original line number Diff line number Diff line Loading @@ -2478,7 +2478,7 @@ public class PreferencesHelperTest extends UiServiceTestCase { mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper, mPermissionHelper, mPermissionManager, mLogger, mAppOpsManager, mStatsEventBuilderFactory, false); mHelper.syncChannelsBypassingDnd(); // create notification channel that can bypass dnd, but app is blocked // expected result: areChannelsBypassingDnd = false Loading Loading @@ -2509,6 +2509,7 @@ public class PreferencesHelperTest extends UiServiceTestCase { mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper, mPermissionHelper, mPermissionManager, mLogger, mAppOpsManager, mStatsEventBuilderFactory, false); mHelper.syncChannelsBypassingDnd(); // create notification channel that can bypass dnd, but app is blocked // expected result: areChannelsBypassingDnd = false Loading @@ -2533,6 +2534,7 @@ public class PreferencesHelperTest extends UiServiceTestCase { mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper, mPermissionHelper, mPermissionManager, mLogger, mAppOpsManager, mStatsEventBuilderFactory, false); mHelper.syncChannelsBypassingDnd(); // create notification channel that can bypass dnd, but app is blocked // expected result: areChannelsBypassingDnd = false Loading Loading @@ -2587,6 +2589,7 @@ public class PreferencesHelperTest extends UiServiceTestCase { mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper, mPermissionHelper, mPermissionManager, mLogger, mAppOpsManager, mStatsEventBuilderFactory, false); mHelper.syncChannelsBypassingDnd(); assertFalse(mHelper.areChannelsBypassingDnd()); verify(mMockZenModeHelper, times(1)).setNotificationPolicy(any(), anyInt(), anyBoolean()); resetZenModeHelper(); Loading Loading
services/core/java/com/android/server/notification/NotificationManagerService.java +2 −0 Original line number Diff line number Diff line Loading @@ -1020,6 +1020,7 @@ public class NotificationManagerService extends SystemService { } mAssistants.resetDefaultAssistantsIfNecessary(); mPreferencesHelper.syncChannelsBypassingDnd(); } @VisibleForTesting Loading Loading @@ -1859,6 +1860,7 @@ public class NotificationManagerService extends SystemService { mConditionProviders.onUserSwitched(userId); mListeners.onUserSwitched(userId); mZenModeHelper.onUserSwitched(userId); mPreferencesHelper.syncChannelsBypassingDnd(); } // assistant is the only thing that cares about managed profiles specifically mAssistants.onUserSwitched(userId); Loading
services/core/java/com/android/server/notification/PreferencesHelper.java +32 −26 Original line number Diff line number Diff line Loading @@ -202,7 +202,7 @@ public class PreferencesHelper implements RankingConfig { private SparseBooleanArray mLockScreenShowNotifications; private SparseBooleanArray mLockScreenPrivateNotifications; private boolean mIsMediaNotificationFilteringEnabled = DEFAULT_MEDIA_NOTIFICATION_FILTERING; private boolean mAreChannelsBypassingDnd; private boolean mCurrentUserHasChannelsBypassingDnd; private boolean mHideSilentStatusBarIcons = DEFAULT_HIDE_SILENT_STATUS_BAR_ICONS; private boolean mShowReviewPermissionsNotification; Loading Loading @@ -230,7 +230,6 @@ public class PreferencesHelper implements RankingConfig { updateBadgingEnabled(); updateBubblesEnabled(); updateMediaNotificationFilteringEnabled(); syncChannelsBypassingDnd(Process.SYSTEM_UID, true); // init comes from system } public void readXml(TypedXmlPullParser parser, boolean forRestore, int userId) Loading Loading @@ -893,7 +892,7 @@ public class PreferencesHelper implements RankingConfig { r.groups.put(group.getId(), group); } if (needsDndChange) { updateChannelsBypassingDnd(callingUid, fromSystemOrSystemUi); updateCurrentUserHasChannelsBypassingDnd(callingUid, fromSystemOrSystemUi); } } Loading Loading @@ -972,7 +971,7 @@ public class PreferencesHelper implements RankingConfig { existing.setBypassDnd(bypassDnd); needsPolicyFileChange = true; if (bypassDnd != mAreChannelsBypassingDnd if (bypassDnd != mCurrentUserHasChannelsBypassingDnd || previousExistingImportance != existing.getImportance()) { needsDndChange = true; } Loading Loading @@ -1031,7 +1030,7 @@ public class PreferencesHelper implements RankingConfig { } r.channels.put(channel.getId(), channel); if (channel.canBypassDnd() != mAreChannelsBypassingDnd) { if (channel.canBypassDnd() != mCurrentUserHasChannelsBypassingDnd) { needsDndChange = true; } MetricsLogger.action(getChannelLog(channel, pkg).setType( Loading @@ -1041,7 +1040,7 @@ public class PreferencesHelper implements RankingConfig { } if (needsDndChange) { updateChannelsBypassingDnd(callingUid, fromSystemOrSystemUi); updateCurrentUserHasChannelsBypassingDnd(callingUid, fromSystemOrSystemUi); } return needsPolicyFileChange; Loading Loading @@ -1127,14 +1126,14 @@ public class PreferencesHelper implements RankingConfig { // relevantly affected without the parent channel already having been. } if (updatedChannel.canBypassDnd() != mAreChannelsBypassingDnd if (updatedChannel.canBypassDnd() != mCurrentUserHasChannelsBypassingDnd || channel.getImportance() != updatedChannel.getImportance()) { needsDndChange = true; changed = true; } } if (needsDndChange) { updateChannelsBypassingDnd(callingUid, fromSystemOrSystemUi); updateCurrentUserHasChannelsBypassingDnd(callingUid, fromSystemOrSystemUi); } if (changed) { updateConfig(); Loading Loading @@ -1321,7 +1320,7 @@ public class PreferencesHelper implements RankingConfig { } } if (channelBypassedDnd) { updateChannelsBypassingDnd(callingUid, fromSystemOrSystemUi); updateCurrentUserHasChannelsBypassingDnd(callingUid, fromSystemOrSystemUi); } return deletedChannel; } Loading Loading @@ -1538,7 +1537,7 @@ public class PreferencesHelper implements RankingConfig { } } if (groupBypassedDnd) { updateChannelsBypassingDnd(callingUid, fromSystemOrSystemUi); updateCurrentUserHasChannelsBypassingDnd(callingUid, fromSystemOrSystemUi); } return deletedChannels; } Loading Loading @@ -1685,8 +1684,8 @@ public class PreferencesHelper implements RankingConfig { } } } if (!deletedChannelIds.isEmpty() && mAreChannelsBypassingDnd) { updateChannelsBypassingDnd(callingUid, fromSystemOrSystemUi); if (!deletedChannelIds.isEmpty() && mCurrentUserHasChannelsBypassingDnd) { updateCurrentUserHasChannelsBypassingDnd(callingUid, fromSystemOrSystemUi); } return deletedChannelIds; } Loading Loading @@ -1788,21 +1787,28 @@ public class PreferencesHelper implements RankingConfig { } /** * Syncs {@link #mAreChannelsBypassingDnd} with the current user's notification policy before * updating * Syncs {@link #mCurrentUserHasChannelsBypassingDnd} with the current user's notification * policy before updating. Must be called: * <ul> * <li>On system init, after channels and DND configurations are loaded.</li> * <li>When the current user changes, after the corresponding DND config is loaded.</li> * </ul> */ private void syncChannelsBypassingDnd(int callingUid, boolean fromSystemOrSystemUi) { mAreChannelsBypassingDnd = (mZenModeHelper.getNotificationPolicy().state & NotificationManager.Policy.STATE_CHANNELS_BYPASSING_DND) == 1; void syncChannelsBypassingDnd() { mCurrentUserHasChannelsBypassingDnd = (mZenModeHelper.getNotificationPolicy().state & NotificationManager.Policy.STATE_CHANNELS_BYPASSING_DND) != 0; updateChannelsBypassingDnd(callingUid, fromSystemOrSystemUi); updateCurrentUserHasChannelsBypassingDnd(/* callingUid= */ Process.SYSTEM_UID, /* fromSystemOrSystemUi= */ true); } /** * Updates the user's NotificationPolicy based on whether the current userId * has channels bypassing DND * Updates the user's NotificationPolicy based on whether the current userId has channels * bypassing DND. It should be called whenever a channel is created, updated, or deleted, or * when the current user is switched. */ private void updateChannelsBypassingDnd(int callingUid, boolean fromSystemOrSystemUi) { private void updateCurrentUserHasChannelsBypassingDnd(int callingUid, boolean fromSystemOrSystemUi) { ArraySet<Pair<String, Integer>> candidatePkgs = new ArraySet<>(); final int currentUserId = getCurrentUser(); Loading @@ -1817,7 +1823,7 @@ public class PreferencesHelper implements RankingConfig { for (NotificationChannel channel : r.channels.values()) { if (channelIsLiveLocked(r, channel) && channel.canBypassDnd()) { candidatePkgs.add(new Pair(r.pkg, r.uid)); candidatePkgs.add(new Pair<>(r.pkg, r.uid)); break; } } Loading @@ -1830,9 +1836,9 @@ public class PreferencesHelper implements RankingConfig { } } boolean haveBypassingApps = candidatePkgs.size() > 0; if (mAreChannelsBypassingDnd != haveBypassingApps) { mAreChannelsBypassingDnd = haveBypassingApps; updateZenPolicy(mAreChannelsBypassingDnd, callingUid, fromSystemOrSystemUi); if (mCurrentUserHasChannelsBypassingDnd != haveBypassingApps) { mCurrentUserHasChannelsBypassingDnd = haveBypassingApps; updateZenPolicy(mCurrentUserHasChannelsBypassingDnd, callingUid, fromSystemOrSystemUi); } } Loading Loading @@ -1869,7 +1875,7 @@ public class PreferencesHelper implements RankingConfig { } public boolean areChannelsBypassingDnd() { return mAreChannelsBypassingDnd; return mCurrentUserHasChannelsBypassingDnd; } /** Loading
services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java +20 −0 Original line number Diff line number Diff line Loading @@ -421,6 +421,7 @@ public class NotificationManagerServiceTest extends UiServiceTestCase { @Mock MultiRateLimiter mToastRateLimiter; BroadcastReceiver mPackageIntentReceiver; BroadcastReceiver mUserSwitchIntentReceiver; NotificationRecordLoggerFake mNotificationRecordLogger = new NotificationRecordLoggerFake(); TestableNotificationManagerService.StrongAuthTrackerFake mStrongAuthTracker; Loading Loading @@ -651,8 +652,12 @@ public class NotificationManagerServiceTest extends UiServiceTestCase { && filter.hasAction(Intent.ACTION_PACKAGES_SUSPENDED)) { mPackageIntentReceiver = broadcastReceivers.get(i); } if (filter.hasAction(Intent.ACTION_USER_SWITCHED)) { mUserSwitchIntentReceiver = broadcastReceivers.get(i); } } assertNotNull("package intent receiver should exist", mPackageIntentReceiver); assertNotNull("User-switch receiver should exist", mUserSwitchIntentReceiver); // Pretend the shortcut exists List<ShortcutInfo> shortcutInfos = new ArrayList<>(); Loading Loading @@ -12148,6 +12153,21 @@ public class NotificationManagerServiceTest extends UiServiceTestCase { any(), eq(FLAG_ACTIVITY_SENDER | FLAG_BROADCAST_SENDER | FLAG_SERVICE_SENDER)); } @Test public void onUserSwitched_updatesZenModeAndChannelsBypassingDnd() { Intent intent = new Intent(Intent.ACTION_USER_SWITCHED); intent.putExtra(Intent.EXTRA_USER_HANDLE, 20); mService.mZenModeHelper = mock(ZenModeHelper.class); mService.setPreferencesHelper(mPreferencesHelper); mUserSwitchIntentReceiver.onReceive(mContext, intent); InOrder inOrder = inOrder(mPreferencesHelper, mService.mZenModeHelper); inOrder.verify(mService.mZenModeHelper).onUserSwitched(eq(20)); inOrder.verify(mPreferencesHelper).syncChannelsBypassingDnd(); inOrder.verifyNoMoreInteractions(); } private static <T extends Parcelable> T parcelAndUnparcel(T source, Parcelable.Creator<T> creator) { Parcel parcel = Parcel.obtain();
services/tests/uiservicestests/src/com/android/server/notification/PreferencesHelperTest.java +4 −1 Original line number Diff line number Diff line Loading @@ -2478,7 +2478,7 @@ public class PreferencesHelperTest extends UiServiceTestCase { mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper, mPermissionHelper, mPermissionManager, mLogger, mAppOpsManager, mStatsEventBuilderFactory, false); mHelper.syncChannelsBypassingDnd(); // create notification channel that can bypass dnd, but app is blocked // expected result: areChannelsBypassingDnd = false Loading Loading @@ -2509,6 +2509,7 @@ public class PreferencesHelperTest extends UiServiceTestCase { mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper, mPermissionHelper, mPermissionManager, mLogger, mAppOpsManager, mStatsEventBuilderFactory, false); mHelper.syncChannelsBypassingDnd(); // create notification channel that can bypass dnd, but app is blocked // expected result: areChannelsBypassingDnd = false Loading @@ -2533,6 +2534,7 @@ public class PreferencesHelperTest extends UiServiceTestCase { mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper, mPermissionHelper, mPermissionManager, mLogger, mAppOpsManager, mStatsEventBuilderFactory, false); mHelper.syncChannelsBypassingDnd(); // create notification channel that can bypass dnd, but app is blocked // expected result: areChannelsBypassingDnd = false Loading Loading @@ -2587,6 +2589,7 @@ public class PreferencesHelperTest extends UiServiceTestCase { mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper, mPermissionHelper, mPermissionManager, mLogger, mAppOpsManager, mStatsEventBuilderFactory, false); mHelper.syncChannelsBypassingDnd(); assertFalse(mHelper.areChannelsBypassingDnd()); verify(mMockZenModeHelper, times(1)).setNotificationPolicy(any(), anyInt(), anyBoolean()); resetZenModeHelper(); Loading