Home
last modified time | relevance | path

Searched refs:consumer (Results 1 – 25 of 279) sorted by relevance

12345678910>>...12

/frameworks/base/services/tests/mockingservicestests/src/android/service/dreams/
DDreamOverlayConnectionHandlerTest.java90 final Consumer<IDreamOverlayClient> consumer = Mockito.mock(Consumer.class); in consumerShouldRunImmediatelyWhenClientAvailable() local
91 mDreamOverlayConnectionHandler.addConsumer(consumer); in consumerShouldRunImmediatelyWhenClientAvailable()
93 verify(consumer).accept(mOverlayClient); in consumerShouldRunImmediatelyWhenClientAvailable()
101 final Consumer<IDreamOverlayClient> consumer = Mockito.mock(Consumer.class); in consumerShouldRunAfterClientAvailable() local
102 mDreamOverlayConnectionHandler.addConsumer(consumer); in consumerShouldRunAfterClientAvailable()
105 verify(consumer, never()).accept(mOverlayClient); in consumerShouldRunAfterClientAvailable()
109 verify(consumer).accept(mOverlayClient); in consumerShouldRunAfterClientAvailable()
117 final Consumer<IDreamOverlayClient> consumer = Mockito.mock(Consumer.class); in consumerShouldNeverRunIfClientConnectsAndDisconnects() local
118 mDreamOverlayConnectionHandler.addConsumer(consumer); in consumerShouldNeverRunIfClientConnectsAndDisconnects()
121 verify(consumer, never()).accept(mOverlayClient); in consumerShouldNeverRunIfClientConnectsAndDisconnects()
[all …]
/frameworks/base/services/tests/mockingservicestests/src/com/android/server/location/listeners/
DListenerMultiplexerTest.java58 void onRegistrationAdded(Consumer<TestListenerRegistration> consumer, in onRegistrationAdded() argument
66 void onRegistrationRemoved(Consumer<TestListenerRegistration> consumer, in onRegistrationRemoved() argument
87 Consumer<TestListenerRegistration> consumer = mock(Consumer.class); in testAdd() local
89 mMultiplexer.addListener(0, consumer); in testAdd()
91 mInOrder.verify(mCallbacks).onRegistrationAdded(eq(consumer), in testAdd()
97 mMultiplexer.addListener(1, consumer); in testAdd()
98 mInOrder.verify(mCallbacks).onRegistrationReplaced(eq(consumer), in testAdd()
100 eq(consumer), in testAdd()
106 verify(consumer).accept(any(TestListenerRegistration.class)); in testAdd()
112 Consumer<TestListenerRegistration> consumer = mock(Consumer.class); in testReplace() local
[all …]
/frameworks/base/core/java/android/app/
DConfigurationChangedListenerController.java48 @NonNull Consumer<IBinder> consumer) { in addListener() argument
50 if (indexOf(consumer) > -1) { in addListener()
53 mListenerContainers.add(new ListenerContainer(executor, consumer)); in addListener()
61 void removeListener(@NonNull Consumer<IBinder> consumer) { in removeListener() argument
63 final int index = indexOf(consumer); in removeListener()
85 private int indexOf(Consumer<IBinder> consumer) { in indexOf() argument
87 if (mListenerContainers.get(i).isMatch(consumer)) { in indexOf()
102 @NonNull Consumer<IBinder> consumer) { in ListenerContainer() argument
104 mConsumer = consumer; in ListenerContainer()
107 public boolean isMatch(@NonNull Consumer<IBinder> consumer) { in isMatch() argument
[all …]
/frameworks/base/services/tests/powerstatstests/src/com/android/server/power/stats/
DAmbientDisplayPowerCalculatorTest.java76 BatteryConsumer consumer = mStatsRule.getDeviceBatteryConsumer(); in testMeasuredEnergyBasedModel() local
77 assertThat(consumer.getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_AMBIENT_DISPLAY)) in testMeasuredEnergyBasedModel()
80 assertThat(consumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_AMBIENT_DISPLAY)) in testMeasuredEnergyBasedModel()
82 assertThat(consumer.getPowerModel(BatteryConsumer.POWER_COMPONENT_AMBIENT_DISPLAY)) in testMeasuredEnergyBasedModel()
136 BatteryConsumer consumer = mStatsRule.getDeviceBatteryConsumer(); in testMeasuredEnergyBasedModel_multiDisplay() local
137 assertThat(consumer.getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_AMBIENT_DISPLAY)) in testMeasuredEnergyBasedModel_multiDisplay()
141 assertThat(consumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_AMBIENT_DISPLAY)) in testMeasuredEnergyBasedModel_multiDisplay()
143 assertThat(consumer.getPowerModel(BatteryConsumer.POWER_COMPONENT_AMBIENT_DISPLAY)) in testMeasuredEnergyBasedModel_multiDisplay()
161 BatteryConsumer consumer = mStatsRule.getDeviceBatteryConsumer(); in testPowerProfileBasedModel() local
162 assertThat(consumer.getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_AMBIENT_DISPLAY)) in testPowerProfileBasedModel()
[all …]
DGnssPowerCalculatorTest.java66 UidBatteryConsumer consumer = mStatsRule.getUidBatteryConsumer(APP_UID); in testTimerBasedModel() local
67 assertThat(consumer.getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_GNSS)) in testTimerBasedModel()
69 assertThat(consumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_GNSS)) in testTimerBasedModel()
71 assertThat(consumer.getPowerModel(BatteryConsumer.POWER_COMPONENT_GNSS)) in testTimerBasedModel()
105 UidBatteryConsumer consumer = mStatsRule.getUidBatteryConsumer(APP_UID); in testMeasuredEnergyBasedModel() local
106 assertThat(consumer.getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_GNSS)) in testMeasuredEnergyBasedModel()
108 assertThat(consumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_GNSS)) in testMeasuredEnergyBasedModel()
110 assertThat(consumer.getPowerModel(BatteryConsumer.POWER_COMPONENT_GNSS)) in testMeasuredEnergyBasedModel()
/frameworks/base/core/java/android/service/dreams/
DDreamOverlayConnectionHandler.java124 public void addConsumer(Consumer<IDreamOverlayClient> consumer) { in addConsumer() argument
125 final Message msg = mHandler.obtainMessage(MSG_ADD_CONSUMER, consumer); in addConsumer()
134 public void removeConsumer(Consumer<IDreamOverlayClient> consumer) { in removeConsumer() argument
135 final Message msg = mHandler.obtainMessage(MSG_REMOVE_CONSUMER, consumer); in removeConsumer()
138 mHandler.removeMessages(MSG_ADD_CONSUMER, consumer); in removeConsumer()
161 for (Consumer<IDreamOverlayClient> consumer : mConsumers) { in onOverlayClientReady()
162 consumer.accept(mClient); in onOverlayClientReady()
166 private void onAddConsumer(Consumer<IDreamOverlayClient> consumer) { in onAddConsumer() argument
168 consumer.accept(mClient); in onAddConsumer()
170 mConsumers.add(consumer); in onAddConsumer()
[all …]
/frameworks/base/core/java/android/inputmethodservice/
DIRemoteInputConnectionInvoker.java78 protected OnceResultReceiver(@NonNull Executor executor, @NonNull C consumer) { in OnceResultReceiver() argument
81 Objects.requireNonNull(consumer); in OnceResultReceiver()
83 mConsumer = consumer; in OnceResultReceiver()
89 final C consumer; in onReceiveResult() local
92 consumer = mConsumer; in onReceiveResult()
96 if (executor != null && consumer != null) { in onReceiveResult()
97 dispatch(executor, consumer, resultCode, resultData); in onReceiveResult()
101 protected abstract void dispatch(@NonNull Executor executor, @NonNull C consumer, int code, in dispatch() argument
111 IntResultReceiver(@NonNull Executor executor, @NonNull IntConsumer consumer) { in IntResultReceiver() argument
112 super(executor, consumer); in IntResultReceiver()
[all …]
/frameworks/base/services/core/java/com/android/server/power/stats/
DEnergyConsumerSnapshot.java192 final EnergyConsumer consumer = mEnergyConsumers.get(consumerId, null); in updateAndGetDelta() local
193 if (consumer == null) { in updateAndGetDelta()
197 final int type = consumer.type; in updateAndGetDelta()
198 final int ordinal = consumer.ordinal; in updateAndGetDelta()
208 updateAndGetDeltaForTypeOther(consumer, newAttributions, avgVoltageMV); in updateAndGetDelta()
220 Slog.e(TAG, "Bad data! EnergyConsumer " + consumer.name in updateAndGetDelta()
273 Slog.w(TAG, "Ignoring consumer " + consumer.name + " of unknown type " + type); in updateAndGetDelta()
353 final EnergyConsumer consumer = mEnergyConsumers.valueAt(i); in dump() local
355 consumer.id, consumer.ordinal, consumer.type, consumer.name)); in dump()
379 final EnergyConsumer consumer = mEnergyConsumers.valueAt(idx); in getOtherOrdinalNames() local
[all …]
/frameworks/base/location/java/android/location/
DCountryDetector.java76 ListenerTransport(Consumer<Country> consumer, Executor executor) { in ListenerTransport() argument
77 mListener = consumer; in ListenerTransport()
154 @NonNull Executor executor, @NonNull Consumer<Country> consumer) { in registerCountryDetectorCallback() argument
156 unregisterCountryDetectorCallback(consumer); in registerCountryDetectorCallback()
157 ListenerTransport transport = new ListenerTransport(consumer, executor); in registerCountryDetectorCallback()
160 mListeners.put(consumer, transport); in registerCountryDetectorCallback()
168 public void unregisterCountryDetectorCallback(@NonNull Consumer<Country> consumer) { in unregisterCountryDetectorCallback() argument
170 ListenerTransport transport = mListeners.remove(consumer); in unregisterCountryDetectorCallback()
/frameworks/base/services/core/java/com/android/server/wallpaper/
DLocalColorRepository.java52 public void addAreas(ILocalWallpaperColorConsumer consumer, List<RectF> areas, int displayId) { in addAreas() argument
53 IBinder binder = consumer.asBinder(); in addAreas()
58 consumer.asBinder().linkToDeath(() -> in addAreas()
59 mLocalColorAreas.remove(consumer.asBinder()), 0); in addAreas()
76 mCallbacks.register(consumer); in addAreas()
86 public List<RectF> removeAreas(ILocalWallpaperColorConsumer consumer, List<RectF> areas, in removeAreas() argument
88 IBinder binder = consumer.asBinder(); in removeAreas()
94 mCallbacks.unregister(consumer); in removeAreas()
105 mCallbacks.unregister(consumer); in removeAreas()
108 mCallbacks.unregister(consumer); in removeAreas()
/frameworks/base/libs/WindowManager/Jetpack/src/androidx/window/extensions/util/
DDeduplicateConsumer.java36 public DeduplicateConsumer(@NonNull Consumer<T> consumer) { in DeduplicateConsumer() argument
37 mConsumer = consumer; in DeduplicateConsumer()
44 public boolean matchesConsumer(@NonNull Consumer<T> consumer) { in matchesConsumer() argument
45 return consumer == this || mConsumer.equals(consumer); in matchesConsumer()
/frameworks/native/libs/nativedisplay/surfacetexture/
Dsurface_texture.cpp35 android::sp<android::SurfaceTexture> consumer; member
113 ast->consumer = SurfaceTexture_getSurfaceTexture(env, surfacetexture); in ASurfaceTexture_fromSurfaceTexture()
130 return st->consumer->attachToContext(tex); in ASurfaceTexture_attachToGLContext()
134 return st->consumer->detachFromContext(); in ASurfaceTexture_detachFromGLContext()
138 return st->consumer->updateTexImage(); in ASurfaceTexture_updateTexImage()
142 st->consumer->getTransformMatrix(mtx); in ASurfaceTexture_getTransformMatrix()
146 return st->consumer->getTimestamp(); in ASurfaceTexture_getTimestamp()
184 return st->consumer->getCurrentTextureTarget(); in ASurfaceTexture_getCurrentTextureTarget()
188 texture->consumer->takeConsumerOwnership(); in ASurfaceTexture_takeConsumerOwnership()
192 texture->consumer->releaseConsumerOwnership(); in ASurfaceTexture_releaseConsumerOwnership()
[all …]
/frameworks/native/services/surfaceflinger/tests/
DVirtualDisplay_test.cpp30 sp<IGraphicBufferConsumer> consumer; in SetUp() local
32 BufferQueue::createBufferQueue(&mProducer, &consumer); in SetUp()
33 consumer->setConsumerName(String8("Virtual disp consumer")); in SetUp()
34 consumer->setDefaultBufferSize(100, 100); in SetUp()
36 mGLConsumer = sp<GLConsumer>::make(consumer, GLConsumer::TEXTURE_EXTERNAL, true, false); in SetUp()
/frameworks/av/services/camera/libcameraservice/gui/
DRingBufferConsumer.h61 RingBufferConsumer(const sp<IGraphicBufferConsumer>& consumer, uint64_t consumerUsage,
118 PinnedBufferItem(wp<RingBufferConsumer> consumer, in PinnedBufferItem()
120 mConsumer(consumer), in PinnedBufferItem()
125 sp<RingBufferConsumer> consumer = mConsumer.promote(); in ~PinnedBufferItem() local
126 if (consumer != NULL) { in ~PinnedBufferItem()
127 consumer->unpinBuffer(mBufferItem); in ~PinnedBufferItem()
/frameworks/base/services/core/java/com/android/server/biometrics/log/
DALSProbe.java141 final NextConsumer consumer = mNextConsumer; in onNext() local
143 if (consumer != null) { in onNext()
152 consumer.consume(value); in onNext()
174 public synchronized void awaitNextLux(@NonNull Consumer<Float> consumer, in awaitNextLux() argument
176 final NextConsumer nextConsumer = new NextConsumer(consumer, handler); in awaitNextLux()
239 private NextConsumer(@NonNull Consumer<Float> consumer, @Nullable Handler handler) { in NextConsumer() argument
240 mConsumer = consumer; in NextConsumer()
255 public void add(NextConsumer consumer) { in add() argument
256 mOthers.add(consumer); in add()
/frameworks/base/packages/SystemUI/src/com/android/systemui/util/kotlin/
DJavaAdapter.kt56 consumer: Consumer<T>, in alwaysCollectFlow()
58 return scope.launch { flow.collect { consumer.accept(it) } } in alwaysCollectFlow()
71 consumer: Consumer<T>, in collectFlow()
76 repeatOnLifecycle(state) { flow.collect { consumer.accept(it) } } in collectFlow()
89 consumer: Consumer<T>, in collectFlow()
93 lifecycle.repeatOnLifecycle(state) { flow.collect { consumer.accept(it) } } in collectFlow()
/frameworks/native/opengl/tests/EGLTest/
DEGL_test.cpp152 sp<IGraphicBufferConsumer> consumer; in TEST_F() local
153 BufferQueue::createBufferQueue(&producer, &consumer); in TEST_F()
154 consumer->consumerConnect(new MockConsumer, false); in TEST_F()
272 sp<IGraphicBufferConsumer> consumer; in TEST_F() local
273 BufferQueue::createBufferQueue(&producer, &consumer); in TEST_F()
274 consumer->consumerConnect(new MockConsumer, false); in TEST_F()
320 sp<IGraphicBufferConsumer> consumer; in TEST_F() local
321 BufferQueue::createBufferQueue(&producer, &consumer); in TEST_F()
322 consumer->consumerConnect(new MockConsumer, false); in TEST_F()
417 sp<IGraphicBufferConsumer> consumer; in TEST_F() local
[all …]
/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/
DNotificationEntryProcessorFactoryExecutorImpl.kt29 override fun create(consumer: Consumer<NotificationEntry>): Processor<NotificationEntry> { in <lambda>()
30 return ExecutorProcessor(mMainExecutor, consumer) in <lambda>()
35 private val consumer: Consumer<NotificationEntry>, in <lambda>() constant in com.android.systemui.statusbar.notification.row.NotificationEntryProcessorFactoryExecutorImpl.ExecutorProcessor
48 consumer.accept(entry) in <lambda>()
DNotificationEntryProcessorFactoryLooperImpl.kt29 override fun create(consumer: Consumer<NotificationEntry>): Processor<NotificationEntry> { in create()
30 return HandlerProcessor(mMainLooper, consumer) in create()
35 private val consumer: Consumer<NotificationEntry>, constant in com.android.systemui.statusbar.notification.row.NotificationEntryProcessorFactoryLooperImpl
40 consumer.accept(entry) in handleMessage()
/frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/common/
DScreenshotUtils.java39 Consumer<ScreenCapture.ScreenshotHardwareBuffer> consumer) { in captureLayer() argument
40 consumer.accept(ScreenCapture.captureLayers( in captureLayer()
114 BufferConsumer consumer = new BufferConsumer(t, sc, parentSc, layer); in takeScreenshot() local
115 captureLayer(sc, crop, consumer); in takeScreenshot()
116 return consumer.mScreenshot; in takeScreenshot()
/frameworks/base/core/tests/batterystatstests/BatteryStatsViewer/src/com/android/frameworks/core/batterystatsviewer/
DBatteryConsumerData.java288 for (UidBatteryConsumer consumer : batteryUsageStats.getUidBatteryConsumers()) { in getRequestedBatteryConsumer()
289 if (batteryConsumerId(consumer).equals(batteryConsumerId)) { in getRequestedBatteryConsumer()
290 return consumer; in getRequestedBatteryConsumer()
323 final BatteryConsumer consumer = in computeTotalPower() local
327 powerByComponentMah[component] += consumer.getConsumedPower(component); in computeTotalPower()
333 final BatteryConsumer consumer = in computeTotalPowerForCustomComponent() local
336 final int customComponentCount = consumer.getCustomPowerComponentCount(); in computeTotalPowerForCustomComponent()
340 powerByComponentMah[component] += consumer.getConsumedPowerForCustomComponent( in computeTotalPowerForCustomComponent()
347 for (BatteryConsumer consumer : batteryUsageStats.getUidBatteryConsumers()) { in computeTotalDuration()
350 durationByComponentMs[component] += consumer.getUsageDurationMillis(component); in computeTotalDuration()
[all …]
/frameworks/base/libs/WindowManager/Jetpack/src/androidx/window/extensions/area/
DWindowAreaComponentImpl.java145 @NonNull Consumer<@WindowAreaStatus Integer> consumer) { in addRearDisplayStatusListener()
147 mRearDisplayStatusListeners.add(consumer); in addRearDisplayStatusListener()
153 consumer.accept(getCurrentRearDisplayModeStatus()); in addRearDisplayStatusListener()
163 @NonNull Consumer<@WindowAreaStatus Integer> consumer) { in removeRearDisplayStatusListener()
165 mRearDisplayStatusListeners.remove(consumer); in removeRearDisplayStatusListener()
310 @NonNull Consumer<ExtensionWindowAreaStatus> consumer) { in addRearDisplayPresentationStatusListener()
312 mRearDisplayPresentationStatusListeners.add(consumer); in addRearDisplayPresentationStatusListener()
321 consumer.accept( in addRearDisplayPresentationStatusListener()
332 @NonNull Consumer<ExtensionWindowAreaStatus> consumer) { in removeRearDisplayPresentationStatusListener()
334 mRearDisplayPresentationStatusListeners.remove(consumer); in removeRearDisplayPresentationStatusListener()
[all …]
/frameworks/base/libs/WindowManager/Jetpack/src/androidx/window/extensions/layout/
DWindowLayoutComponentImpl.java107 @NonNull java.util.function.Consumer<WindowLayoutInfo> consumer) { in addWindowLayoutInfoListener() argument
108 final Consumer<WindowLayoutInfo> extConsumer = consumer::accept; in addWindowLayoutInfoListener()
110 mJavaToExtConsumers.put(consumer, extConsumer); in addWindowLayoutInfoListener()
129 @NonNull Consumer<WindowLayoutInfo> consumer) { in addWindowLayoutInfoListener() argument
134 || containsConsumer(consumer)) { in addWindowLayoutInfoListener()
143 consumer.accept(newWindowLayout); in addWindowLayoutInfoListener()
145 mWindowLayoutChangeListeners.put(context, new DeduplicateConsumer<>(consumer)); in addWindowLayoutInfoListener()
161 @NonNull java.util.function.Consumer<WindowLayoutInfo> consumer) { in removeWindowLayoutInfoListener()
164 extConsumer = mJavaToExtConsumers.remove(consumer); in removeWindowLayoutInfoListener()
178 public void removeWindowLayoutInfoListener(@NonNull Consumer<WindowLayoutInfo> consumer) { in removeWindowLayoutInfoListener() argument
[all …]
/frameworks/base/services/tests/wmtests/src/com/android/server/wm/
DTransparentPolicyTest.java285 private void runTestScenario(Consumer<TransparentPolicyRobotTest> consumer, in runTestScenario() argument
297 consumer.accept(robot); in runTestScenario()
300 private void runTestScenario(Consumer<TransparentPolicyRobotTest> consumer, in runTestScenario() argument
302 runTestScenario(consumer, /* policyEnabled */ true, displayWidth, displayHeight); in runTestScenario()
305 private void runTestScenario(Consumer<TransparentPolicyRobotTest> consumer, in runTestScenario() argument
307 runTestScenario(consumer, policyEnabled, /* displayWidth */ 2000, in runTestScenario()
311 private void runTestScenario(Consumer<TransparentPolicyRobotTest> consumer) { in runTestScenario() argument
312 runTestScenario(consumer, /* policyEnabled */ true); in runTestScenario()
527 void applyToTop(Consumer<ActivityRecord> consumer) { in applyToTop() argument
528 consumer.accept(mActivityStack.top()); in applyToTop()
[all …]
/frameworks/base/services/tests/mockingservicestests/src/com/android/server/wallpaper/
DLocalColorRepositoryTest.java102 Consumer<ILocalWallpaperColorConsumer> consumer = mock(Consumer.class); in testAreaCallback() local
111 mRepo.forEachCallback(consumer, area1, 0); in testAreaCallback()
112 Mockito.verify(consumer, times(1)).accept(eq(mCallback1)); in testAreaCallback()
113 Mockito.verify(consumer, times(0)).accept(eq(mCallback2)); in testAreaCallback()
114 mRepo.forEachCallback(consumer, area2, 0); in testAreaCallback()
115 Mockito.verify(consumer, times(2)).accept(eq(mCallback1)); in testAreaCallback()
116 Mockito.verify(consumer, times(1)).accept(eq(mCallback2)); in testAreaCallback()

12345678910>>...12