Search in sources :

Example 1 with MessageQueue

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();
}
Also used : MessageQueue(android.os.MessageQueue) Handler(android.os.Handler)

Example 2 with MessageQueue

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();
}
Also used : MessageQueue(android.os.MessageQueue) Handler(android.os.Handler)

Example 3 with MessageQueue

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;
}
Also used : MessageQueue(android.os.MessageQueue)

Example 4 with MessageQueue

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();
}
Also used : MessageQueue(android.os.MessageQueue) Handler(android.os.Handler)

Example 5 with MessageQueue

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();
}
Also used : MessageQueue(android.os.MessageQueue) Handler(android.os.Handler)

Aggregations

MessageQueue (android.os.MessageQueue)15 Handler (android.os.Handler)8 Message (android.os.Message)3 Looper (android.os.Looper)2 ProgressDialog (android.app.ProgressDialog)1 DialogInterface (android.content.DialogInterface)1 Suppress (android.test.suitebuilder.annotation.Suppress)1 View (android.view.View)1 ImageView (android.widget.ImageView)1 DatabaseHelper (com.vodafone360.people.database.DatabaseHelper)1 IEngineEventCallback (com.vodafone360.people.engine.IEngineEventCallback)1 IContactSyncCallback (com.vodafone360.people.engine.contactsync.IContactSyncCallback)1 ProcessorFactory (com.vodafone360.people.engine.contactsync.ProcessorFactory)1 ServiceUiRequest (com.vodafone360.people.service.ServiceUiRequest)1 DownloadCallback (huyifei.mymvp.architecture.common.DownloadCallback)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 ExecutionException (java.util.concurrent.ExecutionException)1 FutureTask (java.util.concurrent.FutureTask)1