From f4b61d9dd4767ccedc47086faf9150ea24bb3f40 Mon Sep 17 00:00:00 2001 From: Geoffrey Pitsch Date: Thu, 3 Aug 2017 14:10:15 -0400 Subject: [PATCH] Set property that terminates boot anim in WMS instead of SF This delays setting the color mode in the SurfaceFlinger until the animation is fully finished. Bug: 63823274 Test: Manual Change-Id: I0bfcaeb05ad37efd50f4f9f7041d2a13f798cc85 --- .../server/wm/WindowManagerService.java | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index b0775dd3a8592..52d3d95a8610e 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -3471,21 +3471,11 @@ public class WindowManagerService extends IWindowManager.Stub } if (!mBootAnimationStopped) { - // Do this one time. Trace.asyncTraceBegin(TRACE_TAG_WINDOW_MANAGER, "Stop bootanim", 0); - try { - IBinder surfaceFlinger = ServiceManager.getService("SurfaceFlinger"); - if (surfaceFlinger != null) { - Slog.i(TAG_WM, "******* TELLING SURFACE FLINGER WE ARE BOOTED!"); - Parcel data = Parcel.obtain(); - data.writeInterfaceToken("android.ui.ISurfaceComposer"); - surfaceFlinger.transact(IBinder.FIRST_CALL_TRANSACTION, // BOOT_FINISHED - data, null, 0); - data.recycle(); - } - } catch (RemoteException ex) { - Slog.e(TAG_WM, "Boot completed: SurfaceFlinger is dead!"); - } + // stop boot animation + // formerly we would just kill the process, but we now ask it to exit so it + // can choose where to stop the animation. + SystemProperties.set("service.bootanim.exit", "1"); mBootAnimationStopped = true; } @@ -3494,6 +3484,20 @@ public class WindowManagerService extends IWindowManager.Stub return; } + try { + IBinder surfaceFlinger = ServiceManager.getService("SurfaceFlinger"); + if (surfaceFlinger != null) { + Slog.i(TAG_WM, "******* TELLING SURFACE FLINGER WE ARE BOOTED!"); + Parcel data = Parcel.obtain(); + data.writeInterfaceToken("android.ui.ISurfaceComposer"); + surfaceFlinger.transact(IBinder.FIRST_CALL_TRANSACTION, // BOOT_FINISHED + data, null, 0); + data.recycle(); + } + } catch (RemoteException ex) { + Slog.e(TAG_WM, "Boot completed: SurfaceFlinger is dead!"); + } + EventLog.writeEvent(EventLogTags.WM_BOOT_ANIMATION_DONE, SystemClock.uptimeMillis()); Trace.asyncTraceEnd(TRACE_TAG_WINDOW_MANAGER, "Stop bootanim", 0); mDisplayEnabled = true;