Home
last modified time | relevance | path

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

12345678910

/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.cpp120 std::vector<NotifyArgsType>& queue = std::get<std::vector<NotifyArgsType>>(mQueues); in assertCalled() local
121 if (queue.empty()) { in assertCalled()
124 [&queue]() REQUIRES(mLock) { return !queue.empty(); }); in assertCalled()
130 *outEventArgs = *queue.begin(); in assertCalled()
132 queue.erase(queue.begin()); in assertCalled()
140 std::vector<NotifyArgsType>& queue = std::get<std::vector<NotifyArgsType>>(mQueues); in assertNotCalled() local
143 [&queue]() REQUIRES(mLock) { return !queue.empty(); }); in assertNotCalled()
153 std::vector<NotifyArgsType>& queue = std::get<std::vector<NotifyArgsType>>(mQueues); in notify() local
154 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.cpp43 mContext = mRenderThread.queue().runSync([=, this]() -> CanvasContext* { in RenderProxy()
47 mRenderThread.queue().post( in RenderProxy()
64 mRenderThread.queue().runSync([this]() { delete mContext; }); in destroyContext()
70 mRenderThread.queue().post([this, swapBehavior]() { mContext->setSwapBehavior(swapBehavior); }); in setSwapBehavior()
74 return mRenderThread.queue().runSync([this]() -> bool { in loadSystemProperties()
86 mRenderThread.queue().runSync([this, name]() { mContext->setName(std::string(name)); }); in setName()
91 mRenderThread.queue().post([this, win = window, enableTimeout]() mutable { in setSurface()
102 mRenderThread.queue().post([this, control = surfaceControl, funcs]() mutable { in setSurfaceControl()
111 mRenderThread.queue().post([=]() { mContext->allocateBuffers(); }); in allocateBuffers()
115 return mRenderThread.queue().runSync([this]() -> bool { return mContext->pauseSurface(); }); in pause()
[all …]
/frameworks/av/media/libstagefright/rtsp/
DAHEVCAssembler.cpp67 List<sp<ABuffer>> *queue = source->queue(); in addNack() local
70 List<sp<ABuffer> >::iterator it = queue->begin(); in addNack()
72 if (it == queue->end()) { in addNack()
79 for (; it != queue->end(); ++it) { in addNack()
88 while (it != queue->end()) { in addNack()
91 if ((++it) == queue->end()) { in addNack()
127 List<sp<ABuffer> > *queue = source->queue(); in addNALUnit() local
130 if (queue->empty()) { in addNALUnit()
134 sp<ABuffer> buffer = *queue->begin(); in addNALUnit()
189 showCurrentQueue(queue); in addNALUnit()
[all …]
DAAVCAssembler.cpp58 List<sp<ABuffer>> *queue = source->queue(); in addNack() local
61 List<sp<ABuffer> >::iterator it = queue->begin(); in addNack()
63 if (it == queue->end()) { in addNack()
70 for (; it != queue->end(); ++it) { in addNack()
79 while (it != queue->end()) { in addNack()
82 if ((++it) == queue->end()) { in addNack()
117 List<sp<ABuffer> > *queue = source->queue(); in addNALUnit() local
120 if (queue->empty()) { in addNALUnit()
124 sp<ABuffer> buffer = *queue->begin(); in addNALUnit()
179 showCurrentQueue(queue); in addNALUnit()
[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()
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 …]
DAAMRAssembler.cpp102 List<sp<ABuffer> > *queue = source->queue(); in addPacket() local
104 if (queue->empty()) { in addPacket()
109 List<sp<ABuffer> >::iterator it = queue->begin(); in addPacket()
110 while (it != queue->end()) { in addPacket()
115 it = queue->erase(it); in addPacket()
118 if (queue->empty()) { in addPacket()
123 sp<ABuffer> buffer = *queue->begin(); in addPacket()
137 queue->erase(queue->begin()); in addPacket()
154 queue->erase(queue->begin()); in addPacket()
168 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/base/core/jni/
Dandroid_graphics_BLASTBufferQueue.cpp89 sp<BLASTBufferQueue> queue = new BLASTBufferQueue(name.c_str(), updateDestinationFrame); in nativeCreate() local
90 queue->incStrong((void*)nativeCreate); in nativeCreate()
91 return reinterpret_cast<jlong>(queue.get()); in nativeCreate()
95 sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr); in nativeDestroy() local
96 queue->decStrong((void*)nativeCreate); in nativeDestroy()
101 sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr); in nativeGetSurface() local
103 queue->getSurface(includeSurfaceControlHandle)); in nativeGetSurface()
128 sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr); in nativeSyncNextTransaction() local
132 queue->syncNextTransaction(nullptr, acquireSingleBuffer); in nativeSyncNextTransaction()
136 queue->syncNextTransaction( in nativeSyncNextTransaction()
[all …]
Dandroid_view_InputQueue.cpp205 sp<InputQueue> queue = InputQueue::createQueue(queueWeak, messageQueue->getLooper()); in nativeInit() local
206 if (!queue.get()) { in nativeInit()
210 queue->incStrong(&gInputQueueClassInfo); in nativeInit()
211 return reinterpret_cast<jlong>(queue.get()); in nativeInit()
215 sp<InputQueue> queue = reinterpret_cast<InputQueue*>(ptr); in nativeDispose() local
216 queue->detachLooper(); in nativeDispose()
217 queue->decStrong(&gInputQueueClassInfo); in nativeDispose()
222 InputQueue* queue = reinterpret_cast<InputQueue*>(ptr); in nativeSendKeyEvent() local
223 KeyEvent* event = queue->createKeyEvent(); in nativeSendKeyEvent()
226 queue->recycleInputEvent(event); in nativeSendKeyEvent()
[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/native/android/
Dsensor.cpp58 if (queue == nullptr) { \
123 sp<SensorEventQueue> queue = in ASensorManager_createEventQueue() local
125 if (queue != 0) { in ASensorManager_createEventQueue()
126 ALooper_addFd(looper, queue->getFd(), ident, ALOOPER_EVENT_INPUT, callback, data); in ASensorManager_createEventQueue()
127 queue->looper = looper; in ASensorManager_createEventQueue()
128 queue->requestAdditionalInfo = false; in ASensorManager_createEventQueue()
129 queue->incStrong(manager); in ASensorManager_createEventQueue()
131 return static_cast<ASensorEventQueue*>(queue.get()); in ASensorManager_createEventQueue()
134 int ASensorManager_destroyEventQueue(ASensorManager* manager, ASensorEventQueue* queue) { in ASensorManager_destroyEventQueue() argument
138 sp<SensorEventQueue> q = static_cast<SensorEventQueue*>(queue); in ASensorManager_destroyEventQueue()
[all …]
/frameworks/base/apct-tests/perftests/core/src/android/libcore/
DReferencePerfTest.java44 ReferenceQueue<Object> queue = new ReferenceQueue<Object>(); in timeAlloc() local
47 new PhantomReference(mObject, queue); in timeAlloc()
54 ReferenceQueue<Object> queue = new ReferenceQueue<Object>(); in timeAllocAndEnqueue() local
57 (new PhantomReference<Object>(mObject, queue)).enqueue(); in timeAllocAndEnqueue()
64 ReferenceQueue<Object> queue = new ReferenceQueue<Object>(); in timeAllocEnqueueAndPoll() local
67 (new PhantomReference<Object>(mObject, queue)).enqueue(); in timeAllocEnqueueAndPoll()
68 queue.poll(); in timeAllocEnqueueAndPoll()
75 ReferenceQueue<Object> queue = new ReferenceQueue<Object>(); in timeAllocEnqueueAndRemove() local
78 (new PhantomReference<Object>(mObject, queue)).enqueue(); in timeAllocEnqueueAndRemove()
80 queue.remove(); in timeAllocEnqueueAndRemove()
/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/codec2/components/base/
DSimpleC2Component.cpp625 Mutexed<WorkQueue>::Locked queue(mWorkQueue); in queue_nb() local
626 queueWasEmpty = queue->empty(); in queue_nb()
628 queue->push_back(std::move(items->front())); in queue_nb()
653 Mutexed<WorkQueue>::Locked queue(mWorkQueue); in flush_sm() local
654 queue->incGeneration(); in flush_sm()
656 while (!queue->empty()) { in flush_sm()
657 std::unique_ptr<C2Work> work = queue->pop_front(); in flush_sm()
662 while (!queue->pending().empty()) { in flush_sm()
663 flushedWork->push_back(std::move(queue->pending().begin()->second)); in flush_sm()
664 queue->pending().erase(queue->pending().begin()); in flush_sm()
[all …]
/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/services/tests/servicestests/src/com/android/server/pm/
DUserManagerServiceIdRecyclingTest.java98 LinkedHashSet<Integer> queue = new LinkedHashSet<>(); in testUserCreateRecycleIdsOverflow() local
102 assertTrue("Returned id should not be recent. Id=" + userId + ". Recents=" + queue, in testUserCreateRecycleIdsOverflow()
103 queue.add(userId)); in testUserCreateRecycleIdsOverflow()
104 if (queue.size() > UserManagerService.MAX_RECENTLY_REMOVED_IDS_SIZE) { in testUserCreateRecycleIdsOverflow()
105 queue.remove(queue.iterator().next()); in testUserCreateRecycleIdsOverflow()
/frameworks/base/core/java/android/hardware/
DSystemSensorManager.java196 SensorEventQueue queue = mSensorListeners.get(listener); in registerListenerImpl() local
197 if (queue == null) { in registerListenerImpl()
203 queue = new SensorEventQueue(listener, looper, this, fullClassName); in registerListenerImpl()
204 if (!queue.addSensor(sensor, delayUs, maxBatchReportLatencyUs)) { in registerListenerImpl()
205 queue.dispose(); in registerListenerImpl()
208 mSensorListeners.put(listener, queue); in registerListenerImpl()
211 return queue.addSensor(sensor, delayUs, maxBatchReportLatencyUs); in registerListenerImpl()
225 SensorEventQueue queue = mSensorListeners.get(listener); in unregisterListenerImpl() local
226 if (queue != null) { in unregisterListenerImpl()
229 result = queue.removeAllSensors(); in unregisterListenerImpl()
[all …]

12345678910