From 6db4d15d726b8830ad56766352a79fe0417cb9c2 Mon Sep 17 00:00:00 2001 From: Bryce Lee Date: Wed, 31 May 2017 10:27:42 -0700 Subject: [PATCH] Handle not having main window in createThumbnailAppAnimator. A recent code change associated the SurfaceControl with the main window owner id. However, it is possible for the an AppWindowToken to not have a main window. This case is handled later in the method. This CL restores the original behavior of using the calling uid in the cases no main window is present. Change-Id: Iad69fe383c2208c1db523c8b4601a8f927f9318a Fixes: 62096254 Test: go/wm-smoke --- .../core/java/com/android/server/wm/WindowSurfacePlacer.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/WindowSurfacePlacer.java b/services/core/java/com/android/server/wm/WindowSurfacePlacer.java index 4a1a7052a8b0a..424b25ec4d9d5 100644 --- a/services/core/java/com/android/server/wm/WindowSurfacePlacer.java +++ b/services/core/java/com/android/server/wm/WindowSurfacePlacer.java @@ -694,7 +694,8 @@ class WindowSurfacePlacer { SurfaceControl surfaceControl = new SurfaceControl(mService.mFxSession, "thumbnail anim", dirty.width(), dirty.height(), PixelFormat.TRANSLUCENT, SurfaceControl.HIDDEN, - appToken.windowType, window.mOwnerUid); + appToken.windowType, + window != null ? window.mOwnerUid : Binder.getCallingUid()); surfaceControl.setLayerStack(display.getLayerStack()); if (SHOW_TRANSACTIONS) { Slog.i(TAG, " THUMBNAIL " + surfaceControl + ": CREATE");