From 2728bf4bf9c4bc73837f41d3bf0251a7de6c9e16 Mon Sep 17 00:00:00 2001 From: Wale Ogunwale Date: Thu, 3 Mar 2016 11:03:26 -0800 Subject: [PATCH] Added more log points for add/remove in window manager. Bug: 27286867 Change-Id: Iecb522a1ff7e093a8feef27fdd68c50b9a80d553 --- .../core/java/com/android/server/wm/AppWindowToken.java | 3 ++- .../java/com/android/server/wm/WindowManagerService.java | 5 ++++- .../java/com/android/server/wm/WindowStateAnimator.java | 6 +++--- .../java/com/android/server/wm/WindowSurfaceController.java | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/services/core/java/com/android/server/wm/AppWindowToken.java b/services/core/java/com/android/server/wm/AppWindowToken.java index f9e258d35d8e7..ecfbc0a30256b 100644 --- a/services/core/java/com/android/server/wm/AppWindowToken.java +++ b/services/core/java/com/android/server/wm/AppWindowToken.java @@ -375,6 +375,7 @@ class AppWindowToken extends WindowToken { // The application has stopped, so destroy any surfaces which were keeping alive // in case they were still being used. void notifyAppStopped() { + if (DEBUG_ADD_REMOVE) Slog.v(TAG, "notifyAppStopped: " + this); mAppStopped = true; destroySurfaces(); @@ -472,7 +473,7 @@ class AppWindowToken extends WindowToken { winNdx = Math.min(winNdx - 1, allAppWindows.size() - 1)) { WindowState win = allAppWindows.get(winNdx); if (win.mAppDied) { - if (DEBUG_WINDOW_MOVEMENT) { + if (DEBUG_WINDOW_MOVEMENT || DEBUG_ADD_REMOVE) { Slog.w(TAG, "removeAllDeadWindows: " + win); } // Set mDestroying, we don't want any animation or delayed removal here. diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index fe215d523338d..7c2a8e3385579 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -2147,12 +2147,15 @@ public class WindowManagerService extends IWindowManager.Stub void removeWindowLocked(WindowState win) { win.mWindowRemovalAllowed = true; + if (DEBUG_ADD_REMOVE) Slog.v(TAG, + "removeWindowLocked: " + win + " callers=" + Debug.getCallers(4)); + final boolean startingWindow = win.mAttrs.type == TYPE_APPLICATION_STARTING; if (startingWindow) { if (DEBUG_STARTING_WINDOW) Slog.d(TAG_WM, "Starting window removed " + win); } - if (localLOGV || DEBUG_FOCUS || DEBUG_FOCUS_LIGHT && win==mCurrentFocus) Slog.v( + if (localLOGV || DEBUG_FOCUS || DEBUG_FOCUS_LIGHT && win == mCurrentFocus) Slog.v( TAG_WM, "Remove " + win + " client=" + Integer.toHexString(System.identityHashCode(win.mClient.asBinder())) + ", surfaceController=" + win.mWinAnimator.mSurfaceController + " Callers=" diff --git a/services/core/java/com/android/server/wm/WindowStateAnimator.java b/services/core/java/com/android/server/wm/WindowStateAnimator.java index 02f9aa13c9393..8135c8e727df2 100644 --- a/services/core/java/com/android/server/wm/WindowStateAnimator.java +++ b/services/core/java/com/android/server/wm/WindowStateAnimator.java @@ -20,6 +20,7 @@ import static android.view.Display.DEFAULT_DISPLAY; import static android.view.WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED; import static android.view.WindowManager.LayoutParams.FLAG_SCALED; import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING; +import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ADD_REMOVE; import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ANIM; import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_LAYERS; import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_LAYOUT_REPEATS; @@ -467,9 +468,8 @@ class WindowStateAnimator { return; } - if (WindowManagerService.localLOGV) Slog.v( - TAG, "Exit animation finished in " + this - + ": remove=" + mWin.mRemoveOnExit); + if (WindowManagerService.localLOGV || DEBUG_ADD_REMOVE) Slog.v(TAG, + "Exit animation finished in " + this + ": remove=" + mWin.mRemoveOnExit); mWin.mDestroying = true; diff --git a/services/core/java/com/android/server/wm/WindowSurfaceController.java b/services/core/java/com/android/server/wm/WindowSurfaceController.java index 2cdf471c1420a..fb07512f16e29 100644 --- a/services/core/java/com/android/server/wm/WindowSurfaceController.java +++ b/services/core/java/com/android/server/wm/WindowSurfaceController.java @@ -138,7 +138,7 @@ class WindowSurfaceController { void destroyInTransaction() { // if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) { - Slog.i(TAG, "Destroying surface " + this + " called by " + Debug.getCallers(4)); + Slog.i(TAG, "Destroying surface " + this + " called by " + Debug.getCallers(8)); // } try { if (mSurfaceControl != null) {