Home
last modified time | relevance | path

Searched refs:listener2 (Results 1 – 21 of 21) sorted by relevance

/packages/services/Car/tests/android_car_api_test/src/android/car/apitest/
DCarAppFocusManagerTest.java96 FocusChangedListener listener2 = new FocusChangedListener(); in testRegisterUnregister() local
98 mManager.addFocusListener(listener2, 1); in testRegisterUnregister()
100 mManager.removeFocusListener(listener2); in testRegisterUnregister()
101 mManager.removeFocusListener(listener2); // Double-unregister is OK in testRegisterUnregister()
107 FocusChangedListener listener2 = new FocusChangedListener(); in testRegisterUnregisterSpecificApp() local
111 manager.addFocusListener(listener2, APP_FOCUS_TYPE_NAVIGATION); in testRegisterUnregisterSpecificApp()
122 assertThat(listener2.waitForFocusChangeAndAssert( in testRegisterUnregisterSpecificApp()
125 manager.removeFocusListener(listener2, APP_FOCUS_TYPE_NAVIGATION); in testRegisterUnregisterSpecificApp()
129 assertThat(listener2.waitForFocusChangeAndAssert( in testRegisterUnregisterSpecificApp()
133 manager.removeFocusListener(listener2, 2); in testRegisterUnregisterSpecificApp()
[all …]
DCarUserManagerTest.java140 BlockingUserLifecycleListener listener2 = BlockingUserLifecycleListener in testLifecycleMultipleListeners() local
161 Log.d(TAG, "registering listener2: " + listener2 + " with filter: " in testLifecycleMultipleListeners()
163 mgr2.addListener(Runnable::run, unlockingEventFilter, listener2); in testLifecycleMultipleListeners()
181 assertWithMessage("all events received by listener %s", listener2) in testLifecycleMultipleListeners()
182 .that(listener2.getAllReceivedEvents()).isEmpty(); in testLifecycleMultipleListeners()
184 Log.d(TAG, "unregistering listener2: " + listener2); in testLifecycleMultipleListeners()
185 mgr2.removeListener(listener2); in testLifecycleMultipleListeners()
246 BlockingUserLifecycleListener listener2 = BlockingUserLifecycleListener in testGuestUserResumeToNewGuestUser() local
253 mCarUserManager.addListener(Runnable::run, listener2); in testGuestUserResumeToNewGuestUser()
258 UserLifecycleEvent event = listener2.waitForEvents().get(0); in testGuestUserResumeToNewGuestUser()
[all …]
/packages/services/Car/tests/carservice_test/src/com/android/car/
DCarSensorManagerTest.java336 SensorListener listener2 = new SensorListener(); in testEventsWithMultipleListeners() local
343 mCarSensorManager.registerListener(listener2, in testEventsWithMultipleListeners()
357 listener2.waitForSensorChange(); in testEventsWithMultipleListeners()
360 listener2.reset(); in testEventsWithMultipleListeners()
371 assertTrue(listener2.waitForSensorChange(1001L)); in testEventsWithMultipleListeners()
377 assertEquals(listener2.getLastEvent().sensorType, in testEventsWithMultipleListeners()
387 data = listener2.getLastEvent().getParkingBrakeData(data); in testEventsWithMultipleListeners()
402 listener2.reset(); in testEventsWithMultipleListeners()
411 assertTrue(listener2.waitForSensorChange(2001)); in testEventsWithMultipleListeners()
417 assertEquals(listener2.getLastEvent().sensorType, in testEventsWithMultipleListeners()
[all …]
DCarDiagnosticManagerTest.java749 Listener listener2 = new Listener(); in testMultipleListeners() local
756 listener2, in testMultipleListeners()
761 listener2.reset(); in testMultipleListeners()
767 CarDiagnosticEvent event2 = listener2.waitForEvent(time); in testMultipleListeners()
788 listener2.reset(); in testMultipleListeners()
796 event2 = listener2.waitForEvent(time); in testMultipleListeners()
921 Listener listener2 = new Listener(); in testListenerUnregister() local
936 listener2, in testListenerUnregister()
940 listener2, in testListenerUnregister()
949 assertThat(listener2.waitForEvent(time)).isNotNull(); in testListenerUnregister()
[all …]
DCarStorageMonitoringTest.java617 Listener listener2 = new Listener("listener2"); in testEventDelivery() local
620 mCarStorageMonitoringManager.registerListener(listener2); in testEventDelivery()
627 assertTrue(listener2.waitForEvent(eventDeliveryDeadline)); in testEventDelivery()
630 IoStats event2 = listener2.reset(); in testEventDelivery()
639 assertTrue(listener2.waitForEvent(eventDeliveryDeadline)); in testEventDelivery()
/packages/modules/Connectivity/nearby/tests/unit/src/com/android/server/nearby/managers/
DListenerMultiplexerTest.java64 Runnable listener2 = mock(Runnable.class); in testAdd() local
67 multiplexer.addListener(binder2, listener2, value2); in testAdd()
94 Runnable listener2 = mock(Runnable.class); in testReplace() local
96 multiplexer.addListener(binder, listener2, value2); in testReplace()
107 verify(listener2, times(1)).run(); in testReplace()
151 Runnable listener2 = mock(Runnable.class); in testMergeMultiple() local
169 verify(listener2, never()).run(); in testMergeMultiple()
172 multiplexer.addListener(binder2, listener2, value2); in testMergeMultiple()
182 verify(listener2, times(1)).run(); in testMergeMultiple()
195 verify(listener2, times(2)).run(); in testMergeMultiple()
[all …]
/packages/apps/Launcher3/quickstep/tests/src/com/android/quickstep/util/
DGestureExclusionManagerTest.kt44 @Mock private lateinit var listener2: ExclusionListener variable in com.android.quickstep.util.GestureExclusionManagerTest
72 underTest.addListener(listener2) in addListener_again_skips_register()
94 underTest.addListener(listener2) in removeListener_again_skips_unregister()
107 underTest.addListener(listener2) in onSystemGestureExclusionChanged_dispatches_to_listeners()
113 verify(listener2).onGestureExclusionChanged(r1, r2) in onSystemGestureExclusionChanged_dispatches_to_listeners()
124 underTest.addListener(listener2) in addLister_dispatches_second_time()
128 verify(listener2).onGestureExclusionChanged(r1, r2) in addLister_dispatches_second_time()
/packages/modules/Connectivity/nearby/tests/unit/src/com/android/server/nearby/managers/registration/
DBinderListenerRegistrationTest.java72 Runnable listener2 = mock(Runnable.class); in test_addAndRemove() local
76 listener2, value2); in test_addAndRemove()
79 verify(listener2, times(1)).run(); in test_addAndRemove()
84 reset(listener2); in test_addAndRemove()
96 reset(listener2); in test_addAndRemove()
/packages/modules/Connectivity/tests/unit/java/android/net/nsd/
DNsdManagerTest.java203 NsdManager.ResolveListener listener2 = mock(NsdManager.ResolveListener.class); in doTestParallelResolveService() local
208 manager.resolveService(request, listener2); in doTestParallelResolveService()
216 verify(listener2, timeout(mTimeoutMs).times(1)).onServiceResolved(reply); in doTestParallelResolveService()
260 NsdManager.RegistrationListener listener2 = mock(NsdManager.RegistrationListener.class); in doTestRegisterService() local
266 manager.registerService(request2, PROTOCOL, listener2); in doTestRegisterService()
272 verify(listener2, timeout(mTimeoutMs).times(1)).onServiceRegistered(request2); in doTestRegisterService()
295 manager.unregisterService(listener2); in doTestRegisterService()
301 verify(listener2, timeout(mTimeoutMs).times(1)).onUnregistrationFailed(request2, err); in doTestRegisterService()
399 NsdManager.DiscoveryListener listener2 = mock(NsdManager.DiscoveryListener.class); in doTestInvalidCalls() local
512 mustFail(() -> { manager.discoverServices(null, PROTOCOL, listener2); }); in doTestInvalidCalls()
[all …]
/packages/modules/StatsD/statsd/tests/state/
DStateTracker_test.cpp179 sp<TestStateListener> listener2 = new TestStateListener(); in TEST() local
189 mgr.registerListener(util::SCREEN_STATE_CHANGED, listener2); in TEST()
194 mgr.registerListener(util::SCREEN_STATE_CHANGED, listener2); in TEST()
199 mgr.registerListener(util::BATTERY_LEVEL_CHANGED, listener2); in TEST()
213 sp<TestStateListener> listener2 = new TestStateListener(); in TEST() local
226 mgr.unregisterListener(util::SCREEN_STATE_CHANGED, listener2); in TEST()
231 mgr.registerListener(util::SCREEN_STATE_CHANGED, listener2); in TEST()
237 mgr.unregisterListener(util::SCREEN_STATE_CHANGED, listener2); in TEST()
457 sp<TestStateListener> listener2 = new TestStateListener(); in TEST() local
462 mgr.registerListener(util::UID_PROCESS_STATE_CHANGED, listener2); in TEST()
/packages/services/Car/tests/carservice_unit_test/src/com/android/car/systemui/keyguard/
DExperimentalCarKeyguardServiceTest.java235 IExperimentalCarKeyguardLockedStateListener listener2 = in addLockedStateListener_registerToDelegateOnce() local
242 state.addKeyguardLockedStateListener(listener2); in addLockedStateListener_registerToDelegateOnce()
251 IExperimentalCarKeyguardLockedStateListener listener2 = in removeLastLockedStateListener_unregistersFromDelegate() local
257 state.addKeyguardLockedStateListener(listener2); in removeLastLockedStateListener_unregistersFromDelegate()
259 state.removeKeyguardLockedStateListener(listener2); in removeLastLockedStateListener_unregistersFromDelegate()
/packages/services/Telephony/tests/src/com/android/services/telephony/domainselection/
DDataConnectionStateHelperTest.java290 TelephonyCallback.PreciseDataConnectionStateListener listener2 = in testDataConnectionStateChanged() local
296 listener2.onPreciseDataConnectionStateChanged(state); in testDataConnectionStateChanged()
304 listener2.onPreciseDataConnectionStateChanged(state); in testDataConnectionStateChanged()
314 listener2.onPreciseDataConnectionStateChanged(state); in testDataConnectionStateChanged()
324 listener2.onPreciseDataConnectionStateChanged(state); in testDataConnectionStateChanged()
/packages/apps/Settings/tests/robotests/src/com/android/settings/accessibility/
DTextReadingPreferenceFragmentTest.java108 final ResetStateListener listener2 = mock(ResetStateListener.class); in onDialogPositiveButtonClicked_boldTextDisabled_resetAllListeners() local
109 mFragment.mResetStateListeners = new ArrayList<>(Arrays.asList(listener1, listener2)); in onDialogPositiveButtonClicked_boldTextDisabled_resetAllListeners()
118 verify(listener2).resetState(); in onDialogPositiveButtonClicked_boldTextDisabled_resetAllListeners()
/packages/services/Car/tests/carservice_unit_test/src/com/android/car/am/
DCarActivityServiceTaskMonitorUnitTest.java212 FilteredListener listener2 = new FilteredListener(mActivityA); in testMultipleActivityListeners() local
213 mService.registerActivityListener(listener2); in testMultipleActivityListeners()
217 listener2.assertTopTaskActivityCameOnTop(); in testMultipleActivityListeners()
225 FilteredListener listener2 = new FilteredListener(mActivityA); in testUnregisterActivityListener() local
226 mService.registerActivityListener(listener2); in testUnregisterActivityListener()
231 listener2.assertTopTaskActivityCameOnTop(); in testUnregisterActivityListener()
/packages/services/Car/tests/carservice_unit_test/src/com/android/car/
DCarInputServiceTest.java352 CarInputService.KeyEventListener listener2 = mock(CarInputService.KeyEventListener.class); in registerKeyEventListener_separateListenersWithSameEventsOfInterest_fails() local
357 () -> mCarInputService.registerKeyEventListener(listener2, interestedEvents)); in registerKeyEventListener_separateListenersWithSameEventsOfInterest_fails()
368 CarInputService.KeyEventListener listener2 = mock(CarInputService.KeyEventListener.class); in registerKeyEventListener_separateListenersWithOverlappingEventsOfInterest_fails() local
374 () -> mCarInputService.registerKeyEventListener(listener2, interestedEvents2)); in registerKeyEventListener_separateListenersWithOverlappingEventsOfInterest_fails()
460 CarInputService.KeyEventListener listener2 = mock(CarInputService.KeyEventListener.class); in onKeyEvent_withMultipleListeners_callToListener() local
464 mCarInputService.registerKeyEventListener(listener2, interestedEvents2); in onKeyEvent_withMultipleListeners_callToListener()
470 verify(listener2).onKeyEvent(event, CarOccupantZoneManager.DISPLAY_TYPE_MAIN, in onKeyEvent_withMultipleListeners_callToListener()
478 CarInputService.KeyEventListener listener2 = mock(CarInputService.KeyEventListener.class); in onKeyEvent_withMultipleListeners_noCallToListeners() local
482 mCarInputService.registerKeyEventListener(listener2, interestedEvents2); in onKeyEvent_withMultipleListeners_noCallToListeners()
488 verify(listener2, never()).onKeyEvent(any(), anyInt(), anyInt()); in onKeyEvent_withMultipleListeners_noCallToListeners()
/packages/modules/Connectivity/tests/cts/net/src/android/net/cts/
DEthernetManagerTest.kt579 val listener2 = EthernetStateListener() in <lambda>() constant
580 addInterfaceStateListener(listener2) in <lambda>()
581 listener2.expectCallback(iface, STATE_LINK_UP, ROLE_CLIENT) in <lambda>()
582 listener2.expectCallback(iface2, STATE_LINK_UP, ROLE_CLIENT) in <lambda>()
586 for (listener in listOf(listener1, listener2)) { in <lambda>()
592 for (listener in listOf(listener1, listener2)) { in <lambda>()
/packages/modules/Wifi/service/tests/wifitests/src/com/android/server/wifi/coex/
DCoexManagerTest.java282 CoexManager.CoexListener listener2 = mock(CoexManager.CoexListener.class); in testRegisteredCoexListener_setCoexUnsafeChannels_listenerIsNotified() local
285 coexManager.registerCoexListener(listener2); in testRegisteredCoexListener_setCoexUnsafeChannels_listenerIsNotified()
295 verify(listener2).onCoexUnsafeChannelsChanged(); in testRegisteredCoexListener_setCoexUnsafeChannels_listenerIsNotified()
305 CoexManager.CoexListener listener2 = mock(CoexManager.CoexListener.class); in testUnregisteredCoexListener_setCoexUnsafeChannels_listenerIsNotNotified() local
308 coexManager.registerCoexListener(listener2); in testUnregisteredCoexListener_setCoexUnsafeChannels_listenerIsNotNotified()
310 coexManager.unregisterCoexListener(listener2); in testUnregisteredCoexListener_setCoexUnsafeChannels_listenerIsNotNotified()
320 verify(listener2, never()).onCoexUnsafeChannelsChanged(); in testUnregisteredCoexListener_setCoexUnsafeChannels_listenerIsNotNotified()
/packages/modules/Connectivity/tests/unit/java/com/android/server/connectivity/mdns/
DMdnsMultinetworkSocketClientTest.java281 final MdnsServiceBrowserListener listener2 = mock(MdnsServiceBrowserListener.class); in testSocketRemovedAfterNetworkUnrequested() local
287 listener2, null, socketCreationCb2)); in testSocketRemovedAfterNetworkUnrequested()
311 mHandler.post(() -> mSocketClient.notifyNetworkUnrequested(listener2)); in testSocketRemovedAfterNetworkUnrequested()
/packages/modules/Wifi/service/tests/wifitests/src/com/android/server/wifi/
DScanRequestProxyTest.java629 WifiScannerInternal.ScanListener listener2; in testSuccessiveScanRequestsDontUseSameListener() local
639 listener2 = mScanRequestListenerArgumentCaptor.getValue(); in testSuccessiveScanRequestsDontUseSameListener()
641 assertNotEquals(listener1, listener2); in testSuccessiveScanRequestsDontUseSameListener()
/packages/modules/Permission/tests/cts/safetycenter/src/android/safetycenter/cts/
DSafetyCenterManagerTest.kt1708 val listener2 = safetyCenterTestHelper.addListener() in removeOnSafetyCenterDataChangedListener_listenerRemovedNotCalledOnSafetySourceData() constant
1710 safetyCenterManager.removeOnSafetyCenterDataChangedListenerWithPermission(listener2) in removeOnSafetyCenterDataChangedListener_listenerRemovedNotCalledOnSafetySourceData()
1715 listener2.receiveSafetyCenterData(TIMEOUT_SHORT) in removeOnSafetyCenterDataChangedListener_listenerRemovedNotCalledOnSafetySourceData()
/packages/modules/Connectivity/tests/unit/java/com/android/server/
DNsdServiceTest.java367 final DiscoveryListener listener2 = mock(DiscoveryListener.class); in testClientRequestsAreGCedAtDisconnection() local
368 client.discoverServices(SERVICE_TYPE, PROTOCOL, listener2); in testClientRequestsAreGCedAtDisconnection()