From 4136d2d54b986a09b237aee30974d3c00d308338 Mon Sep 17 00:00:00 2001 From: Keun-young Park Date: Mon, 8 May 2017 14:51:59 -0700 Subject: Wait for keyguard draw before stopping boot animation - Add check for keyguard drawn before stopping boot animation. Otherwise blank screen can happen. - Bind to keyguard service when sysui is launched to reduce waiting time later. - Increase keyguard timeout to 5 secs if it is not boot completed. Otherwise (= normal screen on), keep the current 1 sec. This timeout can still lead into blank screen so use bigger timeout during boot-up to prevent such case. bug: 37867510 Test: many reboots Change-Id: Ibfdc42d295bb1d3f5b4ea316fe5aca9ab875e4be --- services/java/com/android/server/SystemServer.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'services/java/com') diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index 0965f03c27e9..b620b3e0e6e9 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -1644,6 +1644,7 @@ public final class SystemServer { final MediaRouterService mediaRouterF = mediaRouter; final MmsServiceBroker mmsServiceF = mmsService; final IpSecService ipSecServiceF = ipSecService; + final WindowManagerService windowManagerF = wm; // We now tell the activity manager it is okay to run third party // code. It will call back into us once it has gotten to the state @@ -1683,7 +1684,7 @@ public final class SystemServer { traceBeginAndSlog("StartSystemUI"); try { - startSystemUi(context); + startSystemUi(context, windowManagerF); } catch (Throwable e) { reportWtf("starting System UI", e); } @@ -1837,13 +1838,14 @@ public final class SystemServer { }, BOOT_TIMINGS_TRACE_LOG); } - static final void startSystemUi(Context context) { + static final void startSystemUi(Context context, WindowManagerService windowManager) { Intent intent = new Intent(); intent.setComponent(new ComponentName("com.android.systemui", "com.android.systemui.SystemUIService")); intent.addFlags(Intent.FLAG_DEBUG_TRIAGED_MISSING); //Slog.d(TAG, "Starting service: " + intent); context.startServiceAsUser(intent, UserHandle.SYSTEM); + windowManager.onSystemUiStarted(); } private static void traceBeginAndSlog(String name) { -- cgit v1.2.3-59-g8ed1b