use of android.os.MessageQueue in project android_frameworks_base by ResurrectionRemix.
the class RequestHandlerThread method waitUntilIdle.
// Blocks until thread is idling
public void waitUntilIdle() {
Handler handler = waitAndGetHandler();
MessageQueue queue = handler.getLooper().getQueue();
if (queue.isIdle()) {
return;
}
mIdle.close();
queue.addIdleHandler(mIdleHandler);
// Ensure that the idle handler gets run even if the looper already went idle
handler.sendEmptyMessage(MSG_POKE_IDLE_HANDLER);
if (queue.isIdle()) {
return;
}
mIdle.block();
}
use of android.os.MessageQueue in project android_frameworks_base by DirtyUnicorns.
the class RequestHandlerThread method waitUntilIdle.
// Blocks until thread is idling
public void waitUntilIdle() {
Handler handler = waitAndGetHandler();
MessageQueue queue = handler.getLooper().getQueue();
if (queue.isIdle()) {
return;
}
mIdle.close();
queue.addIdleHandler(mIdleHandler);
// Ensure that the idle handler gets run even if the looper already went idle
handler.sendEmptyMessage(MSG_POKE_IDLE_HANDLER);
if (queue.isIdle()) {
return;
}
mIdle.block();
}
use of android.os.MessageQueue in project glide by bumptech.
the class Engine method getReferenceQueue.
private ReferenceQueue<EngineResource<?>> getReferenceQueue() {
if (resourceReferenceQueue == null) {
resourceReferenceQueue = new ReferenceQueue<>();
MessageQueue queue = Looper.myQueue();
queue.addIdleHandler(new RefQueueIdleHandler(activeResources, resourceReferenceQueue));
}
return resourceReferenceQueue;
}
use of android.os.MessageQueue in project platform_frameworks_base by android.
the class RequestHandlerThread method waitUntilIdle.
// Blocks until thread is idling
public void waitUntilIdle() {
Handler handler = waitAndGetHandler();
MessageQueue queue = handler.getLooper().getQueue();
if (queue.isIdle()) {
return;
}
mIdle.close();
queue.addIdleHandler(mIdleHandler);
// Ensure that the idle handler gets run even if the looper already went idle
handler.sendEmptyMessage(MSG_POKE_IDLE_HANDLER);
if (queue.isIdle()) {
return;
}
mIdle.block();
}
use of android.os.MessageQueue in project android_frameworks_base by crdroidandroid.
the class RequestHandlerThread method waitUntilIdle.
// Blocks until thread is idling
public void waitUntilIdle() {
Handler handler = waitAndGetHandler();
MessageQueue queue = handler.getLooper().getQueue();
if (queue.isIdle()) {
return;
}
mIdle.close();
queue.addIdleHandler(mIdleHandler);
// Ensure that the idle handler gets run even if the looper already went idle
handler.sendEmptyMessage(MSG_POKE_IDLE_HANDLER);
if (queue.isIdle()) {
return;
}
mIdle.block();
}
Aggregations