Home
last modified time | relevance | path

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

1234

/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.java95 CaptureObserver<MediaItemMetadata> observer = new CaptureObserver<>(); in testGetMetadata() local
96 mPlaybackViewModel.getMetadata().observe(mLifecycleOwner, observer); in testGetMetadata()
97 observer.reset(); in testGetMetadata()
102 assertThat(observer.hasBeenNotified()).isTrue(); in testGetMetadata()
103 MediaItemMetadata observedValue = observer.getObservedValue(); in testGetMetadata()
110 CaptureObserver<PlaybackViewModel.PlaybackStateWrapper> observer = new CaptureObserver<>(); in testGetPlaybackState() local
111 mPlaybackViewModel.getPlaybackStateWrapper().observe(mLifecycleOwner, observer); in testGetPlaybackState()
112 observer.reset(); in testGetPlaybackState()
118 assertThat(observer.hasBeenNotified()).isTrue(); in testGetPlaybackState()
119 assertThat(observer.getObservedValue().getStateCompat()).isEqualTo(mPlaybackState); in testGetPlaybackState()
[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-media-common/tests/robotests/src/com/android/car/media/common/source/
DMediaSourceViewModelTest.java131 CaptureObserver<MediaSource> observer = new CaptureObserver<>(); in testGetSelectedMediaSource_none() local
133 mViewModel.getPrimaryMediaSource().observe(mLifecycleOwner, observer); in testGetSelectedMediaSource_none()
135 assertThat(observer.getObservedValue()).isNull(); in testGetSelectedMediaSource_none()
140 CaptureObserver<MediaControllerCompat> observer = new CaptureObserver<>(); in testGetMediaController_connectedBrowser() local
148 mViewModel.getMediaController().observe(mLifecycleOwner, observer); in testGetMediaController_connectedBrowser()
150 assertThat(observer.getObservedValue()).isSameAs(mMediaControllerFromBrowser); in testGetMediaController_connectedBrowser()
156 CaptureObserver<MediaControllerCompat> observer = new CaptureObserver<>(); in testGetMediaController_noActiveSession_notConnected() local
163 mViewModel.getMediaController().observe(mLifecycleOwner, observer); in testGetMediaController_noActiveSession_notConnected()
165 assertThat(observer.hasBeenNotified()).isTrue(); in testGetMediaController_noActiveSession_notConnected()
166 assertThat(observer.getObservedValue()).isNull(); in testGetMediaController_noActiveSession_notConnected()
/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/Media/src/com/android/car/media/browse/
DBrowseAdapter.java125 public void registerObserver(Observer observer) { in registerObserver() argument
126 mObservers.add(observer); in registerObserver()
132 public void unregisterObserver(Observer observer) { in unregisterObserver() argument
133 mObservers.remove(observer); in unregisterObserver()
212 for (Observer observer : mObservers) {
213 notification.accept(observer);
288 observer -> observer.onBrowsableItemClicked(item));
291 observer -> observer.onPlayableItemClicked(item));
/packages/apps/ManagedProvisioning/tests/instrumentation/src/com/android/managedprovisioning/task/
DInstallPackageTaskTest.java145 IntentSender observer = verifyPackageInstalled( in testSuccess() local
152 observer.sendIntent(getContext(), 0, fillIn, null, null); in testSuccess()
170 IntentSender observer = verifyPackageInstalled( in testSuccess_allowTestOnly() local
178 observer.sendIntent(getContext(), 0, fillIn, null, null); in testSuccess_allowTestOnly()
195 IntentSender observer = verifyPackageInstalled( in testInstallFailedVersionDowngrade() local
204 observer.sendIntent(getContext(), 0, fillIn, null, null); in testInstallFailedVersionDowngrade()
220 IntentSender observer = verifyPackageInstalled( in testInstallFailedOtherError() local
229 observer.sendIntent(getContext(), 0, fillIn, null, null); in testInstallFailedOtherError()
245 IntentSender observer = verifyPackageInstalled( in testDifferentPackageName() local
251 observer.sendIntent(getContext(), 0, fillIn, null, null); in testDifferentPackageName()
/packages/modules/DnsResolver/
Dresolv_tls_unit_test.cpp113 IDnsTlsSocketObserver* observer, in createDnsTlsSocket() argument
115 return std::make_unique<T>(observer); in createDnsTlsSocket()
131 explicit FakeSocketEcho(IDnsTlsSocketObserver* observer) : mObserver(observer) {} in FakeSocketEcho() argument
157 explicit FakeSocketId(IDnsTlsSocketObserver* observer) : mObserver(observer) {} in FakeSocketId() argument
218 explicit FakeSocketDelay(IDnsTlsSocketObserver* observer) : mObserver(observer) {} in FakeSocketDelay() argument
420 IDnsTlsSocketObserver* observer ATTRIBUTE_UNUSED, in createDnsTlsSocket()
440 explicit FakeSocketClose(IDnsTlsSocketObserver* observer) in FakeSocketClose() argument
441 : mCloser(&IDnsTlsSocketObserver::onClosed, observer) {} in FakeSocketClose()
470 explicit FakeSocketLimited(IDnsTlsSocketObserver* observer) in FakeSocketLimited() argument
471 : mObserver(observer), mQueries(0) {} in FakeSocketLimited()
[all …]
DDnsTlsSocketFactory.h36 IDnsTlsSocketObserver* _Nonnull observer, in createDnsTlsSocket() argument
38 auto socket = std::make_unique<DnsTlsSocket>(server, mark, observer, cache); in createDnsTlsSocket()
/packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/
DSpecialAppAccessViewModel.java87 @NonNull ManageRoleHolderStateObserver observer) { in observeManageRoleHolderState() argument
92 liveData.observe(owner, state -> observer.onManageRoleHolderStateChanged(liveData, in observeManageRoleHolderState()
108 @NonNull LifecycleOwner owner, @NonNull ManageRoleHolderStateObserver observer) { in getManageRoleHolderStateLiveData() argument
113 liveData.observe(owner, state -> observer.onManageRoleHolderStateChanged(finalLiveData, in getManageRoleHolderStateLiveData()
132 @NonNull ManageRoleHolderStateObserver observer) { in setSpecialAppAccessAsUser() argument
134 observer); in setSpecialAppAccessAsUser()
/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/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()
DSuggestionCursor.java72 void registerDataSetObserver(DataSetObserver observer); in registerDataSetObserver() argument
80 void unregisterDataSetObserver(DataSetObserver observer); in unregisterDataSetObserver() argument
/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/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()
/packages/apps/Settings/tests/robotests/src/com/android/settings/development/
DWirelessDebuggingEnablerTest.java96 final ContentObserver observer = in adbWifiEnabled_switchBarShouldBeChecked() local
98 observer.onChange(true, Global.getUriFor(Global.ADB_WIFI_ENABLED)); in adbWifiEnabled_switchBarShouldBeChecked()
116 final ContentObserver observer = in adbWifiEnabled_switchBarShouldNotBeChecked() local
118 observer.onChange(true, Global.getUriFor(Global.ADB_WIFI_ENABLED)); in adbWifiEnabled_switchBarShouldNotBeChecked()
/packages/screensavers/PhotoTable/src/com/android/dreams/phototable/
DSectionedAlbumDataAdapter.java167 public void registerDataSetObserver(DataSetObserver observer) { in registerDataSetObserver() argument
168 mAlbumData.registerDataSetObserver(observer); in registerDataSetObserver()
172 public void unregisterDataSetObserver(DataSetObserver observer) { in unregisterDataSetObserver() argument
173 mAlbumData.unregisterDataSetObserver(observer); in unregisterDataSetObserver()
/packages/apps/Messaging/src/com/android/messaging/datamodel/
DParticipantRefresh.java171 final ContactContentObserver observer = Factory.get().getContactContentObserver(); in getNeedFullRefresh() local
172 if (observer == null) { in getNeedFullRefresh()
180 observer.initialize(); in getNeedFullRefresh()
186 return observer.getContactChanged(); in getNeedFullRefresh()
190 final ContactContentObserver observer = Factory.get().getContactContentObserver(); in resetNeedFullRefresh() local
191 if (observer != null) { in resetNeedFullRefresh()
192 observer.resetContactChanged(); in resetNeedFullRefresh()
/packages/apps/Gallery2/src/com/android/gallery3d/filtershow/imageshow/
DPrimaryImage.java223 public void addObserver(ImageShow observer) { in addObserver() argument
224 if (mObservers.contains(observer)) { in addObserver()
227 mObservers.add(observer); in addObserver()
230 public void removeObserver(ImageShow observer) { in removeObserver() argument
231 mObservers.remove(observer); in removeObserver()
480 for (ImageShow observer : mObservers) { in notifyObservers()
481 observer.invalidate(); in notifyObservers()
/packages/apps/Gallery2/src/com/android/gallery3d/ui/
DPopupList.java93 ViewTreeObserver observer = mAnchorView.getViewTreeObserver();
94 if (observer.isAlive()) {
97 observer.removeGlobalOnLayoutListener(mOnGLobalLayoutListener);
/packages/apps/Settings/tests/robotests/src/com/android/settings/network/telephony/
DContactDiscoveryPreferenceControllerTest.java143 ContentObserver observer = getUceChangeObserver(); in testContentObserverChanged() local
144 assertNotNull(observer); in testContentObserverChanged()
147 observer.onChange(false, UCE_URI); in testContentObserverChanged()
/packages/apps/TV/tests/unit/src/com/android/tv/data/
DChannelDataManagerTest.java390 public void notifyChange(Uri uri, ContentObserver observer, boolean syncToNetwork) { in notifyChange() argument
391 super.notifyChange(uri, observer, syncToNetwork); in notifyChange()
398 + observer in notifyChange()
407 if (observer != null) { in notifyChange()
408 observer.dispatchChange(false, uri); in notifyChange()
/packages/apps/DeskClock/src/com/android/deskclock/data/
DAlarmModel.kt43 val observer: ContentObserver = SystemAlarmAlertChangeObserver() constant
44 cr.registerContentObserver(Settings.System.DEFAULT_ALARM_ALERT_URI, false, observer)

1234