Home
last modified time | relevance | path

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

123456789

/frameworks/base/packages/SettingsLib/src/com/android/settingslib/core/lifecycle/
DLifecycle.java79 public void addObserver(androidx.lifecycle.LifecycleObserver observer) { in addObserver() argument
81 super.addObserver(observer); in addObserver()
82 if (observer instanceof LifecycleObserver) { in addObserver()
83 mObservers.add((LifecycleObserver) observer); in addObserver()
89 public void removeObserver(androidx.lifecycle.LifecycleObserver observer) { in removeObserver() argument
91 super.removeObserver(observer); in removeObserver()
92 if (observer instanceof LifecycleObserver) { in removeObserver()
93 mObservers.remove(observer); in removeObserver()
99 final LifecycleObserver observer = mObservers.get(i); in onAttach() local
100 if (observer instanceof OnAttach) { in onAttach()
[all …]
/frameworks/base/services/backup/java/com/android/server/backup/utils/
DFullBackupRestoreObserverUtils.java36 public static IFullBackupRestoreObserver sendStartRestore(IFullBackupRestoreObserver observer) { in sendStartRestore() argument
37 if (observer != null) { in sendStartRestore()
39 observer.onStartRestore(); in sendStartRestore()
42 observer = null; in sendStartRestore()
45 return observer; in sendStartRestore()
57 IFullBackupRestoreObserver observer, String name) { in sendOnRestorePackage() argument
58 if (observer != null) { in sendOnRestorePackage()
61 observer.onRestorePackage(name); in sendOnRestorePackage()
64 observer = null; in sendOnRestorePackage()
67 return observer; in sendOnRestorePackage()
[all …]
DBackupObserverUtils.java35 public static void sendBackupOnUpdate(IBackupObserver observer, String packageName, in sendBackupOnUpdate() argument
37 if (observer != null) { in sendBackupOnUpdate()
39 observer.onUpdate(packageName, progress); in sendBackupOnUpdate()
52 public static void sendBackupOnPackageResult(IBackupObserver observer, String packageName, in sendBackupOnPackageResult() argument
54 if (observer != null) { in sendBackupOnPackageResult()
56 observer.onResult(packageName, status); in sendBackupOnPackageResult()
69 public static void sendBackupFinished(IBackupObserver observer, int status) { in sendBackupFinished() argument
70 if (observer != null) { in sendBackupFinished()
72 observer.backupFinished(status); in sendBackupFinished()
/frameworks/opt/setupwizard/library/test/robotest/src/com/android/setupwizardlib/items/
DItemGroupTest.java45 @Mock private ItemHierarchy.Observer observer; field in ItemGroupTest
51 itemGroup.registerObserver(observer); in setUp()
67 final InOrder inOrder = inOrder(observer); in testGroup()
68 inOrder.verify(observer).onItemRangeInserted(eq(itemGroup), eq(0), eq(1)); in testGroup()
69 inOrder.verify(observer).onItemRangeInserted(eq(itemGroup), eq(1), eq(1)); in testGroup()
88 verify(observer).onItemRangeRemoved(eq(itemGroup), eq(1), eq(1)); in testRemoveChild()
100 verify(observer).onItemRangeRemoved(eq(itemGroup), eq(0), eq(2)); in testClear()
107 parentGroup.registerObserver(observer); in testNestedGroup()
128 final InOrder inOrder = inOrder(observer); in testNestedGroup()
129 inOrder.verify(observer).onItemRangeInserted(eq(parentGroup), eq(0), eq(1)); in testNestedGroup()
[all …]
/frameworks/base/tests/net/java/com/android/server/
DNetworkManagementServiceTest.java111 BaseNetworkObserver observer = mock(BaseNetworkObserver.class); in testNetworkObservers() local
112 doReturn(new Binder()).when(observer).asBinder(); // Used by registerObserver. in testNetworkObservers()
113 mNMService.registerObserver(observer); in testNetworkObservers()
119 reset(observer); in testNetworkObservers()
128 expectSoon(observer).interfaceAdded("rmnet12"); in testNetworkObservers()
131 expectSoon(observer).interfaceRemoved("eth1"); in testNetworkObservers()
134 expectSoon(observer).interfaceStatusChanged("clat4", true); in testNetworkObservers()
137 expectSoon(observer).interfaceLinkStateChanged("rmnet0", false); in testNetworkObservers()
143 expectSoon(observer).limitReached("data", "rmnet_usb0"); in testNetworkObservers()
149 expectSoon(observer).interfaceClassDataActivityChanged("1", true, 1234); in testNetworkObservers()
[all …]
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/util/
DLifecycleFragmentTest.java54 LifecycleEventObserver observer = mock(LifecycleEventObserver.class); in testCreateLifecycle() local
55 fragment.getLifecycle().addObserver(observer); in testCreateLifecycle()
60 verify(observer).onStateChanged(eq(fragment), eq(ON_CREATE)); in testCreateLifecycle()
66 LifecycleEventObserver observer = mock(LifecycleEventObserver.class); in testResumeLifecycle() local
67 fragment.getLifecycle().addObserver(observer); in testResumeLifecycle()
72 verify(observer).onStateChanged(eq(fragment), eq(ON_RESUME)); in testResumeLifecycle()
78 LifecycleEventObserver observer = mock(LifecycleEventObserver.class); in testStartLifecycle() local
79 fragment.getLifecycle().addObserver(observer); in testStartLifecycle()
84 verify(observer).onStateChanged(eq(fragment), eq(ON_START)); in testStartLifecycle()
90 LifecycleEventObserver observer = mock(LifecycleEventObserver.class); in testStopLifecycle() local
[all …]
DSysuiLifecycleTest.java55 LifecycleEventObserver observer = mock(LifecycleEventObserver.class); in testAttach() local
57 lifecycle.getLifecycle().addObserver(observer); in testAttach()
62 verify(observer).onStateChanged(eq(lifecycle), eq(ON_CREATE)); in testAttach()
63 verify(observer).onStateChanged(eq(lifecycle), eq(ON_START)); in testAttach()
64 verify(observer).onStateChanged(eq(lifecycle), eq(ON_RESUME)); in testAttach()
73 LifecycleEventObserver observer = mock(LifecycleEventObserver.class); in testDetach() local
75 lifecycle.getLifecycle().addObserver(observer); in testDetach()
83 verify(observer).onStateChanged(eq(lifecycle), eq(ON_PAUSE)); in testDetach()
84 verify(observer).onStateChanged(eq(lifecycle), eq(ON_STOP)); in testDetach()
85 verify(observer).onStateChanged(eq(lifecycle), eq(ON_DESTROY)); in testDetach()
/frameworks/opt/setupwizard/library/main/src/com/android/setupwizardlib/items/
DAbstractItemHierarchy.java59 public void registerObserver(Observer observer) { in registerObserver() argument
60 observers.add(observer); in registerObserver()
64 public void unregisterObserver(Observer observer) { in unregisterObserver() argument
65 observers.remove(observer); in unregisterObserver()
70 for (Observer observer : observers) { in notifyChanged()
71 observer.onChanged(this); in notifyChanged()
86 for (Observer observer : observers) { in notifyItemRangeChanged()
87 observer.onItemRangeChanged(this, position, itemCount); in notifyItemRangeChanged()
102 for (Observer observer : observers) { in notifyItemRangeInserted()
103 observer.onItemRangeInserted(this, position, itemCount); in notifyItemRangeInserted()
[all …]
/frameworks/base/core/java/android/database/
DObservable.java43 public void registerObserver(T observer) { in registerObserver() argument
44 if (observer == null) { in registerObserver()
48 if (mObservers.contains(observer)) { in registerObserver()
49 throw new IllegalStateException("Observer " + observer + " is already registered."); in registerObserver()
51 mObservers.add(observer); in registerObserver()
62 public void unregisterObserver(T observer) { in unregisterObserver() argument
63 if (observer == null) { in unregisterObserver()
67 int index = mObservers.indexOf(observer); in unregisterObserver()
69 throw new IllegalStateException("Observer " + observer + " was not registered."); in unregisterObserver()
DContentObservable.java31 public void registerObserver(ContentObserver observer) { in registerObserver() argument
32 super.registerObserver(observer); in registerObserver()
68 for (ContentObserver observer : mObservers) { in dispatchChange()
69 if (!selfChange || observer.deliverSelfNotifications()) { in dispatchChange()
70 observer.dispatchChange(selfChange, uri); in dispatchChange()
86 for (ContentObserver observer : mObservers) { in notifyChange()
87 observer.onChange(selfChange, null); in notifyChange()
DMergeCursor.java181 public void registerContentObserver(ContentObserver observer) { in registerContentObserver() argument
185 mCursors[i].registerContentObserver(observer); in registerContentObserver()
190 public void unregisterContentObserver(ContentObserver observer) { in unregisterContentObserver() argument
194 mCursors[i].unregisterContentObserver(observer); in unregisterContentObserver()
200 public void registerDataSetObserver(DataSetObserver observer) { in registerDataSetObserver() argument
204 mCursors[i].registerDataSetObserver(observer); in registerDataSetObserver()
210 public void unregisterDataSetObserver(DataSetObserver observer) { in unregisterDataSetObserver() argument
214 mCursors[i].unregisterDataSetObserver(observer); in unregisterDataSetObserver()
DCursorWrapper.java220 public void registerContentObserver(ContentObserver observer) { in registerContentObserver() argument
221 mCursor.registerContentObserver(observer); in registerContentObserver()
225 public void registerDataSetObserver(DataSetObserver observer) { in registerDataSetObserver() argument
226 mCursor.registerDataSetObserver(observer); in registerDataSetObserver()
261 public void unregisterContentObserver(ContentObserver observer) { in unregisterContentObserver() argument
262 mCursor.unregisterContentObserver(observer); in unregisterContentObserver()
266 public void unregisterDataSetObserver(DataSetObserver observer) { in unregisterDataSetObserver() argument
267 mCursor.unregisterDataSetObserver(observer); in unregisterDataSetObserver()
/frameworks/base/core/java/android/app/backup/
DRestoreSession.java56 public int getAvailableRestoreSets(RestoreObserver observer, BackupManagerMonitor monitor) { in getAvailableRestoreSets() argument
58 RestoreObserverWrapper obsWrapper = new RestoreObserverWrapper(mContext, observer); in getAvailableRestoreSets()
80 public int getAvailableRestoreSets(RestoreObserver observer) { in getAvailableRestoreSets() argument
81 return getAvailableRestoreSets(observer, null); in getAvailableRestoreSets()
99 public int restoreAll(long token, RestoreObserver observer, BackupManagerMonitor monitor) { in restoreAll() argument
105 mObserver = new RestoreObserverWrapper(mContext, observer); in restoreAll()
130 public int restoreAll(long token, RestoreObserver observer) { in restoreAll() argument
131 return restoreAll(token, observer, null); in restoreAll()
154 public int restorePackages(long token, @Nullable RestoreObserver observer, in restorePackages() argument
161 mObserver = new RestoreObserverWrapper(mContext, observer); in restorePackages()
[all …]
/frameworks/base/services/backup/java/com/android/server/backup/params/
DRestoreParams.java29 public final IRestoreObserver observer; field in RestoreParams
43 IRestoreObserver observer, in createForSinglePackage() argument
50 observer, in createForSinglePackage()
65 IRestoreObserver observer, in createForRestoreAtInstall() argument
74 observer, in createForRestoreAtInstall()
89 IRestoreObserver observer, in createForRestoreAll() argument
95 observer, in createForRestoreAll()
110 IRestoreObserver observer, in createForRestorePackages() argument
118 observer, in createForRestorePackages()
130 IRestoreObserver observer, in RestoreParams() argument
[all …]
/frameworks/base/core/java/android/view/
DViewTreeObserver.java372 void merge(ViewTreeObserver observer) { in merge() argument
373 if (observer.mOnWindowAttachListeners != null) { in merge()
375 mOnWindowAttachListeners.addAll(observer.mOnWindowAttachListeners); in merge()
377 mOnWindowAttachListeners = observer.mOnWindowAttachListeners; in merge()
381 if (observer.mOnWindowFocusListeners != null) { in merge()
383 mOnWindowFocusListeners.addAll(observer.mOnWindowFocusListeners); in merge()
385 mOnWindowFocusListeners = observer.mOnWindowFocusListeners; in merge()
389 if (observer.mOnGlobalFocusListeners != null) { in merge()
391 mOnGlobalFocusListeners.addAll(observer.mOnGlobalFocusListeners); in merge()
393 mOnGlobalFocusListeners = observer.mOnGlobalFocusListeners; in merge()
[all …]
DWindowId.java133 public void registerFocusObserver(FocusObserver observer) { in registerFocusObserver() argument
134 synchronized (observer.mRegistrations) { in registerFocusObserver()
135 if (observer.mRegistrations.containsKey(mToken.asBinder())) { in registerFocusObserver()
139 observer.mRegistrations.put(mToken.asBinder(), this); in registerFocusObserver()
141 mToken.registerFocusObserver(observer.mIObserver); in registerFocusObserver()
150 public void unregisterFocusObserver(FocusObserver observer) { in unregisterFocusObserver() argument
151 synchronized (observer.mRegistrations) { in unregisterFocusObserver()
152 if (observer.mRegistrations.remove(mToken.asBinder()) == null) { in unregisterFocusObserver()
156 mToken.unregisterFocusObserver(observer.mIObserver); in unregisterFocusObserver()
/frameworks/base/services/tests/servicestests/src/com/android/server/
DMountServiceTests.java132 final ObbObserver observer = new ObbObserver(); in mountObb() local
134 sm.mountObb(file.getPath(), null, observer)); in mountObb()
137 observer.waitForCompletion()); in mountObb()
144 file.getPath(), observer.getPath()); in mountObb()
146 assertEquals(expectedState, observer.getState()); in mountObb()
153 final ObbObserver observer = new ObbObserver(); in mountObbWithoutWait() local
155 .getPath(), null, observer)); in mountObbWithoutWait()
157 return observer; in mountObbWithoutWait()
161 final ObbObserver observer, int expectedState, boolean checkPath) { in waitForObbActionCompletion() argument
162 assertTrue("Mount should have completed", observer.waitForCompletion()); in waitForObbActionCompletion()
[all …]
/frameworks/base/libs/hwui/
DRenderNode.cpp66 ImmediateRemoved observer(nullptr); in ~RenderNode() local
67 deleteDisplayList(observer); in ~RenderNode()
120 MarkAndSweepRemoved observer(&info); in prepareTree() local
123 prepareTreeImpl(observer, info, false); in prepareTree()
202 void RenderNode::prepareTreeImpl(TreeObserver& observer, TreeInfo& info, bool functorsNeedLayer) { in prepareTreeImpl() argument
239 pushStagingDisplayListChanges(observer, info); in prepareTreeImpl()
245 observer, info, childFunctorsNeedLayer, in prepareTreeImpl()
246 [](RenderNode* child, TreeObserver& observer, TreeInfo& info, in prepareTreeImpl()
248 child->prepareTreeImpl(observer, info, functorsNeedLayer); in prepareTreeImpl()
294 void RenderNode::syncDisplayList(TreeObserver& observer, TreeInfo* info) { in syncDisplayList() argument
[all …]
/frameworks/base/services/core/java/com/android/server/
DPackageWatchdog.java209 public void registerHealthObserver(PackageHealthObserver observer) { in registerHealthObserver() argument
211 ObserverInternal internalObserver = mAllObservers.get(observer.getName()); in registerHealthObserver()
213 internalObserver.mRegisteredObserver = observer; in registerHealthObserver()
234 public void startObservingHealth(PackageHealthObserver observer, List<String> packageNames, in startObservingHealth() argument
237 Slog.wtf(TAG, "No packages to observe, " + observer.getName()); in startObservingHealth()
243 + observer.getName() + ". Not observing packages " + packageNames); in startObservingHealth()
259 ObserverInternal oldObserver = mAllObservers.get(observer.getName()); in startObservingHealth()
261 Slog.d(TAG, observer.getName() + " started monitoring health " in startObservingHealth()
263 mAllObservers.put(observer.getName(), in startObservingHealth()
264 new ObserverInternal(observer.getName(), packages)); in startObservingHealth()
[all …]
/frameworks/base/libs/hwui/tests/unit/
DSkiaDisplayListTests.cpp165 TestUtils::MockTreeObserver observer; in RENDERTHREAD_SKIA_PIPELINE_TEST() local
166 ASSERT_FALSE(skiaDL.prepareListAndChildren(observer, info, false, in RENDERTHREAD_SKIA_PIPELINE_TEST()
177 ASSERT_TRUE(skiaDL.prepareListAndChildren(observer, info, false, in RENDERTHREAD_SKIA_PIPELINE_TEST()
188 observer, info, false, in RENDERTHREAD_SKIA_PIPELINE_TEST()
189 [&hasRun, renderNode, infoPtr](RenderNode* n, TreeObserver& observer, TreeInfo& i, in RENDERTHREAD_SKIA_PIPELINE_TEST()
236 TestUtils::MockTreeObserver observer; in RENDERTHREAD_SKIA_PIPELINE_TEST() local
238 observer, info, false, [](RenderNode*, TreeObserver&, TreeInfo&, bool) {})); in RENDERTHREAD_SKIA_PIPELINE_TEST()
260 TestUtils::MockTreeObserver observer; in RENDERTHREAD_SKIA_PIPELINE_TEST() local
262 observer, info, false, [](RenderNode*, TreeObserver&, TreeInfo&, bool) {})); in RENDERTHREAD_SKIA_PIPELINE_TEST()
280 TestUtils::MockTreeObserver observer; in RENDERTHREAD_SKIA_PIPELINE_TEST() local
[all …]
/frameworks/base/wifi/tests/src/android/net/wifi/
DWifiManagerTest.java319 TestLocalOnlyHotspotObserver observer = new TestLocalOnlyHotspotObserver(); in testLocalOnlyHotspotObserver() local
320 assertFalse(observer.mOnRegistered); in testLocalOnlyHotspotObserver()
321 assertFalse(observer.mOnStartedCalled); in testLocalOnlyHotspotObserver()
322 assertFalse(observer.mOnStoppedCalled); in testLocalOnlyHotspotObserver()
323 assertEquals(null, observer.mConfig); in testLocalOnlyHotspotObserver()
324 assertEquals(null, observer.mSub); in testLocalOnlyHotspotObserver()
328 observer.onRegistered(sub); in testLocalOnlyHotspotObserver()
329 assertTrue(observer.mOnRegistered); in testLocalOnlyHotspotObserver()
330 assertFalse(observer.mOnStartedCalled); in testLocalOnlyHotspotObserver()
331 assertFalse(observer.mOnStoppedCalled); in testLocalOnlyHotspotObserver()
[all …]
/frameworks/base/core/java/android/os/
DUEventObserver.java205 final UEventObserver observer = in sendEvent() local
207 mTempObserversToSignal.add(observer); in sendEvent()
216 final UEventObserver observer = mTempObserversToSignal.get(i); in sendEvent() local
217 observer.onUEvent(event); in sendEvent()
223 public void addObserver(String match, UEventObserver observer) { in addObserver() argument
226 mKeysAndObservers.add(observer); in addObserver()
232 public void removeObserver(UEventObserver observer) { in removeObserver() argument
235 if (mKeysAndObservers.get(i + 1) == observer) { in removeObserver()
DFileObserver.java117 @NotifyEventType int mask, FileObserver observer) { in startWatching() argument
129 new WeakReference<>(observer); in startWatching()
148 FileObserver observer = null; in onEvent() local
153 observer = (FileObserver) weak.get(); in onEvent()
154 if (observer == null) { in onEvent()
161 if (observer != null) { in onEvent()
163 observer.onEvent(mask, path); in onEvent()
165 Log.wtf(LOG_TAG, "Unhandled exception in FileObserver " + observer, throwable); in onEvent()
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/
DCallbackControllerTest.java51 ArgumentCaptor<LifecycleEventObserver> observer = in testAddCallback() local
54 verify(lifecycle).addObserver(observer.capture()); in testAddCallback()
57 observer.getValue().onStateChanged(owner, Event.ON_RESUME); in testAddCallback()
69 ArgumentCaptor<LifecycleEventObserver> observer = in testRemoveCallback() local
72 verify(lifecycle).addObserver(observer.capture()); in testRemoveCallback()
75 observer.getValue().onStateChanged(owner, Event.ON_PAUSE); in testRemoveCallback()
/frameworks/base/packages/SystemUI/src/com/android/systemui/keyguard/
DLifecycle.java29 public void addObserver(T observer) { in addObserver() argument
30 mObservers.add(observer); in addObserver()
33 public void removeObserver(T observer) { in removeObserver() argument
34 mObservers.remove(observer); in removeObserver()

123456789