Home
last modified time | relevance | path

Searched refs:queue (Results 1 – 25 of 210) sorted by relevance

123456789

/frameworks/base/services/tests/servicestests/src/com/android/server/textclassifier/
DFixedSizeQueueTest.java30 FixedSizeQueue<Integer> queue = new FixedSizeQueue<>(1, /* onEntryEvictedListener= */ null); in add_belowMaxCapacity() local
31 assertThat(queue.size()).isEqualTo(0); in add_belowMaxCapacity()
33 queue.add(1); in add_belowMaxCapacity()
35 assertThat(queue.size()).isEqualTo(1); in add_belowMaxCapacity()
36 assertThat(queue.poll()).isEqualTo(1); in add_belowMaxCapacity()
41 FixedSizeQueue<Integer> queue = new FixedSizeQueue<>(2, /* onEntryEvictedListener= */ null); in add_exceedMaxCapacity() local
43 queue.add(1); in add_exceedMaxCapacity()
44 queue.add(2); in add_exceedMaxCapacity()
45 queue.add(3); in add_exceedMaxCapacity()
47 assertThat(queue.size()).isEqualTo(2); in add_exceedMaxCapacity()
[all …]
/frameworks/native/services/inputflinger/tests/
DBlockingQueue_test.cpp33 BlockingQueue<int> queue(capacity); in TEST() local
35 ASSERT_TRUE(queue.push(1)); in TEST()
36 ASSERT_EQ(queue.pop(), 1); in TEST()
44 BlockingQueue<int> queue(capacity); in TEST() local
47 ASSERT_TRUE(queue.push(1)); in TEST()
48 ASSERT_TRUE(queue.push(2)); in TEST()
49 ASSERT_TRUE(queue.push(3)); in TEST()
50 ASSERT_FALSE(queue.push(4)) << "Queue should reach capacity at size " << capacity; in TEST()
59 BlockingQueue<int> queue(capacity); in TEST() local
62 ASSERT_TRUE(queue.push(static_cast<int>(i))); in TEST()
[all …]
DTestInputListener.cpp90 std::vector<NotifyArgsType>& queue = std::get<std::vector<NotifyArgsType>>(mQueues); in assertCalled() local
91 if (queue.empty()) { in assertCalled()
94 [&queue]() REQUIRES(mLock) { return !queue.empty(); }); in assertCalled()
100 *outEventArgs = *queue.begin(); in assertCalled()
102 queue.erase(queue.begin()); in assertCalled()
110 std::vector<NotifyArgsType>& queue = std::get<std::vector<NotifyArgsType>>(mQueues); in assertNotCalled() local
113 [&queue]() REQUIRES(mLock) { return !queue.empty(); }); in assertNotCalled()
123 std::vector<NotifyArgsType>& queue = std::get<std::vector<NotifyArgsType>>(mQueues); in notify() local
124 queue.push_back(*args); in notify()
/frameworks/base/libs/hwui/tests/unit/
DLayerUpdateQueueTests.cpp28 LayerUpdateQueue queue; in TEST() local
29 EXPECT_TRUE(queue.entries().empty()); in TEST()
44 LayerUpdateQueue queue; in TEST() local
45 queue.enqueueLayerWithDamage(a.get(), Rect(25, 25, 75, 75)); in TEST()
46 queue.enqueueLayerWithDamage(b.get(), Rect(100, 100, 300, 300)); in TEST()
47 queue.enqueueLayerWithDamage(c.get(), Rect(.5, .5, .5, .5)); in TEST()
49 EXPECT_EQ(3u, queue.entries().size()); in TEST()
51 EXPECT_EQ(a.get(), queue.entries()[0].renderNode.get()); in TEST()
52 EXPECT_EQ(Rect(25, 25, 75, 75), queue.entries()[0].damage); in TEST()
53 EXPECT_EQ(b.get(), queue.entries()[1].renderNode.get()); in TEST()
[all …]
DThreadBaseTests.cpp39 static WorkQueue& queue() { in queue() function
40 return thread().queue(); in queue()
45 queue().post([&ran]() { ran = true; }); in TEST()
57 queue().postDelayed(100_us, [&]() { ranAtPromise.set_value(clock::now()); }); in TEST()
67 auto result = queue().runSync([&otherTid]() -> auto { in TEST()
80 auto otherTid = queue().async([]() -> auto { return gettid(); }); in TEST()
81 auto otherPid = queue().async([]() -> auto { return getpid(); }); in TEST()
82 auto result = queue().async([]() -> auto { return 42; }); in TEST()
132 queue().runSync([c = std::move(counter)](){}); in TEST()
141 return queue().runSync([t = test]()->int { return t->getStrongCount(); }); in lifecycleTestHelper()
[all …]
/frameworks/base/libs/hwui/renderthread/
DRenderProxy.cpp39 mContext = mRenderThread.queue().runSync([&]() -> CanvasContext* { in RenderProxy()
54 mRenderThread.queue().runSync([this]() { delete mContext; }); in destroyContext()
60 mRenderThread.queue().post([this, swapBehavior]() { mContext->setSwapBehavior(swapBehavior); }); in setSwapBehavior()
64 return mRenderThread.queue().runSync([this]() -> bool { in loadSystemProperties()
76 mRenderThread.queue().runSync([this, name]() { mContext->setName(std::string(name)); }); in setName()
81 mRenderThread.queue().post([this, win = window, enableTimeout]() mutable { in setSurface()
88 mRenderThread.queue().post([=]() { mContext->allocateBuffers(); }); in allocateBuffers()
92 return mRenderThread.queue().runSync([this]() -> bool { return mContext->pauseSurface(); }); in pause()
96 mRenderThread.queue().runSync([this, stopped]() { mContext->setStopped(stopped); }); in setStopped()
100 mRenderThread.queue().post( in setLightAlpha()
[all …]
/frameworks/av/media/libstagefright/rtsp/
DAAVCAssembler.cpp48 List<sp<ABuffer> > *queue = source->queue(); in addNALUnit() local
50 if (queue->empty()) { in addNALUnit()
55 List<sp<ABuffer> >::iterator it = queue->begin(); in addNALUnit()
56 while (it != queue->end()) { in addNALUnit()
61 it = queue->erase(it); in addNALUnit()
64 if (queue->empty()) { in addNALUnit()
69 sp<ABuffer> buffer = *queue->begin(); in addNALUnit()
87 queue->erase(queue->begin()); in addNALUnit()
96 queue->erase(queue->begin()); in addNALUnit()
101 return addFragmentedNALUnit(queue); in addNALUnit()
[all …]
DAH263Assembler.cpp54 List<sp<ABuffer> > *queue = source->queue(); in addPacket() local
56 if (queue->empty()) { in addPacket()
61 List<sp<ABuffer> >::iterator it = queue->begin(); in addPacket()
62 while (it != queue->end()) { in addPacket()
67 it = queue->erase(it); in addPacket()
70 if (queue->empty()) { in addPacket()
75 sp<ABuffer> buffer = *queue->begin(); in addPacket()
99 queue->erase(queue->begin()); in addPacket()
113 queue->erase(queue->begin()); in addPacket()
121 queue->erase(queue->begin()); in addPacket()
[all …]
DAMPEG2TSAssembler.cpp55 List<sp<ABuffer> > *queue = source->queue(); in addPacket() local
57 if (queue->empty()) { in addPacket()
62 List<sp<ABuffer> >::iterator it = queue->begin(); in addPacket()
63 while (it != queue->end()) { in addPacket()
68 it = queue->erase(it); in addPacket()
71 if (queue->empty()) { in addPacket()
76 sp<ABuffer> buffer = *queue->begin(); in addPacket()
90 queue->erase(queue->begin()); in addPacket()
102 queue->erase(queue->begin()); in addPacket()
DAAMRAssembler.cpp103 List<sp<ABuffer> > *queue = source->queue(); in addPacket() local
105 if (queue->empty()) { in addPacket()
110 List<sp<ABuffer> >::iterator it = queue->begin(); in addPacket()
111 while (it != queue->end()) { in addPacket()
116 it = queue->erase(it); in addPacket()
119 if (queue->empty()) { in addPacket()
124 sp<ABuffer> buffer = *queue->begin(); in addPacket()
138 queue->erase(queue->begin()); in addPacket()
155 queue->erase(queue->begin()); in addPacket()
169 queue->erase(queue->begin()); in addPacket()
[all …]
DARawAudioAssembler.cpp55 List<sp<ABuffer> > *queue = source->queue(); in addPacket() local
57 if (queue->empty()) { in addPacket()
62 List<sp<ABuffer> >::iterator it = queue->begin(); in addPacket()
63 while (it != queue->end()) { in addPacket()
68 it = queue->erase(it); in addPacket()
71 if (queue->empty()) { in addPacket()
76 sp<ABuffer> buffer = *queue->begin(); in addPacket()
90 queue->erase(queue->begin()); in addPacket()
102 queue->erase(queue->begin()); in addPacket()
DAMPEG4ElementaryAssembler.cpp216 List<sp<ABuffer> > *queue = source->queue(); in addPacket() local
218 if (queue->empty()) { in addPacket()
223 List<sp<ABuffer> >::iterator it = queue->begin(); in addPacket()
224 while (it != queue->end()) { in addPacket()
229 it = queue->erase(it); in addPacket()
232 if (queue->empty()) { in addPacket()
237 sp<ABuffer> buffer = *queue->begin(); in addPacket()
262 queue->erase(queue->begin()); in addPacket()
270 queue->erase(queue->begin()); in addPacket()
356 queue->erase(queue->begin()); in addPacket()
[all …]
/frameworks/hardware/interfaces/sensorservice/libsensorndkbridge/
DASensorManager.cpp161 sp<ASensorEventQueue> queue = in createEventQueue() local
164 ::android::hardware::setMinSchedulerPolicy(queue, SCHED_FIFO, 98); in createEventQueue()
168 queue, [&](const sp<IEventQueue> &queueImpl, auto tmpResult) { in createEventQueue()
174 queue->setImpl(queueImpl); in createEventQueue()
182 queue->incStrong(NULL /* id */); in createEventQueue()
184 LOG(VERBOSE) << "Returning event queue " << queue.get(); in createEventQueue()
185 return queue.get(); in createEventQueue()
188 void ASensorManager::destroyEventQueue(ASensorEventQueue *queue) { in destroyEventQueue() argument
189 LOG(VERBOSE) << "ASensorManager::destroyEventQueue(" << queue << ")"; in destroyEventQueue()
191 queue->invalidate(); in destroyEventQueue()
[all …]
DALooper.cpp33 void ALooper::signalSensorEvents(wp<ASensorEventQueue> queue) { in signalSensorEvents() argument
35 mReadyQueues.insert(queue); in signalSensorEvents()
76 for (auto& queue : mReadyQueues) { in pollOnce() local
77 sp<ASensorEventQueue> promotedQueue = queue.promote(); in pollOnce()
94 void ALooper::invalidateSensorQueue(wp<ASensorEventQueue> queue) { in invalidateSensorQueue() argument
96 mReadyQueues.erase(queue); in invalidateSensorQueue()
/frameworks/base/core/jni/
Dandroid_graphics_BLASTBufferQueue.cpp34 sp<BLASTBufferQueue> queue = new BLASTBufferQueue( in nativeCreate() local
36 queue->incStrong((void*)nativeCreate); in nativeCreate()
37 return reinterpret_cast<jlong>(queue.get()); in nativeCreate()
41 sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr); in nativeDestroy() local
42 queue->decStrong((void*)nativeCreate); in nativeDestroy()
46 sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr); in nativeGetSurface() local
47 …return android_view_Surface_createFromIGraphicBufferProducer(env, queue->getIGraphicBufferProducer… in nativeGetSurface()
51 sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr); in nativeSetNextTransaction() local
53 queue->setNextTransaction(transaction); in nativeSetNextTransaction()
57 sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr); in nativeUpdate() local
[all …]
Dandroid_view_InputQueue.cpp204 sp<InputQueue> queue = InputQueue::createQueue(queueWeak, messageQueue->getLooper()); in nativeInit() local
205 if (!queue.get()) { in nativeInit()
209 queue->incStrong(&gInputQueueClassInfo); in nativeInit()
210 return reinterpret_cast<jlong>(queue.get()); in nativeInit()
214 sp<InputQueue> queue = reinterpret_cast<InputQueue*>(ptr); in nativeDispose() local
215 queue->detachLooper(); in nativeDispose()
216 queue->decStrong(&gInputQueueClassInfo); in nativeDispose()
221 InputQueue* queue = reinterpret_cast<InputQueue*>(ptr); in nativeSendKeyEvent() local
222 KeyEvent* event = queue->createKeyEvent(); in nativeSendKeyEvent()
225 queue->recycleInputEvent(event); in nativeSendKeyEvent()
[all …]
/frameworks/av/media/codec2/components/base/
DSimpleC2Component.cpp238 Mutexed<WorkQueue>::Locked queue(mWorkQueue); in queue_nb() local
239 queueWasEmpty = queue->empty(); in queue_nb()
241 queue->push_back(std::move(items->front())); in queue_nb()
266 Mutexed<WorkQueue>::Locked queue(mWorkQueue); in flush_sm() local
267 queue->incGeneration(); in flush_sm()
269 while (!queue->empty()) { in flush_sm()
270 std::unique_ptr<C2Work> work = queue->pop_front(); in flush_sm()
275 while (!queue->pending().empty()) { in flush_sm()
276 flushedWork->push_back(std::move(queue->pending().begin()->second)); in flush_sm()
277 queue->pending().erase(queue->pending().begin()); in flush_sm()
[all …]
/frameworks/base/native/android/
Dsensor.cpp58 if (queue == nullptr) { \
113 sp<SensorEventQueue> queue = in ASensorManager_createEventQueue() local
115 if (queue != 0) { in ASensorManager_createEventQueue()
116 ALooper_addFd(looper, queue->getFd(), ident, ALOOPER_EVENT_INPUT, callback, data); in ASensorManager_createEventQueue()
117 queue->looper = looper; in ASensorManager_createEventQueue()
118 queue->requestAdditionalInfo = false; in ASensorManager_createEventQueue()
119 queue->incStrong(manager); in ASensorManager_createEventQueue()
121 return static_cast<ASensorEventQueue*>(queue.get()); in ASensorManager_createEventQueue()
124 int ASensorManager_destroyEventQueue(ASensorManager* manager, ASensorEventQueue* queue) { in ASensorManager_destroyEventQueue() argument
128 sp<SensorEventQueue> q = static_cast<SensorEventQueue*>(queue); in ASensorManager_destroyEventQueue()
[all …]
Dinput.cpp273 void AInputQueue_attachLooper(AInputQueue* queue, ALooper* looper, in AInputQueue_attachLooper() argument
275 InputQueue* iq = static_cast<InputQueue*>(queue); in AInputQueue_attachLooper()
280 void AInputQueue_detachLooper(AInputQueue* queue) { in AInputQueue_detachLooper() argument
281 InputQueue* iq = static_cast<InputQueue*>(queue); in AInputQueue_detachLooper()
285 int32_t AInputQueue_hasEvents(AInputQueue* queue) { in AInputQueue_hasEvents() argument
286 InputQueue* iq = static_cast<InputQueue*>(queue); in AInputQueue_hasEvents()
290 int32_t AInputQueue_getEvent(AInputQueue* queue, AInputEvent** outEvent) { in AInputQueue_getEvent() argument
291 InputQueue* iq = static_cast<InputQueue*>(queue); in AInputQueue_getEvent()
298 int32_t AInputQueue_preDispatchEvent(AInputQueue* queue, AInputEvent* event) { in AInputQueue_preDispatchEvent() argument
299 InputQueue* iq = static_cast<InputQueue*>(queue); in AInputQueue_preDispatchEvent()
[all …]
/frameworks/base/cmds/statsd/tests/log_event/
DLogEventQueue_test.cpp51 LogEventQueue queue(50); in TEST() local
53 std::thread writer([&queue, timeBaseNs] { in TEST()
56 bool success = queue.push(makeLogEvent(timeBaseNs + i * 1000), &oldestEventNs); in TEST()
62 std::thread reader([&queue, timeBaseNs] { in TEST()
64 auto event = queue.waitPop(); in TEST()
76 LogEventQueue queue(50); in TEST() local
78 std::thread writer([&queue, timeBaseNs] { in TEST()
82 bool success = queue.push(makeLogEvent(timeBaseNs + i * 1000), &oldestEventNs); in TEST()
95 std::thread reader([&queue, timeBaseNs] { in TEST()
98 auto event = queue.waitPop(); in TEST()
/frameworks/av/media/bufferpool/2.0/
DBufferStatus.cpp62 std::unique_ptr<BufferStatusQueue> queue = in open() local
64 if (!queue || queue->isValid() == false) { in open()
68 *fmqDescPtr = queue->getDesc(); in open()
71 std::make_pair(id, std::move(queue))); in open()
108 std::unique_ptr<BufferStatusQueue> queue = in BufferStatusChannel() local
110 if (!queue || queue->isValid() == false) { in BufferStatusChannel()
115 mBufferStatusQueue = std::move(queue); in BufferStatusChannel()
223 std::unique_ptr<BufferInvalidationQueue> queue = in BufferInvalidationListener() local
225 if (!queue || queue->isValid() == false) { in BufferInvalidationListener()
230 mBufferInvalidationQueue = std::move(queue); in BufferInvalidationListener()
/frameworks/av/media/bufferpool/1.0/
DBufferStatus.cpp49 std::unique_ptr<BufferStatusQueue> queue = in open() local
51 if (!queue || queue->isValid() == false) { in open()
55 *fmqDescPtr = queue->getDesc(); in open()
58 std::make_pair(id, std::move(queue))); in open()
95 std::unique_ptr<BufferStatusQueue> queue = in BufferStatusChannel() local
97 if (!queue || queue->isValid() == false) { in BufferStatusChannel()
102 mBufferStatusQueue = std::move(queue); in BufferStatusChannel()
/frameworks/base/tests/Camera2Tests/SmartCamera/SimpleCamera/src/androidx/media/filterfw/
DFrameQueue.java38 public void attachQueue(FrameQueue queue) { in attachQueue() argument
39 mAttachedQueues.add(queue); in attachQueue()
51 private void buildQueueImpl(FrameQueue queue) { in buildQueueImpl() argument
52 QueueImpl queueImpl = queue.new SingleFrameQueueImpl(); in buildQueueImpl()
53 queue.mQueueImpl = queueImpl; in buildQueueImpl()
58 for (FrameQueue queue : mAttachedQueues) { in buildType()
59 result = FrameType.merge(result, queue.mType); in buildType()
/frameworks/base/core/java/android/hardware/
DSystemSensorManager.java171 SensorEventQueue queue = mSensorListeners.get(listener); in registerListenerImpl() local
172 if (queue == null) { in registerListenerImpl()
178 queue = new SensorEventQueue(listener, looper, this, fullClassName); in registerListenerImpl()
179 if (!queue.addSensor(sensor, delayUs, maxBatchReportLatencyUs)) { in registerListenerImpl()
180 queue.dispose(); in registerListenerImpl()
183 mSensorListeners.put(listener, queue); in registerListenerImpl()
186 return queue.addSensor(sensor, delayUs, maxBatchReportLatencyUs); in registerListenerImpl()
200 SensorEventQueue queue = mSensorListeners.get(listener); in unregisterListenerImpl() local
201 if (queue != null) { in unregisterListenerImpl()
204 result = queue.removeAllSensors(); in unregisterListenerImpl()
[all …]
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/
DUserManagerServiceIdRecyclingTest.java97 LinkedHashSet<Integer> queue = new LinkedHashSet<>(); in testUserCreateRecycleIdsOverflow() local
101 assertTrue("Returned id should not be recent. Id=" + userId + ". Recents=" + queue, in testUserCreateRecycleIdsOverflow()
102 queue.add(userId)); in testUserCreateRecycleIdsOverflow()
103 if (queue.size() > UserManagerService.MAX_RECENTLY_REMOVED_IDS_SIZE) { in testUserCreateRecycleIdsOverflow()
104 queue.remove(queue.iterator().next()); in testUserCreateRecycleIdsOverflow()

123456789