Home
last modified time | relevance | path

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

1234567891011

/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/core/java/com/android/server/power/stats/
DEnergyConsumerSnapshot.java195 final EnergyConsumer consumer = mEnergyConsumers.get(consumerId, null); in updateAndGetDelta() local
196 if (consumer == null) { in updateAndGetDelta()
200 final int type = consumer.type; in updateAndGetDelta()
201 final int ordinal = consumer.ordinal; in updateAndGetDelta()
211 updateAndGetDeltaForTypeOther(consumer, newAttributions, avgVoltageMV); in updateAndGetDelta()
223 Slog.e(TAG, "Bad data! EnergyConsumer " + consumer.name in updateAndGetDelta()
276 Slog.w(TAG, "Ignoring consumer " + consumer.name + " of unknown type " + type); in updateAndGetDelta()
356 final EnergyConsumer consumer = mEnergyConsumers.valueAt(i); in dump() local
358 consumer.id, consumer.ordinal, consumer.type, consumer.name)); in dump()
382 final EnergyConsumer consumer = mEnergyConsumers.valueAt(idx); in getOtherOrdinalNames() local
[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/servicestests/src/com/android/server/power/stats/
DAmbientDisplayPowerCalculatorTest.java70 BatteryConsumer consumer = mStatsRule.getDeviceBatteryConsumer(); in testMeasuredEnergyBasedModel() local
71 assertThat(consumer.getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_AMBIENT_DISPLAY)) in testMeasuredEnergyBasedModel()
74 assertThat(consumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_AMBIENT_DISPLAY)) in testMeasuredEnergyBasedModel()
76 assertThat(consumer.getPowerModel(BatteryConsumer.POWER_COMPONENT_AMBIENT_DISPLAY)) in testMeasuredEnergyBasedModel()
130 BatteryConsumer consumer = mStatsRule.getDeviceBatteryConsumer(); in testMeasuredEnergyBasedModel_multiDisplay() local
131 assertThat(consumer.getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_AMBIENT_DISPLAY)) in testMeasuredEnergyBasedModel_multiDisplay()
135 assertThat(consumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_AMBIENT_DISPLAY)) in testMeasuredEnergyBasedModel_multiDisplay()
137 assertThat(consumer.getPowerModel(BatteryConsumer.POWER_COMPONENT_AMBIENT_DISPLAY)) in testMeasuredEnergyBasedModel_multiDisplay()
155 BatteryConsumer consumer = mStatsRule.getDeviceBatteryConsumer(); in testPowerProfileBasedModel() local
156 assertThat(consumer.getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_AMBIENT_DISPLAY)) in testPowerProfileBasedModel()
[all …]
DGnssPowerCalculatorTest.java61 UidBatteryConsumer consumer = mStatsRule.getUidBatteryConsumer(APP_UID); in testTimerBasedModel() local
62 assertThat(consumer.getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_GNSS)) in testTimerBasedModel()
64 assertThat(consumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_GNSS)) in testTimerBasedModel()
66 assertThat(consumer.getPowerModel(BatteryConsumer.POWER_COMPONENT_GNSS)) in testTimerBasedModel()
100 UidBatteryConsumer consumer = mStatsRule.getUidBatteryConsumer(APP_UID); in testMeasuredEnergyBasedModel() local
101 assertThat(consumer.getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_GNSS)) in testMeasuredEnergyBasedModel()
103 assertThat(consumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_GNSS)) in testMeasuredEnergyBasedModel()
105 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/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/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.h63 RingBufferConsumer(const sp<IGraphicBufferConsumer>& consumer, uint64_t consumerUsage,
120 PinnedBufferItem(wp<RingBufferConsumer> consumer, in PinnedBufferItem()
122 mConsumer(consumer), in PinnedBufferItem()
127 sp<RingBufferConsumer> consumer = mConsumer.promote(); in ~PinnedBufferItem() local
128 if (consumer != NULL) { in ~PinnedBufferItem()
129 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()
236 private NextConsumer(@NonNull Consumer<Float> consumer, @Nullable Handler handler) { in NextConsumer() argument
237 mConsumer = consumer; in NextConsumer()
252 public void add(NextConsumer consumer) { in add() argument
253 mOthers.add(consumer); in add()
/frameworks/base/libs/WindowManager/Jetpack/src/androidx/window/extensions/layout/
DWindowLayoutComponentImpl.java99 java.util.function.Consumer<List<CommonFoldingFeature>> consumer) { in addFoldingStateChangedCallback() argument
101 mFoldingFeatureProducer.addDataChangedCallback(consumer); in addFoldingStateChangedCallback()
113 @NonNull java.util.function.Consumer<WindowLayoutInfo> consumer) { in addWindowLayoutInfoListener() argument
114 final Consumer<WindowLayoutInfo> extConsumer = consumer::accept; in addWindowLayoutInfoListener()
116 mJavaToExtConsumers.put(consumer, extConsumer); in addWindowLayoutInfoListener()
135 @NonNull Consumer<WindowLayoutInfo> consumer) { in addWindowLayoutInfoListener() argument
140 || mWindowLayoutChangeListeners.containsValue(consumer)) { in addWindowLayoutInfoListener()
149 consumer.accept(newWindowLayout); in addWindowLayoutInfoListener()
151 mWindowLayoutChangeListeners.put(context, consumer); in addWindowLayoutInfoListener()
167 @NonNull java.util.function.Consumer<WindowLayoutInfo> consumer) { in removeWindowLayoutInfoListener()
[all …]
/frameworks/native/libs/gui/fuzzer/
Dlibgui_bufferQueue_fuzzer.cpp220 void BufferQueueFuzzer::invokeAcquireBuffer(sp<BufferQueueConsumer> consumer) { in invokeAcquireBuffer() argument
222 consumer->acquireBuffer(&item, mFdp.ConsumeIntegral<uint32_t>(), in invokeAcquireBuffer()
226 void BufferQueueFuzzer::invokeOccupancyTracker(sp<BufferQueueConsumer> consumer) { in invokeOccupancyTracker() argument
229 consumer->dumpState(prefix, &outResult); in invokeOccupancyTracker()
232 consumer->getOccupancyHistory(mFdp.ConsumeBool() /*forceFlush*/, &outHistory); in invokeOccupancyTracker()
237 sp<BufferQueueConsumer> consumer(new BufferQueueConsumer(core)); in invokeBufferQueueConsumer() local
239 consumer->consumerConnect(listener, mFdp.ConsumeBool() /*controlledByApp*/); in invokeBufferQueueConsumer()
240 invokeAcquireBuffer(consumer); in invokeBufferQueueConsumer()
247 consumer->attachBuffer(&slot, buffer); in invokeBufferQueueConsumer()
248 consumer->detachBuffer(slot); in invokeBufferQueueConsumer()
[all …]
/frameworks/native/opengl/tests/EGLTest/
DEGL_test.cpp149 sp<IGraphicBufferConsumer> consumer; in TEST_F() local
150 BufferQueue::createBufferQueue(&producer, &consumer); in TEST_F()
151 consumer->consumerConnect(new MockConsumer, false); in TEST_F()
269 sp<IGraphicBufferConsumer> consumer; in TEST_F() local
270 BufferQueue::createBufferQueue(&producer, &consumer); in TEST_F()
271 consumer->consumerConnect(new MockConsumer, false); in TEST_F()
317 sp<IGraphicBufferConsumer> consumer; in TEST_F() local
318 BufferQueue::createBufferQueue(&producer, &consumer); in TEST_F()
319 consumer->consumerConnect(new MockConsumer, false); in TEST_F()
414 sp<IGraphicBufferConsumer> consumer; in TEST_F() local
[all …]
/frameworks/base/libs/WindowManager/Jetpack/src/androidx/window/extensions/area/
DWindowAreaComponentImpl.java141 @NonNull Consumer<@WindowAreaStatus Integer> consumer) { in addRearDisplayStatusListener()
143 mRearDisplayStatusListeners.add(consumer); in addRearDisplayStatusListener()
149 consumer.accept(getCurrentRearDisplayModeStatus()); in addRearDisplayStatusListener()
159 @NonNull Consumer<@WindowAreaStatus Integer> consumer) { in removeRearDisplayStatusListener()
161 mRearDisplayStatusListeners.remove(consumer); in removeRearDisplayStatusListener()
306 @NonNull Consumer<ExtensionWindowAreaStatus> consumer) { in addRearDisplayPresentationStatusListener()
308 mRearDisplayPresentationStatusListeners.add(consumer); in addRearDisplayPresentationStatusListener()
317 consumer.accept( in addRearDisplayPresentationStatusListener()
328 @NonNull Consumer<ExtensionWindowAreaStatus> consumer) { in removeRearDisplayPresentationStatusListener()
330 mRearDisplayPresentationStatusListeners.remove(consumer); in removeRearDisplayPresentationStatusListener()
[all …]
/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/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()
/frameworks/base/core/java/android/window/
DWindowInfosListenerForTest.java119 @NonNull Consumer<List<WindowInfo>> consumer) { in addWindowInfosListener()
132 consumer.accept(buildWindowInfos(windowHandles, displayInfos)); in addWindowInfosListener()
135 mListeners.put(consumer, listener); in addWindowInfosListener()
138 consumer.accept(buildWindowInfos(initialState.first, initialState.second)); in addWindowInfosListener()
145 public void removeWindowInfosListener(@NonNull Consumer<List<WindowInfo>> consumer) { in removeWindowInfosListener() argument
146 WindowInfosListener listener = mListeners.remove(consumer); in removeWindowInfosListener()
/frameworks/base/core/java/android/service/wearable/
DWearableSensingService.java101 Consumer<Integer> consumer = response -> { in onBind()
109 parcelFileDescriptor, consumer); in onBind()
119 Consumer<Integer> consumer = response -> { in onBind() local
126 WearableSensingService.this.onDataProvided(data, sharedMemory, consumer); in onBind()
170 Consumer<AmbientContextDetectionServiceStatus> consumer = response -> { in onBind() local
179 new HashSet<>(Arrays.asList(events)), packageName, consumer); in onBind()
267 @NonNull Consumer<AmbientContextDetectionServiceStatus> consumer);
/frameworks/base/packages/SystemUI/src/com/android/systemui/util/kotlin/
DJavaAdapter.kt55 consumer: Consumer<T>, in alwaysCollectFlow()
57 return scope.launch { flow.collect { consumer.accept(it) } } in alwaysCollectFlow()
70 consumer: Consumer<T>, in collectFlow()
75 repeatOnLifecycle(state) { flow.collect { consumer.accept(it) } } in collectFlow()
/frameworks/base/core/java/android/os/
DBatteryUsageStats.java167 final UidBatteryConsumer consumer = uidBatteryConsumerBuilder.build(); in BatteryUsageStats() local
168 totalPowerMah += consumer.getConsumedPower(); in BatteryUsageStats()
169 mUidBatteryConsumers.add(consumer); in BatteryUsageStats()
176 final UserBatteryConsumer consumer = in BatteryUsageStats() local
178 totalPowerMah += consumer.getConsumedPower(); in BatteryUsageStats()
179 mUserBatteryConsumers.add(consumer); in BatteryUsageStats()
362 final AggregateBatteryConsumer consumer = new AggregateBatteryConsumer(data); in BatteryUsageStats() local
363 mAggregateBatteryConsumers[consumer.getScope()] = consumer; in BatteryUsageStats()
493 final UidBatteryConsumer consumer = consumers.get(i); in writeUidBatteryConsumersProto() local
495 final long fgMs = consumer.getTimeInStateMs(UidBatteryConsumer.STATE_FOREGROUND); in writeUidBatteryConsumersProto()
[all …]

1234567891011