FileDocCategorySizeDatePackage
UiThread.javaAPI DocAndroid 5.1 API1678Thu Mar 12 22:22:42 GMT 2015com.android.server

UiThread

public final class UiThread extends ServiceThread
Shared singleton thread for showing UI. This is a foreground thread, and in additional should not have operations that can take more than a few ms scheduled on it to avoid UI jank.

Fields Summary
private static UiThread
sInstance
private static android.os.Handler
sHandler
Constructors Summary
private UiThread()

        super("android.ui", android.os.Process.THREAD_PRIORITY_FOREGROUND, false /*allowIo*/);
    
Methods Summary
private static voidensureThreadLocked()

        if (sInstance == null) {
            sInstance = new UiThread();
            sInstance.start();
            sHandler = new Handler(sInstance.getLooper());
        }
    
public static com.android.server.UiThreadget()

        synchronized (UiThread.class) {
            ensureThreadLocked();
            return sInstance;
        }
    
public static android.os.HandlergetHandler()

        synchronized (UiThread.class) {
            ensureThreadLocked();
            return sHandler;
        }