private static void ensureThreadLocked() { if (sInstance == null) { sInstance = new BackgroundThread(); sInstance.start(); sInstance.getLooper().setTraceTag(Trace.TRACE_TAG_ACTIVITY_MANAGER); sHandler = new Handler(sInstance.getLooper()); } }