FgThreadpublic final class FgThread extends ServiceThread Shared singleton foreground thread for the system. This is a thread for regular
foreground service operations, which shouldn't be blocked by anything running in
the background. In particular, the shared background thread could be doing
relatively long-running operations like saving state to disk (in addition to
simply being a background priority), which can cause operations scheduled on it
to be delayed for a user-noticeable amount of time. |
Fields Summary |
---|
private static FgThread | sInstance | private static android.os.Handler | sHandler |
Constructors Summary |
---|
private FgThread()
super("android.fg", android.os.Process.THREAD_PRIORITY_DEFAULT, true /*allowIo*/);
|
Methods Summary |
---|
private static void | ensureThreadLocked()
if (sInstance == null) {
sInstance = new FgThread();
sInstance.start();
sHandler = new Handler(sInstance.getLooper());
}
| public static com.android.server.FgThread | get()
synchronized (UiThread.class) {
ensureThreadLocked();
return sInstance;
}
| public static android.os.Handler | getHandler()
synchronized (UiThread.class) {
ensureThreadLocked();
return sHandler;
}
|
|