Home
last modified time | relevance | path

Searched refs:observer (Results 1 – 25 of 121) sorted by relevance

12345

/packages/apps/Car/libs/car-arch-common/tests/robotests/src/com/android/car/arch/common/
DLiveDataFunctionsTest.java61 CaptureObserver<Object> observer = new CaptureObserver<>(); in testNullLiveData() local
62 nullLiveData().observe(mLifecycleOwner, observer); in testNullLiveData()
64 assertThat(observer.hasBeenNotified()).isTrue(); in testNullLiveData()
65 assertThat(observer.getObservedValue()).isNull(); in testNullLiveData()
71 CaptureObserver<Boolean> observer = new CaptureObserver<>(); in testTrueLiveData() local
72 trueLiveData().observe(mLifecycleOwner, observer); in testTrueLiveData()
74 assertThat(observer.hasBeenNotified()).isTrue(); in testTrueLiveData()
75 assertThat(observer.getObservedValue()).isTrue(); in testTrueLiveData()
81 CaptureObserver<Boolean> observer = new CaptureObserver<>(); in testFalseLiveData() local
82 falseLiveData().observe(mLifecycleOwner, observer); in testFalseLiveData()
[all …]
/packages/apps/Car/libs/car-media-common/tests/robotests/src/com/android/car/media/common/playback/
DPlaybackViewModelTest.java108 CaptureObserver<MediaItemMetadata> observer = new CaptureObserver<>(); in testGetMetadata() local
109 mPlaybackViewModel.getMetadata().observe(mLifecycleOwner, observer); in testGetMetadata()
110 observer.reset(); in testGetMetadata()
115 assertThat(observer.hasBeenNotified()).isTrue(); in testGetMetadata()
116 MediaItemMetadata observedValue = observer.getObservedValue(); in testGetMetadata()
123 CaptureObserver<PlaybackViewModel.PlaybackStateWrapper> observer = new CaptureObserver<>(); in testGetPlaybackState() local
124 mPlaybackViewModel.getPlaybackStateWrapper().observe(mLifecycleOwner, observer); in testGetPlaybackState()
125 observer.reset(); in testGetPlaybackState()
131 assertThat(observer.hasBeenNotified()).isTrue(); in testGetPlaybackState()
132 assertThat(observer.getObservedValue().getStateCompat()).isEqualTo(mPlaybackState); in testGetPlaybackState()
[all …]
/packages/apps/Car/libs/car-ui-lib/car-ui-lib/src/main/java/com/android/car/ui/recyclerview/
DRecyclerViewAdapterAdapterV1.java54 for (AdapterDataObserverOEMV1 observer: mAdapterDataObservers) {
55 observer.onChanged();
61 for (AdapterDataObserverOEMV1 observer: mAdapterDataObservers) {
62 observer.onItemRangeChanged(positionStart, itemCount);
69 for (AdapterDataObserverOEMV1 observer: mAdapterDataObservers) {
70 observer.onItemRangeChanged(positionStart, itemCount, payload);
76 for (AdapterDataObserverOEMV1 observer: mAdapterDataObservers) {
77 observer.onItemRangeInserted(positionStart, itemCount);
83 for (AdapterDataObserverOEMV1 observer: mAdapterDataObservers) {
84 observer.onItemRangeRemoved(positionStart, itemCount);
[all …]
/packages/modules/Connectivity/tests/unit/java/com/android/server/
DNetworkManagementServiceTest.java134 BaseNetworkObserver observer = mock(BaseNetworkObserver.class); in testNetworkObservers() local
135 doReturn(new Binder()).when(observer).asBinder(); // Used by registerObserver. in testNetworkObservers()
136 mNMService.registerObserver(observer); in testNetworkObservers()
142 reset(observer); in testNetworkObservers()
151 expectSoon(observer).interfaceAdded("rmnet12"); in testNetworkObservers()
154 expectSoon(observer).interfaceRemoved("eth1"); in testNetworkObservers()
157 expectSoon(observer).interfaceStatusChanged("clat4", true); in testNetworkObservers()
160 expectSoon(observer).interfaceLinkStateChanged("rmnet0", false); in testNetworkObservers()
166 expectSoon(observer).limitReached("data", "rmnet_usb0"); in testNetworkObservers()
172 expectSoon(observer).interfaceClassDataActivityChanged(1, true, 1234, TEST_UID); in testNetworkObservers()
[all …]
/packages/apps/Launcher3/src/com/android/launcher3/graphics/
DGridCustomizationsProvider.java204 PreviewLifecycleObserver observer = null; in getPreview() local
211 observer = new PreviewLifecycleObserver(renderer); in getPreview()
212 mActivePreviews.put(renderer.getHostToken(), observer); in getPreview() local
215 renderer.getHostToken().linkToDeath(observer, 0); in getPreview()
221 new Messenger(new Handler(UI_HELPER_EXECUTOR.getLooper(), observer)); in getPreview()
228 if (observer != null) { in getPreview()
229 destroyObserver(observer); in getPreview()
235 private synchronized void destroyObserver(PreviewLifecycleObserver observer) { in destroyObserver() argument
236 if (observer == null || observer.destroyed) { in destroyObserver()
239 observer.destroyed = true; in destroyObserver()
[all …]
/packages/apps/Contacts/tests/src/com/android/contacts/widget/
DCompositeListAdapterTest.java217 TestDataSetObserver observer = new TestDataSetObserver(); in testNotifyDataSetChangedPropagated() local
218 adapter.registerDataSetObserver(observer); in testNotifyDataSetChangedPropagated()
221 assertEquals(1, observer.changeCount); in testNotifyDataSetChangedPropagated()
222 assertEquals(0, observer.invalidationCount); in testNotifyDataSetChangedPropagated()
229 assertEquals(2, observer.changeCount); in testNotifyDataSetChangedPropagated()
230 assertEquals(0, observer.invalidationCount); in testNotifyDataSetChangedPropagated()
243 TestDataSetObserver observer = new TestDataSetObserver(); in testNotifyDataSetChangedOnAddingAdapter() local
244 adapter.registerDataSetObserver(observer); in testNotifyDataSetChangedOnAddingAdapter()
247 assertEquals(1, observer.changeCount); in testNotifyDataSetChangedOnAddingAdapter()
248 assertEquals(0, observer.invalidationCount); in testNotifyDataSetChangedOnAddingAdapter()
[all …]
/packages/apps/Car/libs/car-ui-lib/referencedesign/sharedlibrary/src/main/java/com/chassis/car/ui/sharedlibrary/recyclerview/
DListItemAdapter.java64 for (AdapterDataObserverOEMV1 observer : mAdapterDataObservers) {
65 observer.onChanged();
71 for (AdapterDataObserverOEMV1 observer : mAdapterDataObservers) {
72 observer.onItemRangeChanged(positionStart, itemCount);
79 for (AdapterDataObserverOEMV1 observer : mAdapterDataObservers) {
80 observer.onItemRangeChanged(positionStart, itemCount, payload);
86 for (AdapterDataObserverOEMV1 observer : mAdapterDataObservers) {
87 observer.onItemRangeInserted(positionStart, itemCount);
93 for (AdapterDataObserverOEMV1 observer : mAdapterDataObservers) {
94 observer.onItemRangeRemoved(positionStart, itemCount);
[all …]
/packages/apps/Car/libs/car-ui-lib/car-ui-lib/src/androidTest/java/com/android/car/ui/recyclerview/
DDelegatingContentLimitingAdapterTest.java141 AdapterDataObserver observer = mock(AdapterDataObserver.class); in testChangeItem_callsObservers() local
142 mContentLimitingAdapter.registerAdapterDataObserver(observer); in testChangeItem_callsObservers()
156 verify(observer).onItemRangeChanged(5, 3, null); in testChangeItem_callsObservers()
164 AdapterDataObserver observer = mock(AdapterDataObserver.class); in testInsertItem_callsObservers() local
165 mContentLimitingAdapter.registerAdapterDataObserver(observer); in testInsertItem_callsObservers()
179 verify(observer).onItemRangeInserted(5, 2); in testInsertItem_callsObservers()
187 AdapterDataObserver observer = mock(AdapterDataObserver.class); in testRemoveItem_callsObservers() local
188 mContentLimitingAdapter.registerAdapterDataObserver(observer); in testRemoveItem_callsObservers()
202 verify(observer).onItemRangeRemoved(5, 2); in testRemoveItem_callsObservers()
210 AdapterDataObserver observer = mock(AdapterDataObserver.class); in testMoveItem_callsObservers() local
[all …]
/packages/modules/Connectivity/tests/cts/hostside/app2/src/com/android/cts/net/hostside/app2/
DCommon.java77 INetworkStateObserver observer) throws RemoteException { in validateComponentState() argument
83 observer.onNetworkStateChecked( in validateComponentState()
93 observer.onNetworkStateChecked( in validateComponentState()
103 observer.onNetworkStateChecked( in validateComponentState()
111 observer.onNetworkStateChecked(INetworkStateObserver.RESULT_ERROR_OTHER, in validateComponentState()
130 final INetworkStateObserver observer = INetworkStateObserver.Stub.asInterface( in notifyNetworkStateObserver() local
132 if (observer != null) { in notifyNetworkStateObserver()
135 if (!skipValidation && !validateComponentState(context, componentType, observer)) { in notifyNetworkStateObserver()
143 observer.onNetworkStateChecked( in notifyNetworkStateObserver()
/packages/modules/NetworkStack/src/com/android/server/
DNetworkObserverRegistry.java63 public void registerObserver(@NonNull NetworkObserver observer, @NonNull Handler handler) { in registerObserver() argument
67 mObservers.put(observer, Optional.of(handler)); in registerObserver()
76 public void registerObserverForNonblockingCallback(@NonNull NetworkObserver observer) { in registerObserverForNonblockingCallback() argument
77 mObservers.put(observer, Optional.empty()); in registerObserverForNonblockingCallback()
84 public void unregisterObserver(@NonNull NetworkObserver observer) { in unregisterObserver() argument
85 mObservers.remove(observer); in unregisterObserver()
97 final NetworkObserver observer = entry.getKey(); in invokeForAllObservers() local
100 handler.get().post(() -> callback.sendCallback(observer)); in invokeForAllObservers()
105 callback.sendCallback(observer); in invokeForAllObservers()
/packages/apps/Car/libs/car-media-common/tests/robotests/src/com/android/car/media/common/source/
DMediaSourceViewModelTest.java124 CaptureObserver<MediaSource> observer = new CaptureObserver<>(); in testGetSelectedMediaSource_none() local
126 mViewModel.getPrimaryMediaSource().observe(mLifecycleOwner, observer); in testGetSelectedMediaSource_none()
128 assertThat(observer.getObservedValue()).isNull(); in testGetSelectedMediaSource_none()
133 CaptureObserver<BrowsingState> observer = new CaptureObserver<>(); in testGetMediaController_connectedBrowser() local
140 mViewModel.getBrowsingState().observe(mLifecycleOwner, observer); in testGetMediaController_connectedBrowser()
142 BrowsingState browsingState = observer.getObservedValue(); in testGetMediaController_connectedBrowser()
150 CaptureObserver<BrowsingState> observer = new CaptureObserver<>(); in testGetMediaController_noActiveSession_notConnected() local
157 mViewModel.getBrowsingState().observe(mLifecycleOwner, observer); in testGetMediaController_noActiveSession_notConnected()
159 BrowsingState browsingState = observer.getObservedValue(); in testGetMediaController_noActiveSession_notConnected()
/packages/apps/Settings/src/com/android/settings/dashboard/
DDashboardFragment.java209 .forEach(observer -> { in onStart()
210 if (!mRegisteredObservers.contains(observer)) { in onStart()
211 registerDynamicDataObserver(resolver, observer); in onStart()
547 observers.forEach(observer -> registerDynamicDataObserver(resolver, observer)); in registerDynamicDataObservers()
551 DynamicDataObserver observer) { in registerDynamicDataObserver() argument
552 Log.d(TAG, "register observer: @" + Integer.toHexString(observer.hashCode()) in registerDynamicDataObserver()
553 + ", uri: " + observer.getUri()); in registerDynamicDataObserver()
554 resolver.registerContentObserver(observer.getUri(), false, observer); in registerDynamicDataObserver() local
555 mRegisteredObservers.add(observer); in registerDynamicDataObserver()
563 observers.forEach(observer -> { in unregisterDynamicDataObservers()
[all …]
DDashboardFeatureProviderImpl.java137 DynamicDataObserver observer = bindTitleAndGetObserver(pref, tile); in bindPreferenceToTileAndGetObservers() local
138 if (observer != null) { in bindPreferenceToTileAndGetObservers()
139 outObservers.add(observer); in bindPreferenceToTileAndGetObservers()
141 observer = bindSummaryAndGetObserver(pref, tile); in bindPreferenceToTileAndGetObservers()
142 if (observer != null) { in bindPreferenceToTileAndGetObservers()
143 outObservers.add(observer); in bindPreferenceToTileAndGetObservers()
145 observer = bindSwitchAndGetObserver(pref, tile); in bindPreferenceToTileAndGetObservers()
146 if (observer != null) { in bindPreferenceToTileAndGetObservers()
147 outObservers.add(observer); in bindPreferenceToTileAndGetObservers()
/packages/apps/Car/Media/src/com/android/car/media/browse/
DBrowseAdapter.java136 public void registerObserver(Observer observer) { in registerObserver() argument
137 mObservers.add(observer); in registerObserver()
143 public void unregisterObserver(Observer observer) { in unregisterObserver() argument
144 mObservers.remove(observer); in unregisterObserver()
218 for (Observer observer : mObservers) { in notify()
219 notification.accept(observer); in notify()
285 observer -> observer.onBrowsableItemClicked(item)); in generateViewData()
288 observer -> observer.onPlayableItemClicked(item)); in generateViewData()
/packages/modules/DnsResolver/tests/
Dresolv_tls_unit_test.cpp118 IDnsTlsSocketObserver* observer, in createDnsTlsSocket() argument
120 return std::make_unique<T>(observer); in createDnsTlsSocket()
136 explicit FakeSocketEcho(IDnsTlsSocketObserver* observer) : mObserver(observer) {} in FakeSocketEcho() argument
163 explicit FakeSocketId(IDnsTlsSocketObserver* observer) : mObserver(observer) {} in FakeSocketId() argument
225 explicit FakeSocketDelay(IDnsTlsSocketObserver* observer) : mObserver(observer) {} in FakeSocketDelay() argument
431 IDnsTlsSocketObserver* observer ATTRIBUTE_UNUSED, in createDnsTlsSocket()
462 explicit FakeSocketClose(IDnsTlsSocketObserver* observer) in FakeSocketClose() argument
463 : mCloser(&IDnsTlsSocketObserver::onClosed, observer) {} in FakeSocketClose()
494 explicit FakeSocketLimited(IDnsTlsSocketObserver* observer) in FakeSocketLimited() argument
495 : mObserver(observer), mQueries(0) {} in FakeSocketLimited()
[all …]
/packages/modules/Wifi/framework/tests/src/android/net/wifi/
DWifiManagerTest.java679 TestLocalOnlyHotspotObserver observer = new TestLocalOnlyHotspotObserver(); in testLocalOnlyHotspotObserver() local
681 assertFalse(observer.mOnRegistered); in testLocalOnlyHotspotObserver()
682 assertFalse(observer.mOnStartedCalled); in testLocalOnlyHotspotObserver()
683 assertFalse(observer.mOnStoppedCalled); in testLocalOnlyHotspotObserver()
684 assertEquals(null, observer.mConfig); in testLocalOnlyHotspotObserver()
685 assertEquals(null, observer.mSub); in testLocalOnlyHotspotObserver()
689 observer.onRegistered(sub); in testLocalOnlyHotspotObserver()
690 assertTrue(observer.mOnRegistered); in testLocalOnlyHotspotObserver()
691 assertFalse(observer.mOnStartedCalled); in testLocalOnlyHotspotObserver()
692 assertFalse(observer.mOnStoppedCalled); in testLocalOnlyHotspotObserver()
[all …]
/packages/modules/Permission/PermissionController/src/com/android/permissioncontroller/role/ui/specialappaccess/
DSpecialAppAccessViewModel.java90 @NonNull ManageRoleHolderStateObserver observer) { in observeManageRoleHolderState() argument
95 liveData.observe(owner, state -> observer.onManageRoleHolderStateChanged(liveData, in observeManageRoleHolderState()
111 @NonNull LifecycleOwner owner, @NonNull ManageRoleHolderStateObserver observer) { in getManageRoleHolderStateLiveData() argument
116 liveData.observe(owner, state -> observer.onManageRoleHolderStateChanged(finalLiveData, in getManageRoleHolderStateLiveData()
135 @NonNull ManageRoleHolderStateObserver observer) { in setSpecialAppAccessAsUser() argument
137 observer); in setSpecialAppAccessAsUser()
/packages/modules/Permission/PermissionController/src/com/android/permissioncontroller/permission/service/
DCheckLifecycleRegistry.kt28 override fun addObserver(observer: LifecycleObserver) { in addObserver()
33 super.addObserver(observer) in addObserver()
37 override fun removeObserver(observer: LifecycleObserver) { in removeObserver()
42 super.removeObserver(observer) in removeObserver()
/packages/modules/Wifi/service/java/com/android/server/wifi/util/
DNetdWrapper.java351 public void registerObserver(NetdEventObserver observer) { in registerObserver() argument
352 mObservers.add(observer); in registerObserver()
358 public void unregisterObserver(NetdEventObserver observer) { in unregisterObserver() argument
359 mObservers.remove(observer); in unregisterObserver()
482 for (NetdEventObserver observer : mObservers) { in notifyInterfaceStatusChanged()
483 observer.interfaceStatusChanged(iface, up); in notifyInterfaceStatusChanged()
492 for (NetdEventObserver observer : mObservers) { in notifyInterfaceLinkStateChanged()
493 observer.interfaceLinkStateChanged(iface, up); in notifyInterfaceLinkStateChanged()
/packages/apps/QuickSearchBox/src/com/android/quicksearchbox/
DSuggestionCursorWrapper.java63 public void registerDataSetObserver(DataSetObserver observer) { in registerDataSetObserver() argument
65 mCursor.registerDataSetObserver(observer); in registerDataSetObserver()
69 public void unregisterDataSetObserver(DataSetObserver observer) { in unregisterDataSetObserver() argument
71 mCursor.unregisterDataSetObserver(observer); in unregisterDataSetObserver()
DSuggestions.java110 public void registerDataSetObserver(DataSetObserver observer) { in registerDataSetObserver() argument
114 mDataSetObservable.registerObserver(observer); in registerDataSetObserver()
121 public void unregisterDataSetObserver(DataSetObserver observer) { in unregisterDataSetObserver() argument
122 mDataSetObservable.unregisterObserver(observer); in unregisterDataSetObserver()
DListSuggestionCursor.java119 public void registerDataSetObserver(DataSetObserver observer) { in registerDataSetObserver() argument
120 mDataSetObservable.registerObserver(observer); in registerDataSetObserver()
129 public void unregisterDataSetObserver(DataSetObserver observer) { in unregisterDataSetObserver() argument
130 mDataSetObservable.unregisterObserver(observer); in unregisterDataSetObserver()
/packages/apps/Messaging/src/com/android/messaging/ui/
DBugleActionBarActivity.java155 for (final ImeUtil.ImeStateObserver observer : mImeStateObservers) { in onDisplayHeightChanged()
156 observer.onImeStateChanged(mImeOpen); in onDisplayHeightChanged()
162 public void registerImeStateObserver(final ImeUtil.ImeStateObserver observer) { in registerImeStateObserver() argument
163 mImeStateObservers.add(observer); in registerImeStateObserver()
167 public void unregisterImeStateObserver(final ImeUtil.ImeStateObserver observer) { in unregisterImeStateObserver() argument
168 mImeStateObservers.remove(observer); in unregisterImeStateObserver()
/packages/apps/Dialer/java/com/android/dialer/searchfragment/cp2/
DContactFilterCursor.java498 public void registerContentObserver(ContentObserver observer) { in registerContentObserver() argument
499 cursor.registerContentObserver(observer); in registerContentObserver()
503 public void unregisterContentObserver(ContentObserver observer) { in unregisterContentObserver() argument
504 cursor.unregisterContentObserver(observer); in unregisterContentObserver()
508 public void registerDataSetObserver(DataSetObserver observer) { in registerDataSetObserver() argument
509 cursor.registerDataSetObserver(observer); in registerDataSetObserver()
513 public void unregisterDataSetObserver(DataSetObserver observer) { in unregisterDataSetObserver() argument
514 cursor.unregisterDataSetObserver(observer); in unregisterDataSetObserver()
/packages/apps/Gallery2/src/com/android/photos/views/
DHeaderGridView.java434 public void registerDataSetObserver(DataSetObserver observer) { in registerDataSetObserver() argument
435 mDataSetObservable.registerObserver(observer); in registerDataSetObserver()
437 mAdapter.registerDataSetObserver(observer); in registerDataSetObserver()
442 public void unregisterDataSetObserver(DataSetObserver observer) { in unregisterDataSetObserver() argument
443 mDataSetObservable.unregisterObserver(observer); in unregisterDataSetObserver()
445 mAdapter.unregisterDataSetObserver(observer); in unregisterDataSetObserver()

12345