/packages/apps/Settings/tests/unit/src/com/android/settings/applications/specialaccess/notificationaccess/ |
D | TypeFilterPreferenceControllerTest.java | 63 NotificationBackend mNm; field in TypeFilterPreferenceControllerTest 86 mController.setNm(mNm); in setUp() 94 when(mNm.isNotificationListenerAccessGranted(any())).thenReturn(false); in testAvailable_notGranted() 102 when(mNm.isNotificationListenerAccessGranted(any())).thenReturn(true); in testAvailable_lowTargetSdk_noCustomizations() 104 when(mNm.getListenerFilter(mCn, 0)).thenReturn(new NotificationListenerFilter()); in testAvailable_lowTargetSdk_noCustomizations() 111 when(mNm.isNotificationListenerAccessGranted(any())).thenReturn(true); in testAvailable_lowTargetSdk_customizations() 115 when(mNm.getListenerFilter(mCn, 0)).thenReturn(nlf); in testAvailable_lowTargetSdk_customizations() 122 when(mNm.isNotificationListenerAccessGranted(any())).thenReturn(true); in testAvailable_highTargetSdk_noCustomizations() 124 when(mNm.getListenerFilter(mCn, 0)).thenReturn(new NotificationListenerFilter()); in testAvailable_highTargetSdk_noCustomizations() 131 when(mNm.isNotificationListenerAccessGranted(mCn)).thenReturn(true); in updateState_enabled_noMetaData() [all …]
|
D | BridgedAppsPreferenceControllerTest.java | 62 NotificationBackend mNm; field in BridgedAppsPreferenceControllerTest 98 mController.setNm(mNm); in setUp() 106 when(mNm.isNotificationListenerAccessGranted(mCn)).thenReturn(true); in onRebuildComplete_AddsToScreen() 107 when(mNm.getListenerFilter(mCn, 0)).thenReturn(new NotificationListenerFilter()); in onRebuildComplete_AddsToScreen() 120 when(mNm.isNotificationListenerAccessGranted(mCn)).thenReturn(true); in onRebuildComplete_doesNotReaddToScreen() 121 when(mNm.getListenerFilter(mCn, 0)).thenReturn(new NotificationListenerFilter()); in onRebuildComplete_doesNotReaddToScreen() 138 when(mNm.isNotificationListenerAccessGranted(mCn)).thenReturn(true); in onRebuildComplete_removesExtras() 139 when(mNm.getListenerFilter(mCn, 0)).thenReturn(new NotificationListenerFilter()); in onRebuildComplete_removesExtras() 156 when(mNm.isNotificationListenerAccessGranted(mCn)).thenReturn(true); in onRebuildComplete_buildsSetting() 157 when(mNm.getListenerFilter(mCn, 0)).thenReturn(new NotificationListenerFilter()); in onRebuildComplete_buildsSetting() [all …]
|
D | BridgedAppsLinkPreferenceControllerTest.java | 52 NotificationBackend mNm; field in BridgedAppsLinkPreferenceControllerTest 62 mController.setNm(mNm); in setUp() 68 when(mNm.isNotificationListenerAccessGranted(any())).thenReturn(false); in testAvailable_notGranted() 81 when(mNm.isNotificationListenerAccessGranted(any())).thenReturn(true); in testAvailable_lowTargetSdk_noCustomizations() 83 when(mNm.getListenerFilter(mCn, 0)).thenReturn(new NotificationListenerFilter()); in testAvailable_lowTargetSdk_noCustomizations() 95 when(mNm.isNotificationListenerAccessGranted(any())).thenReturn(true); in testAvailable_lowTargetSdk_customizations() 99 when(mNm.getListenerFilter(mCn, 0)).thenReturn(nlf); in testAvailable_lowTargetSdk_customizations() 111 when(mNm.isNotificationListenerAccessGranted(any())).thenReturn(true); in testAvailable_highTargetSdk_noCustomizations() 113 when(mNm.getListenerFilter(mCn, 0)).thenReturn(new NotificationListenerFilter()); in testAvailable_highTargetSdk_noCustomizations()
|
D | ApprovalPreferenceControllerTest.java | 75 NotificationManager mNm; field in ApprovalPreferenceControllerTest 96 mController.setNm(mNm); in setUp() 105 when(mNm.isNotificationListenerAccessGranted(mCn)).thenReturn(true); in updateState_enabled() 136 when(mNm.isNotificationListenerAccessGranted(mCn)).thenReturn(true); in updateState_checked() 153 when(mNm.isNotificationListenerAccessGranted(mCn)).thenReturn(false); in restrictedSettings_appOpsDisabled() 170 when(mNm.isNotificationListenerAccessGranted(mCn)).thenReturn(true); in restrictedSettings_serviceAlreadyEnabled() 187 verify(mNm).setNotificationListenerAccessGranted(mCn, true); in enable() 193 when(mNm.isNotificationPolicyAccessGrantedForPackage(anyString())).thenReturn(false); in disable() 200 verify(mNm).removeAutomaticZenRules(eq(mCn.getPackageName()), eq(true)); in disable() 201 verify(mNm).setNotificationListenerAccessGranted(mCn, false); in disable()
|
D | PreUpgradePreferenceControllerTest.java | 51 NotificationBackend mNm; field in PreUpgradePreferenceControllerTest 61 mController.setNm(mNm); in setUp() 68 when(mNm.getListenerFilter(mCn, 0)).thenReturn(new NotificationListenerFilter()); in testAvailable_lowTargetSdk_noCustomizations() 78 when(mNm.getListenerFilter(mCn, 0)).thenReturn(nlf); in testAvailable_lowTargetSdk_customizations() 86 when(mNm.getListenerFilter(mCn, 0)).thenReturn(new NotificationListenerFilter()); in testAvailable_highTargetSdk_noCustomizations()
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/notification/modes/ |
D | ZenModesBackendTest.java | 86 private NotificationManager mNm; field in ZenModesBackendTest 133 shadowApplication.setSystemService(Context.NOTIFICATION_SERVICE, mNm); in setup() 140 when(mNm.getZenModeConfig()).thenReturn(new ZenModeConfig()); in setup() 152 when(mNm.getAutomaticZenRules()).thenReturn( in getModes_containsManualDndAndZenRules() 157 when(mNm.getZenModeConfig()).thenReturn(config); in getModes_containsManualDndAndZenRules() 183 when(mNm.getZenModeConfig()).thenReturn(config); in getMode_manualDnd_returnsMode() 200 when(mNm.getAutomaticZenRule(eq(ZEN_RULE_ID))).thenReturn(ZEN_RULE); in getMode_zenRule_returnsMode() 209 when(mNm.getAutomaticZenRule(any())).thenReturn(null); in getMode_missingRule_returnsNull() 214 verify(mNm).getAutomaticZenRule(eq(ZEN_RULE_ID)); in getMode_missingRule_returnsNull() 226 when(mNm.getZenModeConfig()).thenReturn(configWithActiveRule); in getMode_manualDnd_returnsCorrectActiveState() [all …]
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/notification/zen/ |
D | ZenOnboardingActivityTest.java | 64 private NotificationManager mNm; field in ZenOnboardingActivityTest 75 shadowApplication.setSystemService(Context.NOTIFICATION_SERVICE, mNm); in setUp() 80 mActivity.setNotificationManager(mNm); in setUp() 99 when(mNm.getNotificationPolicy()).thenReturn(policy); in saveNewSetting() 108 verify(mNm).setNotificationPolicy(captor.capture(), eq(true)); in saveNewSetting() 110 verify(mNm).setNotificationPolicy(captor.capture()); in saveNewSetting() 125 when(mNm.getNotificationPolicy()).thenReturn(policy); in keepCurrentSetting() 132 verify(mNm, never()).setNotificationPolicy(any(), anyBoolean()); in keepCurrentSetting() 134 verify(mNm, never()).setNotificationPolicy(any()); in keepCurrentSetting() 141 when(mNm.getNotificationPolicy()).thenReturn(policy); in isSuggestionComplete_zenUpdated() [all …]
|
D | ZenModeSliceBuilderTest.java | 63 private NotificationManager mNm; field in ZenModeSliceBuilderTest 71 shadowApplication.setSystemService(Context.NOTIFICATION_SERVICE, mNm); in setUp() 121 verify(mNm).setZenMode(eq(ZEN_MODE_IMPORTANT_INTERRUPTIONS), any(), any(), eq(true)); in handleUriChange_turnOn_zenModeTurnsOn() 123 verify(mNm).setZenMode(eq(ZEN_MODE_IMPORTANT_INTERRUPTIONS), any(), any()); in handleUriChange_turnOn_zenModeTurnsOn() 135 verify(mNm).setZenMode(eq(ZEN_MODE_OFF), any(), any(), eq(true)); in handleUriChange_turnOff_zenModeTurnsOff() 137 verify(mNm).setZenMode(eq(ZEN_MODE_OFF), any(), any()); in handleUriChange_turnOff_zenModeTurnsOff()
|
/packages/apps/Settings/src/com/android/settings/applications/specialaccess/notificationaccess/ |
D | ApprovalPreferenceController.java | 43 private NotificationManager mNm; field in ApprovalPreferenceController 68 mNm = nm; in setNm() 141 mNm.setNotificationListenerAccessGranted(cn, false); in disable() 142 if (!mNm.isNotificationPolicyAccessGrantedForPackage( in disable() 145 mNm.removeAutomaticZenRules(cn.getPackageName(), /* fromUser= */ true); in disable() 147 mNm.removeAutomaticZenRules(cn.getPackageName()); in disable() 154 mNm.setNotificationListenerAccessGranted(cn, true); in enable() 158 return mNm.isNotificationListenerAccessGranted(cn); in isServiceEnabled()
|
D | TypeFilterPreferenceController.java | 47 private NotificationBackend mNm; field in TypeFilterPreferenceController 67 mNm = nm; in setNm() 85 if (mNm.isNotificationListenerAccessGranted(mCn)) { in getAvailabilityStatus() 90 mNlf = mNm.getListenerFilter(mCn, mUserId); in getAvailabilityStatus() 105 mNlf = mNm.getListenerFilter(mCn, mUserId); in onPreferenceChange() 116 mNm.setListenerFilter(mCn, mUserId, mNlf); in onPreferenceChange() 122 mNlf = mNm.getListenerFilter(mCn, mUserId); in updateState()
|
D | BridgedAppsLinkPreferenceController.java | 30 private NotificationBackend mNm; field in BridgedAppsLinkPreferenceController 50 mNm = nm; in setNm() 61 if (mNm.isNotificationListenerAccessGranted(mCn)) { in getAvailabilityStatus() 65 mNlf = mNm.getListenerFilter(mCn, mUserId); in getAvailabilityStatus()
|
D | BridgedAppsPreferenceController.java | 52 private NotificationBackend mNm; field in BridgedAppsPreferenceController 75 mNm = nm; in setNm() 120 mNlf = mNm.getListenerFilter(mCn, mUserId); in onRebuildComplete() 177 mNlf = mNm.getListenerFilter(mCn, mUserId); in onPreferenceChange() 183 mNm.setListenerFilter(mCn, mUserId, mNlf); in onPreferenceChange()
|
D | PreUpgradePreferenceController.java | 31 private NotificationBackend mNm; field in PreUpgradePreferenceController 50 mNm = nm; in setNm() 61 mNlf = mNm.getListenerFilter(mCn, mUserId); in getAvailabilityStatus()
|
/packages/modules/NetworkStack/tests/unit/src/com/android/networkstack/ |
D | NetworkStackNotifierTest.kt | 85 private lateinit var mNm: NotificationManager variable in com.android.networkstack.NetworkStackNotifierTest 166 mAllUserContext.mockService(Context.NOTIFICATION_SERVICE, NotificationManager::class, mNm) in setUp() 201 verify(mNm, never()).notify(any(), anyInt(), any()) in testNoNotification() 205 verify(mNm).notify(eq(TEST_NETWORK_TAG), mNoteIdCaptor.capture(), mNoteCaptor.capture()) in verifyConnectedNotification() 218 verify(mNm).cancel(TEST_NETWORK_TAG, mNoteIdCaptor.value) in verifyCanceledNotificationAfterNetworkLost() 224 verify(mNm).cancel(TEST_NETWORK_TAG, mNoteIdCaptor.value) in verifyCanceledNotificationAfterDefaultNetworkLost() 234 verify(mNm, never()).notify(any(), anyInt(), any()) in testConnectedNotification_NoSsid() 301 verify(mNm).notify(eq(TEST_NETWORK_TAG), mNoteIdCaptor.capture(), mNoteCaptor.capture()) in testVenueInfoNotification() 313 doReturn(null).`when`(mNm).getNotificationChannel(CHANNEL_VENUE_INFO) in testVenueInfoNotification_VenueInfoDisabled() 319 verify(mNm, never()).notify(any(), anyInt(), any()) in testVenueInfoNotification_VenueInfoDisabled() [all …]
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/bluetooth/ |
D | BluetoothPairingServiceTest.java | 54 private NotificationManager mNm; field in BluetoothPairingServiceTest 74 mBluetoothPairingService.mNm = mNm; in setUp() 96 verify(mNm).notify(eq(mBluetoothPairingService.NOTIFICATION_ID), any()); in receivePairingRequestAction_notificationShown() 110 verify(mNm).cancel(mBluetoothPairingService.NOTIFICATION_ID); in receiveDismissPairingAction_cancelPairing()
|
/packages/modules/NetworkStack/src/com/android/server/ |
D | NetworkStackService.java | 688 private final NetworkMonitor mNm; field in NetworkStackService.NetworkMonitorConnector 694 mNm = nm; in NetworkMonitorConnector() 701 mNm.start(); in start() 707 mNm.launchCaptivePortalApp(); in launchCaptivePortalApp() 713 mNm.notifyCaptivePortalAppFinished(response); in notifyCaptivePortalAppFinished() 719 mNm.setAcceptPartialConnectivity(); in setAcceptPartialConnectivity() 725 mNm.forceReevaluation(uid); in forceReevaluation() 731 mNm.notifyPrivateDnsSettingsChanged(PrivateDnsConfig.fromParcel(config)); in notifyPrivateDnsChanged() 737 mNm.notifyDnsResponse(returnCode); in notifyDnsResponse() 747 mNm.notifyNetworkConnected(lp, nc); in notifyNetworkConnected() [all …]
|
/packages/apps/Settings/src/com/android/settings/bluetooth/ |
D | BluetoothPairingService.java | 62 NotificationManager mNm; field in BluetoothPairingService 106 mNm.cancel(NOTIFICATION_ID); 113 mNm = getSystemService(NotificationManager.class); in onCreate() 118 mNm.createNotificationChannel(notificationChannel); in onCreate() 135 mNm.cancel(NOTIFICATION_ID); in onStartCommand() 145 mNm.cancel(NOTIFICATION_ID); in onStartCommand() 219 mNm.notify(NOTIFICATION_ID, builder.build()); in createPairingNotification()
|
/packages/apps/Car/Settings/src/com/android/car/settings/applications/specialaccess/ |
D | NotificationAccessPreferenceController.java | 68 private final NotificationManager mNm; field in NotificationAccessPreferenceController 98 mNm = notificationManager; in NotificationAccessPreferenceController() 203 return mNm.isNotificationListenerAccessGranted(service); in isAccessGranted() 207 mNm.setNotificationListenerAccessGranted(service, /* granted= */ true); in grantNotificationAccess() 211 mNm.setNotificationListenerAccessGranted(service, /* granted= */ false); in revokeNotificationAccess() 215 if (!mNm.isNotificationPolicyAccessGrantedForPackage(service.getPackageName())) { in revokeNotificationAccess() 216 mNm.removeAutomaticZenRules(service.getPackageName()); in revokeNotificationAccess()
|
/packages/apps/Settings/src/com/android/settings/notification/zen/ |
D | ZenOnboardingActivity.java | 56 private NotificationManager mNm; field in ZenOnboardingActivity 109 mNm = nm; in setNotificationManager() 126 NotificationManager.Policy policy = mNm.getNotificationPolicy(); in save() 135 mNm.setNotificationPolicy(newPolicy, /* fromUser= */ true); in save() 137 mNm.setNotificationPolicy(newPolicy); in save()
|
/packages/apps/Calendar/src/com/android/calendar/alerts/ |
D | AlertService.kt | 74 var mNm: NotificationManager variable in com.android.calendar.alerts.AlertService 77 mNm.cancel(id) in cancel() 82 mNm.notify(id, nw?.mNotification) in notify() 86 mNm = nm
|
/packages/apps/Settings/tests/legacy_unit/src/com/android/settings/notification/ |
D | ChannelNotificationSettingsTest.java | 58 private NotificationManager mNm; field in ChannelNotificationSettingsTest 69 mNm = (NotificationManager) mTargetContext.getSystemService(Context.NOTIFICATION_SERVICE); in setUp() 72 mNm.createNotificationChannel(mNotificationChannel); in setUp() 91 mNm.createNotificationChannel(blocked); in launchNotificationSettings_blockedChannel()
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/notification/app/ |
D | DndPreferenceControllerTest.java | 68 private NotificationManager mNm; field in DndPreferenceControllerTest 80 shadowApplication.setSystemService(Context.NOTIFICATION_SERVICE, mNm); in setUp() 88 when(mNm.getNotificationPolicy()).thenReturn(new NotificationManager.Policy(0, 0, 0, 0)); in testIsAvailable_app() 96 when(mNm.getNotificationPolicy()).thenReturn(new NotificationManager.Policy(0, 0, 0, 1)); in testIsAvailable_channel() 106 when(mNm.getNotificationPolicy()).thenReturn(new NotificationManager.Policy(0, 0, 0, 1)); in testIsAvailable_filteredIn() 117 when(mNm.getNotificationPolicy()).thenReturn(new NotificationManager.Policy(0, 0, 0, 1)); in testIsAvailable_filteredOut()
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/connecteddevice/audiosharing/ |
D | AudioSharingReceiverTest.java | 87 @Mock private NotificationManager mNm; field in AudioSharingReceiverTest 93 mShadowApplication.setSystemService(Context.NOTIFICATION_SERVICE, mNm); in setUp() 142 verifyNoInteractions(mNm); in broadcastReceiver_receiveAudioSharingStateChangeIntentFlagOff_doNothing() 154 verifyNoInteractions(mNm); in broadcastReceiver_receiveAudioSharingStateChangeIntentNoState_doNothing() 167 verify(mNm, times(1)) in broadcastReceiver_receiveAudioSharingStateChangeIntentOnState_showNotification() 184 verify(mNm, times(1)).cancel(R.drawable.ic_bt_le_audio_sharing); in broadcastReceiver_receiveAudioSharingStateChangeIntentOffState_cancelNotification()
|
/packages/apps/Settings/src/com/android/settings/utils/ |
D | ZenServiceListing.java | 41 private final NotificationManager mNm; field in ZenServiceListing 46 mNm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); in ZenServiceListing() 73 List<String> enabledNotificationListenerPkgs = mNm.getEnabledNotificationListenerPackages(); in reloadApprovedServices() 79 if (mNm.isNotificationPolicyAccessGrantedForPackage(pkg) in reloadApprovedServices()
|
/packages/modules/Permission/PermissionController/src/com/android/permissioncontroller/incident/ |
D | PendingList.java | 104 private final NotificationManager mNm; field in PendingList.Updater 114 mNm = context.getSystemService(NotificationManager.class); in Updater() 207 mNm.cancel(remainingNotifications.valueAt(i), Constants.INCIDENT_NOTIFICATION_ID); in updateState() 277 mNm.notify(rec.report.getUri().toString(), Constants.INCIDENT_NOTIFICATION_ID, in showNotifications() 294 mNm.createNotificationChannel(channel); in createNotificationChannel()
|