summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/etc/services.core.protolog.json2154
-rw-r--r--services/core/java/com/android/server/wm/ActivityDisplay.java12
-rw-r--r--services/core/java/com/android/server/wm/ActivityRecord.java38
-rw-r--r--services/core/java/com/android/server/wm/AppTransition.java151
-rw-r--r--services/core/java/com/android/server/wm/AppTransitionController.java74
-rw-r--r--services/core/java/com/android/server/wm/AppWindowThumbnail.java8
-rw-r--r--services/core/java/com/android/server/wm/AppWindowToken.java260
-rw-r--r--services/core/java/com/android/server/wm/BlackFrame.java13
-rw-r--r--services/core/java/com/android/server/wm/DisplayContent.java103
-rw-r--r--services/core/java/com/android/server/wm/DisplayPolicy.java17
-rw-r--r--services/core/java/com/android/server/wm/DisplayRotation.java64
-rw-r--r--services/core/java/com/android/server/wm/DragState.java20
-rw-r--r--services/core/java/com/android/server/wm/InputMonitor.java7
-rw-r--r--services/core/java/com/android/server/wm/ProtoLogGroup.java41
-rw-r--r--services/core/java/com/android/server/wm/RecentsAnimation.java66
-rw-r--r--services/core/java/com/android/server/wm/RecentsAnimationController.java58
-rw-r--r--services/core/java/com/android/server/wm/RemoteAnimationController.java58
-rw-r--r--services/core/java/com/android/server/wm/RootWindowContainer.java59
-rw-r--r--services/core/java/com/android/server/wm/ScreenRotationAnimation.java18
-rw-r--r--services/core/java/com/android/server/wm/Session.java8
-rw-r--r--services/core/java/com/android/server/wm/TaskPositioner.java11
-rw-r--r--services/core/java/com/android/server/wm/TaskScreenshotAnimatable.java12
-rw-r--r--services/core/java/com/android/server/wm/TaskSnapshotSurface.java15
-rw-r--r--services/core/java/com/android/server/wm/WallpaperAnimationAdapter.java18
-rw-r--r--services/core/java/com/android/server/wm/WallpaperController.java14
-rw-r--r--services/core/java/com/android/server/wm/WindowAnimator.java7
-rw-r--r--services/core/java/com/android/server/wm/WindowManagerDebugConfig.java25
-rw-r--r--services/core/java/com/android/server/wm/WindowManagerService.java525
-rw-r--r--services/core/java/com/android/server/wm/WindowState.java145
-rw-r--r--services/core/java/com/android/server/wm/WindowStateAnimator.java86
-rw-r--r--services/core/java/com/android/server/wm/WindowSurfaceController.java56
-rw-r--r--services/core/java/com/android/server/wm/WindowToken.java19
32 files changed, 1028 insertions, 3134 deletions
diff --git a/data/etc/services.core.protolog.json b/data/etc/services.core.protolog.json
index a2402e25c556..2dfb777592fd 100644
--- a/data/etc/services.core.protolog.json
+++ b/data/etc/services.core.protolog.json
@@ -1,2170 +1,16 @@
{
"version": "1.0.0",
"messages": {
- "-2146181682": {
- "message": "Releasing screen wakelock, obscured by %s",
- "level": "DEBUG",
- "group": "WM_DEBUG_KEEP_SCREEN_ON",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-2138637148": {
- "message": "Clearing focused app, displayId=%d",
- "level": "VERBOSE",
- "group": "WM_DEBUG_FOCUS_LIGHT",
- "at": "com\/android\/server\/wm\/ActivityDisplay.java"
- },
- "-2109864870": {
- "message": "app-release(): mOuter=%s",
- "level": "DEBUG",
- "group": "WM_DEBUG_REMOTE_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RemoteAnimationController.java"
- },
- "-2086729999": {
- "message": "Removing app token: %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_APP_TRANSITIONS",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "-2072089308": {
- "message": "Attempted to add window with token that is a sub-window: %s. Aborting.",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-2039580386": {
- "message": "Attempted to add input method window with unknown token %s. Aborting.",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-2024464438": {
- "message": "app-onAnimationFinished(): mOuter=%s",
- "level": "DEBUG",
- "group": "WM_DEBUG_REMOTE_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RemoteAnimationController.java"
- },
- "-2012562539": {
- "message": "startAnimation(): Notify animation start:",
- "level": "DEBUG",
- "group": "WM_DEBUG_REMOTE_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RemoteAnimationController.java"
- },
- "-2002500255": {
- "message": "Defer removing snapshot surface in %dms",
- "level": "VERBOSE",
- "group": "WM_DEBUG_STARTING_WINDOW",
- "at": "com\/android\/server\/wm\/TaskSnapshotSurface.java"
- },
- "-1991255017": {
- "message": "Drawing snapshot surface sizeMismatch=%b",
- "level": "VERBOSE",
- "group": "WM_DEBUG_STARTING_WINDOW",
- "at": "com\/android\/server\/wm\/TaskSnapshotSurface.java"
- },
- "-1976930686": {
- "message": "Attempted to add Accessibility overlay window with bad token %s. Aborting.",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-1963461591": {
- "message": "Removing %s from %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ADD_REMOVE",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-1958209312": {
- "message": "Clear freezing of %s: hidden=%b freezing=%b",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/ActivityRecord.java"
- },
- "-1953668890": {
- "message": "Can't start recents animation, nextAppTransition=%s",
- "level": "DEBUG",
- "group": "WM_DEBUG_RECENTS_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RecentsAnimation.java"
- },
- "-1949279037": {
- "message": "Attempted to add input method window with bad token %s. Aborting.",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-1939358269": {
- "message": "mRecentScreenshotAnimator finish",
- "level": "DEBUG",
- "group": "WM_DEBUG_RECENTS_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RecentsAnimationController.java"
- },
- "-1938839202": {
- "message": "SURFACE LEAK DESTROY: %s",
- "level": "INFO",
- "group": "WM_SHOW_TRANSACTIONS",
- "at": "com\/android\/server\/wm\/DisplayContent.java"
- },
- "-1915280162": {
- "message": "Attempted to add wallpaper window with bad token %s. Aborting.",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-1886298021": {
- "message": "setAppStartingWindow: token=%s pkg=%s transferFrom=%s newTask=%b taskSwitch=%b processRunning=%b allowTaskSnapshot=%b",
- "level": "VERBOSE",
- "group": "WM_DEBUG_STARTING_WINDOW",
- "at": "com\/android\/server\/wm\/ActivityRecord.java"
- },
- "-1884933373": {
- "message": "enableScreenAfterBoot: mDisplayEnabled=%b mForceDisplayEnabled=%b mShowingBootMessages=%b mSystemBooted=%b. %s",
- "level": "INFO",
- "group": "WM_DEBUG_BOOT",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-1872288685": {
- "message": "applyAnimation: anim=%s nextAppTransition=%s transit=%s isEntrance=%b Callers=%s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_APP_TRANSITIONS_ANIM",
- "at": "com\/android\/server\/wm\/AppTransition.java"
- },
- "-1868124841": {
- "message": "screenOnEarly=%b, awake=%b, currentAppOrientation=%d, orientationSensorEnabled=%b, keyguardDrawComplete=%b, windowManagerDrawComplete=%b",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/DisplayRotation.java"
- },
- "-1862269827": {
- "message": "applyAnimation: anim=%s transit=%s isEntrance=%b Callers=%s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_APP_TRANSITIONS_ANIM",
- "at": "com\/android\/server\/wm\/AppTransition.java"
- },
- "-1838803135": {
- "message": "Attempted to set windowing mode to a display that does not exist: %d",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-1836092044": {
- "message": "Creating SnapshotStartingData",
- "level": "VERBOSE",
- "group": "WM_DEBUG_STARTING_WINDOW",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "-1824578273": {
- "message": "Reporting new frame to %s: %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_RESIZE",
- "at": "com\/android\/server\/wm\/WindowState.java"
- },
- "-1822611824": {
- "message": "\tRemove token=%s",
- "level": "DEBUG",
- "group": "WM_DEBUG_REMOTE_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RemoteAnimationController.java"
- },
- "-1797409732": {
- "message": "Skipping %s because %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_FOCUS",
- "at": "com\/android\/server\/wm\/DisplayContent.java"
- },
- "-1770075711": {
- "message": "Adding window client %s that is dead, aborting.",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-1768557332": {
- "message": "removeWallpaperAnimation()",
- "level": "DEBUG",
- "group": "WM_DEBUG_RECENTS_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RecentsAnimationController.java"
- },
- "-1750206390": {
- "message": "Exception thrown when creating surface for client %s (%s). %s",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-1747461042": {
- "message": "set mOrientationChanging of %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/WindowState.java"
- },
- "-1741065110": {
- "message": "No app is requesting an orientation, return %d for display id=%d",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/DisplayContent.java"
- },
- "-1736245181": {
- "message": "Tried to remove starting window but startingWindow was null: %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_STARTING_WINDOW",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "-1730156332": {
- "message": "Display id=%d rotation changed to %d from %d, lastOrientation=%d",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/DisplayRotation.java"
- },
- "-1710206702": {
- "message": "Display id=%d is frozen while keyguard locked, return %d",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/DisplayContent.java"
- },
- "-1661704580": {
- "message": "Attempted to set replacing window on non-existing app token %s",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-1661404819": {
- "message": "applyAnimation: atoken=%s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_APP_TRANSITIONS_ANIM",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "-1632122349": {
- "message": "Changing surface while display frozen: %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-1597650595": {
- "message": "removeAppToken: %s delayed=%b Callers=%s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ADD_REMOVE",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "-1596995693": {
- "message": "startAnimation",
- "level": "DEBUG",
- "group": "WM_DEBUG_REMOTE_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RemoteAnimationController.java"
- },
- "-1587841219": {
- "message": "Focus moving from %s to %s displayId=%d",
- "level": "INFO",
- "group": "WM_DEBUG_FOCUS_LIGHT",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-1568331821": {
- "message": "Enabling listeners",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/DisplayRotation.java"
- },
- "-1561845439": {
- "message": "reParentWindowToken: removing window token=%s from task=%s",
- "level": "INFO",
- "group": "WM_DEBUG_ADD_REMOVE",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "-1545962566": {
- "message": "View server did not start",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-1526645239": {
- "message": "Timeout waiting for drawn: undrawn=%s",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-1524305318": {
- "message": "Nulling last startingData",
- "level": "VERBOSE",
- "group": "WM_DEBUG_STARTING_WINDOW",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "-1519226370": {
- "message": "startingData was nulled out before handling mAddStartingWindow: %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_STARTING_WINDOW",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "-1515151503": {
- "message": ">>> OPEN TRANSACTION removeReplacedWindows",
- "level": "INFO",
- "group": "WM_SHOW_TRANSACTIONS",
- "at": "com\/android\/server\/wm\/RootWindowContainer.java"
- },
- "-1497837552": {
- "message": "onAnimationFinished(): mPendingAnimations=%d",
- "level": "DEBUG",
- "group": "WM_DEBUG_REMOTE_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RemoteAnimationController.java"
- },
- "-1483752006": {
- "message": " THUMBNAIL %s: CREATE",
- "level": "INFO",
- "group": "WM_SHOW_TRANSACTIONS",
- "at": "com\/android\/server\/wm\/AppWindowThumbnail.java"
- },
- "-1470632028": {
- "message": "Marking app token %s with replacing windows.",
- "level": "DEBUG",
- "group": "WM_DEBUG_ADD_REMOVE",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "-1455600136": {
- "message": "Attempted to add Dream window with unknown token %s. Aborting.",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-1448427933": {
- "message": "startingWindow was set but startingSurface==null, couldn't remove",
- "level": "VERBOSE",
- "group": "WM_DEBUG_STARTING_WINDOW",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "-1443029505": {
- "message": "SAFE MODE ENABLED (menu=%d s=%d dpad=%d trackball=%d)",
- "level": "INFO",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-1434147454": {
- "message": "cleanupAnimation(): Notify animation finished mPendingAnimations=%d reorderMode=%d",
- "level": "DEBUG",
- "group": "WM_DEBUG_RECENTS_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RecentsAnimationController.java"
- },
- "-1427184084": {
- "message": "addWindow: New client %s: window=%s Callers=%s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ADD_REMOVE",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-1413901262": {
- "message": "startRecentsActivity(): intent=%s",
- "level": "DEBUG",
- "group": "WM_DEBUG_RECENTS_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RecentsAnimation.java"
- },
- "-1391944764": {
- "message": "SURFACE DESTROY: %s. %s",
- "level": "INFO",
- "group": "WM_SHOW_SURFACE_ALLOC",
- "at": "com\/android\/server\/wm\/WindowStateAnimator.java"
- },
- "-1389772804": {
- "message": "Attempted to add voice interaction window with bad token %s. Aborting.",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-1350198040": {
- "message": "hideBootMessagesLocked: mDisplayEnabled=%b mForceDisplayEnabled=%b mShowingBootMessages=%b mSystemBooted=%b. %s",
- "level": "INFO",
- "group": "WM_DEBUG_BOOT",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-1318134223": {
- "message": "No longer Stopped: %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ADD_REMOVE",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "-1270731689": {
- "message": "Attempted to set replacing window on app token with no content %s",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-1270148832": {
- "message": "Resize start waiting for draw, mDrawState=DRAW_PENDING in %s, surfaceController %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_RESIZE",
- "at": "com\/android\/server\/wm\/WindowState.java"
- },
- "-1263554915": {
- "message": "Attempted to add Dream window with bad token %s. Aborting.",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-1259022216": {
- "message": "SURFACE HIDE ( %s ): %s",
- "level": "INFO",
- "group": "WM_SHOW_TRANSACTIONS",
- "at": "com\/android\/server\/wm\/WindowSurfaceController.java"
- },
- "-1257821162": {
- "message": "OUT SURFACE %s: copied",
- "level": "INFO",
- "group": "WM_SHOW_TRANSACTIONS",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-1219773477": {
- "message": "setInputConsumerEnabled(%s): mCanceled=%b",
- "level": "DEBUG",
- "group": "WM_DEBUG_RECENTS_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RecentsAnimationController.java"
- },
- "-1207757583": {
- "message": "startAnimation(): Notify animation start: %s",
- "level": "DEBUG",
- "group": "WM_DEBUG_RECENTS_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RecentsAnimationController.java"
- },
- "-1176488860": {
- "message": "SURFACE isSecure=%b: %s",
- "level": "INFO",
- "group": "WM_SHOW_TRANSACTIONS",
- "at": "com\/android\/server\/wm\/WindowSurfaceController.java"
- },
- "-1156118957": {
- "message": "Updated config=%s",
- "level": "DEBUG",
- "group": "WM_DEBUG_RECENTS_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RecentsAnimation.java"
- },
- "-1144293044": {
- "message": "SURFACE SET FREEZE LAYER: %s",
- "level": "INFO",
- "group": "WM_SHOW_TRANSACTIONS",
- "at": "com\/android\/server\/wm\/WindowStateAnimator.java"
- },
- "-1130891072": {
- "message": "Orientation continue waiting for draw in %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/WindowStateAnimator.java"
- },
- "-1130868271": {
- "message": "Resizing %s WITH DRAW PENDING",
- "level": "INFO",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/WindowState.java"
- },
- "-1117599386": {
- "message": "Deferring rotation, display is not enabled.",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/DisplayRotation.java"
- },
- "-1113134997": {
- "message": "Attempted to add application window with unknown token %s. Aborting.",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-1103716954": {
- "message": "Not removing %s due to exit animation",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ADD_REMOVE",
- "at": "com\/android\/server\/wm\/WindowState.java"
- },
- "-1103115659": {
- "message": "Performing post-rotate rotation",
- "level": "DEBUG",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/RootWindowContainer.java"
- },
- "-1099052739": {
- "message": "\tAdd token=%s",
- "level": "DEBUG",
- "group": "WM_DEBUG_REMOTE_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RemoteAnimationController.java"
- },
- "-1097148233": {
- "message": "commitVisibility: %s: hidden=%b hiddenRequested=%b",
- "level": "VERBOSE",
- "group": "WM_DEBUG_APP_TRANSITIONS",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "-1089874824": {
- "message": "SURFACE SHOW (performLayout): %s",
- "level": "INFO",
- "group": "WM_SHOW_TRANSACTIONS",
- "at": "com\/android\/server\/wm\/WindowSurfaceController.java"
- },
- "-1077196445": {
- "message": "Add starting %s: startingData=%s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_STARTING_WINDOW",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "-1076978367": {
- "message": "thawRotation: mRotation=%d",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-1060365734": {
- "message": "Attempted to add QS dialog window with bad token %s. Aborting.",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-1047945589": {
- "message": "Remove client=%x, surfaceController=%s Callers=%s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_FOCUS",
- "at": "com\/android\/server\/wm\/WindowState.java"
- },
- "-1044506655": {
- "message": "New transit away from wallpaper: %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_APP_TRANSITIONS",
- "at": "com\/android\/server\/wm\/AppTransitionController.java"
- },
- "-1042574499": {
- "message": "Attempted to add Accessibility overlay window with unknown token %s. Aborting.",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-1009117329": {
- "message": "isFetchingAppTransitionSpecs=true",
- "level": "VERBOSE",
- "group": "WM_DEBUG_APP_TRANSITIONS",
- "at": "com\/android\/server\/wm\/AppTransitionController.java"
- },
- "-1001633850": {
- "message": "Removing focused app token:%s displayId=%d",
- "level": "VERBOSE",
- "group": "WM_DEBUG_FOCUS_LIGHT",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "-993378225": {
- "message": "finishDrawingLocked: mDrawState=COMMIT_DRAW_PENDING %s in %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_DRAW",
- "at": "com\/android\/server\/wm\/WindowStateAnimator.java"
- },
- "-986746907": {
- "message": "Starting window removed %s",
- "level": "DEBUG",
- "group": "WM_DEBUG_STARTING_WINDOW",
- "at": "com\/android\/server\/wm\/WindowState.java"
- },
- "-979259577": {
- "message": "setAppVisibility(%s, visible=%b): %s hidden=%b hiddenRequested=%b Callers=%s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_APP_TRANSITIONS",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "-955458843": {
- "message": "Set freezing of %s: hidden=%b freezing=%b hiddenRequested=%b. %s",
- "level": "INFO",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "-953872371": {
- "message": "setClientHidden: %s clientHidden=%b Callers=%s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_APP_TRANSITIONS",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "-928291778": {
- "message": "applyAnimation: anim=%s nextAppTransition=%d transit=%s Callers=%s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_APP_TRANSITIONS_ANIM",
- "at": "com\/android\/server\/wm\/AppTransition.java"
- },
- "-916108501": {
- "message": "Adding %s to %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ADD_REMOVE",
- "at": "com\/android\/server\/wm\/WindowState.java"
- },
- "-914253865": {
- "message": "Attempted to add voice interaction window with unknown token %s. Aborting.",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-883738232": {
- "message": "Adding more than one toast window for UID at a time.",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-874446906": {
- "message": "showBootMessage: msg=%s always=%b mAllowBootMessages=%b mShowingBootMessages=%b mSystemBooted=%b. %s",
- "level": "INFO",
- "group": "WM_DEBUG_BOOT",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-861859917": {
- "message": "Attempted to add window to a display that does not exist: %d. Aborting.",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-861707633": {
- "message": "Destroying surface %s called by %s",
- "level": "INFO",
- "group": "WM_SHOW_SURFACE_ALLOC",
- "at": "com\/android\/server\/wm\/WindowSurfaceController.java"
- },
- "-856025122": {
- "message": "SURFACE transparentRegionHint=%s: %s",
- "level": "INFO",
- "group": "WM_SHOW_TRANSACTIONS",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-853404763": {
- "message": "\twallpaper=%s",
- "level": "DEBUG",
- "group": "WM_DEBUG_REMOTE_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RemoteAnimationController.java"
- },
- "-853226675": {
- "message": "Attempted to add window with exiting application token .%s Aborting.",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-809771899": {
- "message": "findFocusedWindow: Reached focused app=%s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_FOCUS_LIGHT",
- "at": "com\/android\/server\/wm\/DisplayContent.java"
- },
- "-807062773": {
- "message": "Aborted starting %s: removed=%b startingData=%s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_STARTING_WINDOW",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "-793346159": {
- "message": "New transit into wallpaper: %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_APP_TRANSITIONS",
- "at": "com\/android\/server\/wm\/AppTransitionController.java"
- },
- "-784959154": {
- "message": "Attempted to add private presentation window to a non-private display. Aborting.",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-783405930": {
- "message": "Performing post-rotate rotation",
- "level": "DEBUG",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-771282525": {
- "message": "Losing focus: %s",
- "level": "INFO",
- "group": "WM_DEBUG_FOCUS_LIGHT",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-760801764": {
- "message": "onAnimationCancelled",
- "level": "DEBUG",
- "group": "WM_DEBUG_REMOTE_ANIMATIONS",
- "at": "com\/android\/server\/wm\/WallpaperAnimationAdapter.java"
- },
- "-754503024": {
- "message": "Relayout %s: oldVis=%d newVis=%d. %s",
- "level": "INFO",
- "group": "WM_DEBUG_SCREEN_ON",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-747671114": {
- "message": "Failed looking up window callers=%s",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-714291355": {
- "message": "Losing delayed focus: %s",
- "level": "INFO",
- "group": "WM_DEBUG_FOCUS_LIGHT",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-694710814": {
- "message": "Pausing rotation during drag",
- "level": "DEBUG",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/DragState.java"
- },
- "-687185281": {
- "message": "New topFocusedDisplayId=%d",
- "level": "VERBOSE",
- "group": "WM_DEBUG_FOCUS_LIGHT",
- "at": "com\/android\/server\/wm\/RootWindowContainer.java"
- },
- "-666510420": {
- "message": "With display frozen, orientationChangeComplete=%b",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/RootWindowContainer.java"
- },
- "-666419717": {
- "message": "Creating animation bounds layer",
- "level": "INFO",
- "group": "WM_DEBUG_APP_TRANSITIONS_ANIM",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "-653156702": {
- "message": "createAppAnimations()",
- "level": "DEBUG",
- "group": "WM_DEBUG_REMOTE_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RemoteAnimationController.java"
- },
- "-650040763": {
- "message": "rotationForOrientation(orient=%d, last=%d); user=%d %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/DisplayRotation.java"
- },
- "-635082269": {
- "message": "******** booted=%b msg=%b haveBoot=%b haveApp=%b haveWall=%b wallEnabled=%b haveKeyguard=%b",
- "level": "INFO",
- "group": "WM_DEBUG_SCREEN_ON",
- "at": "com\/android\/server\/wm\/DisplayContent.java"
- },
- "-622997754": {
- "message": "postWindowRemoveCleanupLocked: %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ADD_REMOVE",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-618015844": {
- "message": "performEnableScreen: mDisplayEnabled=%b mForceDisplayEnabled=%b mShowingBootMessages=%b mSystemBooted=%b mOnlyCore=%b. %s",
- "level": "INFO",
- "group": "WM_DEBUG_BOOT",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-583031528": {
- "message": "%s",
- "level": "INFO",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-576070986": {
- "message": "Performing post-rotate rotation after seamless rotation",
- "level": "INFO",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/DisplayRotation.java"
- },
- "-573268667": {
- "message": "applyAnimation: transition animation is disabled or skipped. atoken=%s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_APP_TRANSITIONS_ANIM",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "-554834595": {
- "message": "Display id=%d is frozen, return %d",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/DisplayContent.java"
- },
- "-549028919": {
- "message": "enableScreenIfNeededLocked: mDisplayEnabled=%b mForceDisplayEnabled=%b mShowingBootMessages=%b mSystemBooted=%b. %s",
- "level": "INFO",
- "group": "WM_DEBUG_BOOT",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-545190927": {
- "message": "<<< CLOSE TRANSACTION animate",
- "level": "INFO",
- "group": "WM_SHOW_TRANSACTIONS",
- "at": "com\/android\/server\/wm\/WindowAnimator.java"
- },
- "-519504830": {
- "message": "applyAnimation: anim=%s nextAppTransition=ANIM_CUSTOM transit=%s isEntrance=%b Callers=%s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_APP_TRANSITIONS_ANIM",
- "at": "com\/android\/server\/wm\/AppTransition.java"
- },
- "-507657818": {
- "message": "Window %s is already added",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-496681057": {
- "message": "Attempted to get remove mode of a display that does not exist: %d",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-481924678": {
- "message": "handleNotObscuredLocked w: %s, w.mHasSurface: %b, w.isOnScreen(): %b, w.isDisplayedLw(): %b, w.mAttrs.userActivityTimeout: %d",
- "level": "DEBUG",
- "group": "WM_DEBUG_KEEP_SCREEN_ON",
- "at": "com\/android\/server\/wm\/RootWindowContainer.java"
- },
- "-477481651": {
- "message": "SURFACE DESTROY PENDING: %s. %s",
- "level": "INFO",
- "group": "WM_SHOW_SURFACE_ALLOC",
- "at": "com\/android\/server\/wm\/WindowStateAnimator.java"
- },
- "-445944810": {
- "message": "finish(%b): mCanceled=%b",
- "level": "DEBUG",
- "group": "WM_DEBUG_RECENTS_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RecentsAnimationController.java"
- },
- "-444624452": {
- "message": "REPARENT from: %s to: %s",
- "level": "INFO",
- "group": "WM_SHOW_TRANSACTIONS",
- "at": "com\/android\/server\/wm\/WindowSurfaceController.java"
- },
- "-439951996": {
- "message": "Disabling listeners",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/DisplayRotation.java"
- },
- "-415865166": {
- "message": "findFocusedWindow: Found new focus @ %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_FOCUS_LIGHT",
- "at": "com\/android\/server\/wm\/DisplayContent.java"
- },
- "-405536909": {
- "message": "Removing snapshot surface",
- "level": "VERBOSE",
- "group": "WM_DEBUG_STARTING_WINDOW",
- "at": "com\/android\/server\/wm\/TaskSnapshotSurface.java"
- },
- "-393505149": {
- "message": "unable to update pointer icon",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-386552155": {
- "message": "Attempted to set system decors flag to a display that does not exist: %d",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-379068494": {
- "message": "unknownApps is not empty: %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_APP_TRANSITIONS",
- "at": "com\/android\/server\/wm\/AppTransitionController.java"
- },
- "-371630969": {
- "message": "New wallpaper target=%s, oldWallpaper=%s, openingApps=%s, closingApps=%s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_APP_TRANSITIONS",
- "at": "com\/android\/server\/wm\/AppTransitionController.java"
- },
- "-367797467": {
- "message": "Creating SplashScreenStartingData",
- "level": "VERBOSE",
- "group": "WM_DEBUG_STARTING_WINDOW",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "-344488673": {
- "message": "Finishing drawing window %s: mDrawState=%s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_STARTING_WINDOW",
- "at": "com\/android\/server\/wm\/WindowStateAnimator.java"
- },
- "-336658140": {
- "message": "Checking theme of starting window: 0x%x",
- "level": "VERBOSE",
- "group": "WM_DEBUG_STARTING_WINDOW",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "-324085783": {
- "message": "SURFACE CROP %s: %s",
- "level": "INFO",
- "group": "WM_SHOW_TRANSACTIONS",
- "at": "com\/android\/server\/wm\/WindowSurfaceController.java"
- },
- "-322035974": {
- "message": "App freeze timeout expired.",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-320419645": {
- "message": "Removing replaced window: %s",
- "level": "DEBUG",
- "group": "WM_DEBUG_ADD_REMOVE",
- "at": "com\/android\/server\/wm\/WindowState.java"
- },
- "-198463978": {
- "message": "updateRotationUnchecked: alwaysSendConfiguration=%b forceRelayout=%b",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-193782861": {
- "message": "Final remove of window: %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_WINDOW_MOVEMENT",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-167822951": {
- "message": "Attempted to add starting window to token with already existing starting window",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-129722369": {
- "message": "New transit: %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_APP_TRANSITIONS",
- "at": "com\/android\/server\/wm\/AppTransitionController.java"
- },
- "-121104356": {
- "message": "Remove %s: mSurfaceController=%s mAnimatingExit=%b mRemoveOnExit=%b mHasSurface=%b surfaceShowing=%b animating=%b app-animation=%b mWillReplaceWindow=%b inPendingTransaction=%b mDisplayFrozen=%b callers=%s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_APP_TRANSITIONS",
- "at": "com\/android\/server\/wm\/WindowState.java"
- },
- "-117925665": {
- "message": "addAppToken: %s task=%s at %d",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ADD_REMOVE",
- "at": "com\/android\/server\/wm\/ActivityRecord.java"
- },
- "-116086365": {
- "message": "******************** ENABLING SCREEN!",
- "level": "INFO",
- "group": "WM_DEBUG_SCREEN_ON",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-106400104": {
- "message": "Preload recents with %s",
- "level": "DEBUG",
- "group": "WM_DEBUG_RECENTS_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RecentsAnimation.java"
- },
- "-104758113": {
- "message": "Removing app %s delayed=%b animation=%s animating=%b",
- "level": "VERBOSE",
- "group": "WM_DEBUG_APP_TRANSITIONS",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "-96848838": {
- "message": "Gaining focus: %s",
- "level": "INFO",
- "group": "WM_DEBUG_FOCUS_LIGHT",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-87705714": {
- "message": "findFocusedWindow: focusedApp=null using new focus @ %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_FOCUS_LIGHT",
- "at": "com\/android\/server\/wm\/DisplayContent.java"
- },
- "-87703044": {
- "message": "Boot completed: SurfaceFlinger is dead!",
- "level": "ERROR",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "-86763148": {
- "message": " KILL SURFACE SESSION %s",
- "level": "INFO",
- "group": "WM_SHOW_TRANSACTIONS",
- "at": "com\/android\/server\/wm\/Session.java"
- },
- "-34965929": {
- "message": "Moving pending starting from %s to %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_STARTING_WINDOW",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "-29233992": {
- "message": "SURFACE CLEAR CROP: %s",
- "level": "INFO",
- "group": "WM_SHOW_TRANSACTIONS",
- "at": "com\/android\/server\/wm\/WindowSurfaceController.java"
- },
- "-7343917": {
- "message": "onAnimationFinished(): targetStack=%s targetActivity=%s mRestoreTargetBehindStack=%s",
- "level": "DEBUG",
- "group": "WM_DEBUG_RECENTS_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RecentsAnimation.java"
- },
- "9803449": {
- "message": "startFreezingDisplayLocked: exitAnim=%d enterAnim=%d called by %s",
- "level": "DEBUG",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "10608884": {
- "message": " FREEZE %s: CREATE",
- "level": "INFO",
- "group": "WM_SHOW_SURFACE_ALLOC",
- "at": "com\/android\/server\/wm\/ScreenRotationAnimation.java"
- },
- "11060725": {
- "message": "Attempted to get system decors flag of a display that does not exist: %d",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "17696244": {
- "message": "startAnimation(): mPendingStart=%b mCanceled=%b",
- "level": "DEBUG",
- "group": "WM_DEBUG_RECENTS_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RecentsAnimationController.java"
- },
- "38267433": {
- "message": "Attempted to reset replacing window on non-existing app token %s",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "44171776": {
- "message": "Resetting app token %s of replacing window marks.",
- "level": "DEBUG",
- "group": "WM_DEBUG_ADD_REMOVE",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "51200510": {
- "message": " BLACK %s: DESTROY",
- "level": "INFO",
- "group": "WM_SHOW_SURFACE_ALLOC",
- "at": "com\/android\/server\/wm\/BlackFrame.java"
- },
- "51628177": {
- "message": "Attempted to get windowing mode of a display that does not exist: %d",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "83950285": {
- "message": "removeAnimation(%d)",
- "level": "DEBUG",
- "group": "WM_DEBUG_RECENTS_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RecentsAnimationController.java"
- },
- "91350919": {
- "message": "Attempted to set IME flag to a display that does not exist: %d",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "95281111": {
- "message": "Attempted to get IME flag of a display that does not exist: %d",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "95902367": {
- "message": "Relayout of %s: focusMayChange=%b",
- "level": "VERBOSE",
- "group": "WM_DEBUG_FOCUS",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "100936473": {
- "message": "Wallpaper animation!",
- "level": "VERBOSE",
- "group": "WM_DEBUG_APP_TRANSITIONS",
- "at": "com\/android\/server\/wm\/AppTransitionController.java"
- },
- "115108840": {
- "message": "Removing startingView=%s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_STARTING_WINDOW",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "118187173": {
- "message": "Enqueueing ADD_STARTING",
- "level": "VERBOSE",
- "group": "WM_DEBUG_STARTING_WINDOW",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "123161180": {
- "message": "SEVER CHILDREN",
- "level": "INFO",
- "group": "WM_SHOW_TRANSACTIONS",
- "at": "com\/android\/server\/wm\/WindowSurfaceController.java"
- },
- "150351993": {
- "message": "addWindow: %s startingWindow=%s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_STARTING_WINDOW",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "152914409": {
- "message": " BLACK %s: CREATE layer=%d",
- "level": "INFO",
- "group": "WM_SHOW_SURFACE_ALLOC",
- "at": "com\/android\/server\/wm\/BlackFrame.java"
- },
- "154699456": {
- "message": "Last window, removing starting window %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_STARTING_WINDOW",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "173419252": {
- "message": "No thumbnail header bitmap for: %d",
- "level": "DEBUG",
- "group": "WM_DEBUG_APP_TRANSITIONS",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "184362060": {
- "message": "screenshotTask(%d): mCanceled=%b",
- "level": "DEBUG",
- "group": "WM_DEBUG_RECENTS_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RecentsAnimationController.java"
- },
- "186668272": {
- "message": "Now changing app %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_APP_TRANSITIONS",
- "at": "com\/android\/server\/wm\/AppTransitionController.java"
- },
- "194124419": {
- "message": "goodToGo(): Animation finished already, canceled=%s mPendingAnimations=%d",
- "level": "DEBUG",
- "group": "WM_DEBUG_REMOTE_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RemoteAnimationController.java"
- },
- "196230599": {
- "message": "Moving existing starting %s from %s to %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_STARTING_WINDOW",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "221540118": {
- "message": "mUserActivityTimeout set to %d",
- "level": "DEBUG",
- "group": "WM_DEBUG_KEEP_SCREEN_ON",
- "at": "com\/android\/server\/wm\/RootWindowContainer.java"
- },
- "241961619": {
- "message": "Adding %s to %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ADD_REMOVE",
- "at": "com\/android\/server\/wm\/WindowToken.java"
- },
- "246676969": {
- "message": "Attempted to add window with non-application token .%s Aborting.",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "248210157": {
- "message": "Finishing remote animation",
- "level": "INFO",
- "group": "WM_DEBUG_REMOTE_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RemoteAnimationController.java"
- },
- "254883724": {
- "message": "addWindowToken: Attempted to add binder token: %s for already created window token: %s displayId=%d",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "255692476": {
- "message": "**** GOOD TO GO",
- "level": "VERBOSE",
- "group": "WM_DEBUG_APP_TRANSITIONS",
- "at": "com\/android\/server\/wm\/AppTransitionController.java"
- },
- "269576220": {
- "message": "Resuming rotation after drag",
- "level": "DEBUG",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/DragState.java"
- },
- "274773837": {
- "message": "applyAnimation: anim=%s nextAppTransition=ANIM_CLIP_REVEAL transit=%s Callers=%s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_APP_TRANSITIONS_ANIM",
- "at": "com\/android\/server\/wm\/AppTransition.java"
- },
- "285317231": {
- "message": "Input focus has changed to %s",
- "level": "DEBUG",
- "group": "WM_DEBUG_FOCUS_LIGHT",
- "at": "com\/android\/server\/wm\/InputMonitor.java"
- },
- "288485303": {
- "message": "Attempted to set remove mode to a display that does not exist: %d",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "289967521": {
- "message": "Check opening app=%s: allDrawn=%b startingDisplayed=%b startingMoved=%b isRelaunching()=%b startingWindow=%s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_APP_TRANSITIONS",
- "at": "com\/android\/server\/wm\/AppTransitionController.java"
- },
- "292904800": {
- "message": "Deferring rotation, animation in progress.",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/DisplayRotation.java"
- },
- "302992539": {
- "message": "addAnimation(%s)",
- "level": "DEBUG",
- "group": "WM_DEBUG_RECENTS_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RecentsAnimationController.java"
- },
- "309039362": {
- "message": "SURFACE MATRIX [%f,%f,%f,%f]: %s",
- "level": "INFO",
- "group": "WM_SHOW_TRANSACTIONS",
- "at": "com\/android\/server\/wm\/WindowSurfaceController.java"
- },
- "342460966": {
- "message": "DRAG %s: pos=(%d,%d)",
- "level": "INFO",
- "group": "WM_SHOW_TRANSACTIONS",
- "at": "com\/android\/server\/wm\/DragState.java"
- },
- "344795667": {
- "message": "*** APP TRANSITION TIMEOUT. displayId=%d isTransitionSet()=%b mOpeningApps.size()=%d mClosingApps.size()=%d mChangingApps.size()=%d",
- "level": "VERBOSE",
- "group": "WM_DEBUG_APP_TRANSITIONS",
- "at": "com\/android\/server\/wm\/AppTransition.java"
- },
- "355720268": {
- "message": "stopFreezingDisplayLocked: Unfreezing now",
- "level": "DEBUG",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "371641947": {
- "message": "Window Manager Crash %s",
- "level": "WTF",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "374972436": {
- "message": "performEnableScreen: Waiting for anim complete",
- "level": "INFO",
- "group": "WM_DEBUG_BOOT",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "385096046": {
- "message": "Delaying loss of focus...",
- "level": "INFO",
- "group": "WM_DEBUG_FOCUS_LIGHT",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "399841913": {
- "message": "SURFACE RECOVER DESTROY: %s",
- "level": "INFO",
- "group": "WM_SHOW_SURFACE_ALLOC",
- "at": "com\/android\/server\/wm\/RootWindowContainer.java"
- },
- "416664944": {
- "message": "No longer freezing: %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "417311568": {
- "message": "onResize: Resizing %s",
- "level": "DEBUG",
- "group": "WM_DEBUG_RESIZE",
- "at": "com\/android\/server\/wm\/WindowState.java"
- },
- "424524729": {
- "message": "Attempted to add wallpaper window with unknown token %s. Aborting.",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "435494046": {
- "message": "Attempted to add window to a display for which the application does not have access: %d. Aborting.",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "457951957": {
- "message": "\tNot visible=%s",
- "level": "DEBUG",
- "group": "WM_DEBUG_REMOTE_ANIMATIONS",
- "at": "com\/android\/server\/wm\/WallpaperAnimationAdapter.java"
- },
- "463993897": {
- "message": "Aborted waiting for drawn: %s",
- "level": "WARN",
- "group": "WM_DEBUG_SCREEN_ON",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "474000473": {
- "message": "No stack above target stack=%s",
- "level": "DEBUG",
- "group": "WM_DEBUG_RECENTS_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RecentsAnimation.java"
- },
- "481370485": {
- "message": "Computed rotation=%d for display id=%d based on lastOrientation=%d and oldRotation=%d",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/DisplayRotation.java"
- },
- "490877640": {
- "message": "onStackOrderChanged(): stack=%s",
- "level": "DEBUG",
- "group": "WM_DEBUG_RECENTS_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RecentsAnimation.java"
- },
- "492980365": {
- "message": "TRANSIT_TASK_OPEN_BEHIND, adding %s to mOpeningApps",
- "level": "DEBUG",
- "group": "WM_DEBUG_APP_TRANSITIONS",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "495032901": {
- "message": "Expected target stack=%s to restored behind stack=%s but it is behind stack=%s",
- "level": "WARN",
- "group": "WM_DEBUG_RECENTS_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RecentsAnimation.java"
- },
- "508887531": {
- "message": "applyAnimation voice: anim=%s transit=%s isEntrance=%b Callers=%s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_APP_TRANSITIONS_ANIM",
- "at": "com\/android\/server\/wm\/AppTransition.java"
- },
- "557227556": {
- "message": "onAnimationFinished(): Notify animation finished:",
- "level": "DEBUG",
- "group": "WM_DEBUG_REMOTE_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RemoteAnimationController.java"
- },
- "558823034": {
- "message": "SURFACE isOpaque=%b: %s",
- "level": "INFO",
- "group": "WM_SHOW_TRANSACTIONS",
- "at": "com\/android\/server\/wm\/WindowSurfaceController.java"
- },
- "585096182": {
- "message": "SURFACE isColorSpaceAgnostic=%b: %s",
- "level": "INFO",
- "group": "WM_SHOW_TRANSACTIONS",
- "at": "com\/android\/server\/wm\/WindowSurfaceController.java"
- },
- "594260577": {
- "message": "createWallpaperAnimations()",
- "level": "DEBUG",
- "group": "WM_DEBUG_REMOTE_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RemoteAnimationController.java"
- },
- "600140673": {
- "message": "checkBootAnimationComplete: Waiting for anim complete",
- "level": "INFO",
- "group": "WM_DEBUG_BOOT",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "608694300": {
- "message": " NEW SURFACE SESSION %s",
- "level": "INFO",
- "group": "WM_SHOW_TRANSACTIONS",
- "at": "com\/android\/server\/wm\/Session.java"
- },
- "620368427": {
- "message": "******* TELLING SURFACE FLINGER WE ARE BOOTED!",
- "level": "INFO",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "628276090": {
- "message": "Delaying app transition for screen rotation animation to finish",
- "level": "VERBOSE",
- "group": "WM_DEBUG_APP_TRANSITIONS",
- "at": "com\/android\/server\/wm\/AppTransitionController.java"
- },
- "631792420": {
- "message": "Attempted to add window with token that is not a window: %s. Aborting.",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "633654009": {
- "message": "SURFACE POS (setPositionInTransaction) @ (%f,%f): %s",
- "level": "INFO",
- "group": "WM_SHOW_TRANSACTIONS",
- "at": "com\/android\/server\/wm\/WindowSurfaceController.java"
- },
- "644675193": {
- "message": "Real start recents",
- "level": "DEBUG",
- "group": "WM_DEBUG_RECENTS_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RecentsAnimation.java"
- },
- "646155519": {
- "message": "Started intent=%s",
- "level": "DEBUG",
- "group": "WM_DEBUG_RECENTS_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RecentsAnimation.java"
- },
- "662572728": {
- "message": "Attempted to add a toast window with bad token %s. Aborting.",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "665256544": {
- "message": "All windows drawn!",
- "level": "DEBUG",
- "group": "WM_DEBUG_SCREEN_ON",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "668425960": {
- "message": "Notify removed startingWindow %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_STARTING_WINDOW",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
"676824470": {
"message": "Test completed successfully: %b %d %o %x %e %g %f %% %s.",
"level": "ERROR",
"group": "TEST_GROUP",
"at": "com\/android\/server\/wm\/ProtoLogGroup.java"
- },
- "685047360": {
- "message": "Resizing window %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_RESIZE",
- "at": "com\/android\/server\/wm\/WindowState.java"
- },
- "690411811": {
- "message": "goodToGo(): No apps to animate",
- "level": "DEBUG",
- "group": "WM_DEBUG_REMOTE_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RemoteAnimationController.java"
- },
- "693423992": {
- "message": "setAnimationLocked: setting mFocusMayChange true",
- "level": "INFO",
- "group": "WM_DEBUG_FOCUS_LIGHT",
- "at": "com\/android\/server\/wm\/WindowState.java"
- },
- "704998117": {
- "message": "Failed to create surface control for %s",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "745391677": {
- "message": " CREATE SURFACE %s IN SESSION %s: pid=%d format=%d flags=0x%x \/ %s",
- "level": "INFO",
- "group": "WM_SHOW_SURFACE_ALLOC",
- "at": "com\/android\/server\/wm\/WindowStateAnimator.java"
- },
- "758852025": {
- "message": "Surface returned was null: %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_STARTING_WINDOW",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "765395228": {
- "message": "onAnimationFinished(): controller=%s reorderMode=%d",
- "level": "DEBUG",
- "group": "WM_DEBUG_RECENTS_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RecentsAnimation.java"
- },
- "791468751": {
- "message": "Pausing rotation during re-position",
- "level": "DEBUG",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/TaskPositioner.java"
- },
- "794570322": {
- "message": "Now closing app %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_APP_TRANSITIONS",
- "at": "com\/android\/server\/wm\/AppTransitionController.java"
- },
- "811802785": {
- "message": "Changing app %s hidden=%b performLayout=%b",
- "level": "VERBOSE",
- "group": "WM_DEBUG_APP_TRANSITIONS",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "829434921": {
- "message": "Draw state now committed in %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_STARTING_WINDOW",
- "at": "com\/android\/server\/wm\/WindowStateAnimator.java"
- },
- "835814848": {
- "message": "%s",
- "level": "INFO",
- "group": "WM_DEBUG_REMOTE_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RemoteAnimationController.java"
- },
- "845234215": {
- "message": "App is requesting an orientation, return %d for display id=%d",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/DisplayContent.java"
- },
- "847534382": {
- "message": "Non-null appWindowToken for system window of rootType=%d",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "853091290": {
- "message": "Moved stack=%s behind stack=%s",
- "level": "DEBUG",
- "group": "WM_DEBUG_RECENTS_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RecentsAnimation.java"
- },
- "868946719": {
- "message": "notifyAppResumed: wasStopped=%b %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ADD_REMOVE",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "873914452": {
- "message": "goodToGo()",
- "level": "DEBUG",
- "group": "WM_DEBUG_REMOTE_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RemoteAnimationController.java"
- },
- "884043983": {
- "message": "removeDeadWindows: %s",
- "level": "WARN",
- "group": "WM_DEBUG_ADD_REMOVE",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "892244061": {
- "message": "Waiting for drawn %s: removed=%b visible=%b mHasSurface=%b drawState=%d",
- "level": "INFO",
- "group": "WM_DEBUG_SCREEN_ON",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "898863925": {
- "message": "Attempted to add QS dialog window with unknown token %s. Aborting.",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "913494177": {
- "message": "removeAllWindowsIfPossible: removing win=%s",
- "level": "WARN",
- "group": "WM_DEBUG_WINDOW_MOVEMENT",
- "at": "com\/android\/server\/wm\/WindowToken.java"
- },
- "916191774": {
- "message": "Orientation change complete in %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/WindowStateAnimator.java"
- },
- "917739349": {
- "message": "Set focused app to: %s moveFocusNow=%b displayId=%d",
- "level": "VERBOSE",
- "group": "WM_DEBUG_FOCUS_LIGHT",
- "at": "com\/android\/server\/wm\/ActivityDisplay.java"
- },
- "954470154": {
- "message": "FORCED DISPLAY SCALING DISABLED",
- "level": "INFO",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "990058731": {
- "message": "notifyAppStopped: %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ADD_REMOVE",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "1001904964": {
- "message": "***** BOOT TIMEOUT: forcing display enabled",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "1004585481": {
- "message": "%s forcing orientation to %d for display id=%d",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/DisplayContent.java"
- },
- "1021057640": {
- "message": "Marking app token %s with replacing child windows.",
- "level": "DEBUG",
- "group": "WM_DEBUG_ADD_REMOVE",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "1051545910": {
- "message": "Exit animation finished in %s: remove=%b",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ADD_REMOVE",
- "at": "com\/android\/server\/wm\/WindowState.java"
- },
- "1073230342": {
- "message": "startAnimation",
- "level": "DEBUG",
- "group": "WM_DEBUG_REMOTE_ANIMATIONS",
- "at": "com\/android\/server\/wm\/WallpaperAnimationAdapter.java"
- },
- "1089714158": {
- "message": " FREEZE %s: DESTROY",
- "level": "INFO",
- "group": "WM_SHOW_SURFACE_ALLOC",
- "at": "com\/android\/server\/wm\/ScreenRotationAnimation.java"
- },
- "1108406230": {
- "message": "stopFreezingDisplayLocked: Returning mWaitingForConfig=%b, mAppsFreezingScreen=%d, mWindowsFreezingScreen=%d, mClientFreezingScreen=%b, mOpeningApps.size()=%d",
- "level": "DEBUG",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "1112047265": {
- "message": "finishDrawingWindow: %s mDrawState=%s",
- "level": "DEBUG",
- "group": "WM_DEBUG_ADD_REMOVE",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "1115417974": {
- "message": "FORCED DISPLAY SIZE: %dx%d",
- "level": "INFO",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "1140424002": {
- "message": "Finished screen turning on...",
- "level": "INFO",
- "group": "WM_DEBUG_SCREEN_ON",
- "at": "com\/android\/server\/wm\/DisplayPolicy.java"
- },
- "1160771501": {
- "message": "Resize reasons for w=%s: %s surfaceResized=%b configChanged=%b dragResizingChanged=%b reportOrientationChanged=%b",
- "level": "VERBOSE",
- "group": "WM_DEBUG_RESIZE",
- "at": "com\/android\/server\/wm\/WindowState.java"
- },
- "1166381079": {
- "message": "Execute app transition: %s, displayId: %d Callers=%s",
- "level": "WARN",
- "group": "WM_DEBUG_APP_TRANSITIONS",
- "at": "com\/android\/server\/wm\/DisplayContent.java"
- },
- "1195433019": {
- "message": "Clearing startingData for token=%s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_STARTING_WINDOW",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "1208313423": {
- "message": "addWindowToken: Attempted to add token: %s for non-exiting displayId=%d",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "1219600119": {
- "message": "addWindow: win=%s Callers=%s",
- "level": "DEBUG",
- "group": "WM_DEBUG_FOCUS",
- "at": "com\/android\/server\/wm\/WindowToken.java"
- },
- "1220075598": {
- "message": "SURFACE SIZE %dx%d: %s",
- "level": "INFO",
- "group": "WM_SHOW_TRANSACTIONS",
- "at": "com\/android\/server\/wm\/WindowSurfaceController.java"
- },
- "1224307091": {
- "message": "checkBootAnimationComplete: Animation complete!",
- "level": "INFO",
- "group": "WM_DEBUG_BOOT",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "1244668962": {
- "message": "Added starting %s: startingWindow=%s startingView=%s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_STARTING_WINDOW",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "1288731814": {
- "message": "WindowState.hideLw: setting mFocusMayChange true",
- "level": "INFO",
- "group": "WM_DEBUG_FOCUS_LIGHT",
- "at": "com\/android\/server\/wm\/WindowState.java"
- },
- "1325649102": {
- "message": "Bad requesting window %s",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "1329340614": {
- "message": "Orientation not waiting for draw in %s, surfaceController %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/WindowState.java"
- },
- "1331177619": {
- "message": "Attempted to add a toast window with unknown token %s. Aborting.",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "1358462645": {
- "message": "Looking for focus: %s, flags=%d, canReceive=%b",
- "level": "VERBOSE",
- "group": "WM_DEBUG_FOCUS",
- "at": "com\/android\/server\/wm\/DisplayContent.java"
- },
- "1401700824": {
- "message": "Window drawn win=%s",
- "level": "DEBUG",
- "group": "WM_DEBUG_SCREEN_ON",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "1404220922": {
- "message": "Translucent=%s Floating=%s ShowWallpaper=%s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_STARTING_WINDOW",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "1422781269": {
- "message": "Resuming rotation after re-position",
- "level": "DEBUG",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/TaskPositioner.java"
- },
- "1423418408": {
- "message": "unable to restore pointer icon",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "1423592961": {
- "message": "<<< CLOSE TRANSACTION removeReplacedWindows",
- "level": "INFO",
- "group": "WM_SHOW_TRANSACTIONS",
- "at": "com\/android\/server\/wm\/RootWindowContainer.java"
- },
- "1430336882": {
- "message": "findFocusedWindow: focusedApp windows not focusable using new focus @ %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_FOCUS_LIGHT",
- "at": "com\/android\/server\/wm\/DisplayContent.java"
- },
- "1434383382": {
- "message": "Attempted to get flag of a display that does not exist: %d",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "1448683958": {
- "message": "Override pending remote transitionSet=%b adapter=%s",
- "level": "INFO",
- "group": "WM_DEBUG_APP_TRANSITIONS",
- "at": "com\/android\/server\/wm\/AppTransition.java"
- },
- "1457990604": {
- "message": "applyAnimation: anim=%s nextAppTransition=ANIM_CUSTOM_IN_PLACE transit=%s Callers=%s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_APP_TRANSITIONS_ANIM",
- "at": "com\/android\/server\/wm\/AppTransition.java"
- },
- "1469292670": {
- "message": "Changing focus from %s to %s displayId=%d Callers=%s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_FOCUS_LIGHT",
- "at": "com\/android\/server\/wm\/DisplayContent.java"
- },
- "1495525537": {
- "message": "createWallpaperAnimations()",
- "level": "DEBUG",
- "group": "WM_DEBUG_RECENTS_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RecentsAnimationController.java"
- },
- "1496418389": {
- "message": "Removing starting %s from %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ADD_REMOVE",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "1497304204": {
- "message": "Deferring rotation, rotation is paused.",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/DisplayRotation.java"
- },
- "1504168072": {
- "message": "removeIfPossible: %s callers=%s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ADD_REMOVE",
- "at": "com\/android\/server\/wm\/WindowState.java"
- },
- "1518495446": {
- "message": "removeWindowToken: Attempted to remove non-existing token: %s",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "1519757176": {
- "message": "setHomeApp(%s)",
- "level": "DEBUG",
- "group": "WM_DEBUG_RECENTS_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RecentsAnimationController.java"
- },
- "1521476038": {
- "message": "Attempted to set flag to a display that does not exist: %d",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "1525976603": {
- "message": "cancelAnimation(): reason=%s",
- "level": "DEBUG",
- "group": "WM_DEBUG_RECENTS_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RecentsAnimationController.java"
- },
- "1531527061": {
- "message": "createAnimationAdapter(): token=%s",
- "level": "DEBUG",
- "group": "WM_DEBUG_REMOTE_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RemoteAnimationController.java"
- },
- "1563755163": {
- "message": "Permission Denial: %s from pid=%d, uid=%d requires %s",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "1573332272": {
- "message": "Display id=%d selected orientation %d, got rotation %d",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/DisplayRotation.java"
- },
- "1577579529": {
- "message": "win=%s destroySurfaces: appStopped=%b win.mWindowRemovalAllowed=%b win.mRemoveOnExit=%b",
- "level": "ERROR",
- "group": "WM_DEBUG_ADD_REMOVE",
- "at": "com\/android\/server\/wm\/WindowState.java"
- },
- "1589610525": {
- "message": "applyAnimation NEXT_TRANSIT_TYPE_OPEN_CROSS_PROFILE_APPS: anim=%s transit=%s isEntrance=true Callers=%s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_APP_TRANSITIONS_ANIM",
- "at": "com\/android\/server\/wm\/AppTransition.java"
- },
- "1628345525": {
- "message": "Now opening app %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_APP_TRANSITIONS",
- "at": "com\/android\/server\/wm\/AppTransitionController.java"
- },
- "1634557978": {
- "message": "**** Dismissing screen rotation animation",
- "level": "INFO",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "1635462459": {
- "message": "onMovedByResize: Moving %s",
- "level": "DEBUG",
- "group": "WM_DEBUG_RESIZE",
- "at": "com\/android\/server\/wm\/WindowState.java"
- },
- "1637745145": {
- "message": "Clear freezing of %s force=%b",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "1720696061": {
- "message": "Adding window to Display that has been removed.",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "1739298851": {
- "message": "removeWindowToken: Attempted to remove token: %s for non-exiting displayId=%d",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "1747941491": {
- "message": "SURFACE controller=%s alpha=%f matrix=[%f*%f,%f*%f][%f*%f,%f*%f]: %s",
- "level": "INFO",
- "group": "WM_SHOW_TRANSACTIONS",
- "at": "com\/android\/server\/wm\/WindowStateAnimator.java"
- },
- "1756082882": {
- "message": "Orientation change skips hidden %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/WindowStateAnimator.java"
- },
- "1762317752": {
- "message": "Expected target stack=%s to be top most but found stack=%s",
- "level": "WARN",
- "group": "WM_DEBUG_RECENTS_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RecentsAnimation.java"
- },
- "1764592478": {
- "message": "reparent: moving app token=%s to task=%d at %d",
- "level": "INFO",
- "group": "WM_DEBUG_ADD_REMOVE",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "1774661765": {
- "message": "Devices still not ready after waiting %d milliseconds before attempting to detect safe mode.",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "1814552834": {
- "message": "performLayout: App token exiting now removed %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ADD_REMOVE",
- "at": "com\/android\/server\/wm\/DisplayContent.java"
- },
- "1836306327": {
- "message": "Skipping set freeze of %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/ActivityRecord.java"
- },
- "1865125884": {
- "message": "finishScreenTurningOn: mAwake=%b, mScreenOnEarly=%b, mScreenOnFully=%b, mKeyguardDrawComplete=%b, mWindowManagerDrawComplete=%b",
- "level": "DEBUG",
- "group": "WM_DEBUG_SCREEN_ON",
- "at": "com\/android\/server\/wm\/DisplayPolicy.java"
- },
- "1865246212": {
- "message": "\tapp=%s",
- "level": "DEBUG",
- "group": "WM_DEBUG_REMOTE_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RemoteAnimationController.java"
- },
- "1866772666": {
- "message": "SAFE MODE not enabled",
- "level": "INFO",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "1878395049": {
- "message": "Loading animation for app transition. transit=%s enter=%b frame=%s insets=%s surfaceInsets=%s",
- "level": "DEBUG",
- "group": "WM_DEBUG_APP_TRANSITIONS",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "1883987026": {
- "message": "removeAppToken make exiting: %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ADD_REMOVE",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "1891501279": {
- "message": "cancelAnimation(): reason=%s",
- "level": "DEBUG",
- "group": "WM_DEBUG_REMOTE_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RemoteAnimationController.java"
- },
- "1921821199": {
- "message": "Preserving %s until the new one is added",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ADD_REMOVE",
- "at": "com\/android\/server\/wm\/WindowState.java"
- },
- "1947239194": {
- "message": "Deferring rotation, still finishing previous rotation",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/DisplayRotation.java"
- },
- "1964565370": {
- "message": "Starting remote animation",
- "level": "INFO",
- "group": "WM_DEBUG_REMOTE_ANIMATIONS",
- "at": "com\/android\/server\/wm\/RemoteAnimationController.java"
- },
- "1984470582": {
- "message": "Creating TaskScreenshotAnimatable: task: %s width: %d height: %d",
- "level": "DEBUG",
- "group": "WM_DEBUG_RECENTS_ANIMATIONS",
- "at": "com\/android\/server\/wm\/TaskScreenshotAnimatable.java"
- },
- "1984738415": {
- "message": "Now animating app in place %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_APP_TRANSITIONS",
- "at": "com\/android\/server\/wm\/AppTransitionController.java"
- },
- "1984782949": {
- "message": ">>> OPEN TRANSACTION animate",
- "level": "INFO",
- "group": "WM_SHOW_TRANSACTIONS",
- "at": "com\/android\/server\/wm\/WindowAnimator.java"
- },
- "1993685727": {
- "message": "Setting mOrientationChangeComplete=true because wtoken %s numInteresting=%d numDrawn=%d",
- "level": "INFO",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "2016061474": {
- "message": "Prepare app transition: transit=%s %s alwaysKeepCurrent=%b displayId=%d Callers=%s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_APP_TRANSITIONS",
- "at": "com\/android\/server\/wm\/AppTransition.java"
- },
- "2018454757": {
- "message": "WS.removeImmediately: %s Already removed...",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ADD_REMOVE",
- "at": "com\/android\/server\/wm\/WindowState.java"
- },
- "2028163120": {
- "message": "applyAnimation: anim=%s nextAppTransition=ANIM_SCALE_UP transit=%s isEntrance=%s Callers=%s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_APP_TRANSITIONS_ANIM",
- "at": "com\/android\/server\/wm\/AppTransition.java"
- },
- "2034780299": {
- "message": "CHECK_IF_BOOT_ANIMATION_FINISHED:",
- "level": "INFO",
- "group": "WM_DEBUG_BOOT",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "2045641491": {
- "message": "Checking %d opening apps (frozen=%b timeout=%b)...",
- "level": "VERBOSE",
- "group": "WM_DEBUG_APP_TRANSITIONS",
- "at": "com\/android\/server\/wm\/AppTransitionController.java"
- },
- "2054958632": {
- "message": "Schedule remove starting %s startingWindow=%s startingView=%s Callers=%s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_STARTING_WINDOW",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "2057434754": {
- "message": "\tvisible=%s",
- "level": "DEBUG",
- "group": "WM_DEBUG_REMOTE_ANIMATIONS",
- "at": "com\/android\/server\/wm\/WallpaperAnimationAdapter.java"
- },
- "2076259606": {
- "message": "Finish starting %s: first real window is shown, no animation",
- "level": "VERBOSE",
- "group": "WM_DEBUG_STARTING_WINDOW",
- "at": "com\/android\/server\/wm\/AppWindowToken.java"
- },
- "2083556954": {
- "message": "Set mOrientationChanging of %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/DisplayContent.java"
- },
- "2086878461": {
- "message": "Could not send command %s with parameters %s. %s",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "2088592090": {
- "message": "handleNotObscuredLocked: %s was holding screen wakelock but no longer has FLAG_KEEP_SCREEN_ON!!! called by%s",
- "level": "DEBUG",
- "group": "WM_DEBUG_KEEP_SCREEN_ON",
- "at": "com\/android\/server\/wm\/RootWindowContainer.java"
- },
- "2096635066": {
- "message": "Acquiring screen wakelock due to %s",
- "level": "DEBUG",
- "group": "WM_DEBUG_KEEP_SCREEN_ON",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
- "2114149926": {
- "message": "Not removing %s because app died while it's visible",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ADD_REMOVE",
- "at": "com\/android\/server\/wm\/WindowState.java"
- },
- "2128604122": {
- "message": "findFocusedWindow: No focusable windows.",
- "level": "VERBOSE",
- "group": "WM_DEBUG_FOCUS_LIGHT",
- "at": "com\/android\/server\/wm\/DisplayContent.java"
- },
- "2128917433": {
- "message": "onProposedRotationChanged, rotation=%d",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ORIENTATION",
- "at": "com\/android\/server\/wm\/DisplayRotation.java"
- },
- "2137411379": {
- "message": "applyAnimation: anim=%s animAttr=0x%x transit=%s isEntrance=%b Callers=%s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_APP_TRANSITIONS_ANIM",
- "at": "com\/android\/server\/wm\/AppTransition.java"
}
},
"groups": {
"TEST_GROUP": {
"tag": "WindowManagetProtoLogTest"
- },
- "WM_DEBUG_ADD_REMOVE": {
- "tag": "WindowManager"
- },
- "WM_DEBUG_APP_TRANSITIONS": {
- "tag": "WindowManager"
- },
- "WM_DEBUG_APP_TRANSITIONS_ANIM": {
- "tag": "WindowManager"
- },
- "WM_DEBUG_BOOT": {
- "tag": "WindowManager"
- },
- "WM_DEBUG_DRAW": {
- "tag": "WindowManager"
- },
- "WM_DEBUG_FOCUS": {
- "tag": "WindowManager"
- },
- "WM_DEBUG_FOCUS_LIGHT": {
- "tag": "WindowManager"
- },
- "WM_DEBUG_KEEP_SCREEN_ON": {
- "tag": "WindowManager"
- },
- "WM_DEBUG_ORIENTATION": {
- "tag": "WindowManager"
- },
- "WM_DEBUG_RECENTS_ANIMATIONS": {
- "tag": "WindowManager"
- },
- "WM_DEBUG_REMOTE_ANIMATIONS": {
- "tag": "WindowManager"
- },
- "WM_DEBUG_RESIZE": {
- "tag": "WindowManager"
- },
- "WM_DEBUG_SCREEN_ON": {
- "tag": "WindowManager"
- },
- "WM_DEBUG_STARTING_WINDOW": {
- "tag": "WindowManager"
- },
- "WM_DEBUG_WINDOW_MOVEMENT": {
- "tag": "WindowManager"
- },
- "WM_ERROR": {
- "tag": "WindowManager"
- },
- "WM_SHOW_SURFACE_ALLOC": {
- "tag": "WindowManager"
- },
- "WM_SHOW_TRANSACTIONS": {
- "tag": "WindowManager"
}
}
}
diff --git a/services/core/java/com/android/server/wm/ActivityDisplay.java b/services/core/java/com/android/server/wm/ActivityDisplay.java
index 41d179db825e..e488cc91f9ba 100644
--- a/services/core/java/com/android/server/wm/ActivityDisplay.java
+++ b/services/core/java/com/android/server/wm/ActivityDisplay.java
@@ -50,9 +50,9 @@ import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_TASKS;
import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_STACK;
import static com.android.server.wm.ActivityTaskManagerDebugConfig.TAG_ATM;
import static com.android.server.wm.ActivityTaskManagerDebugConfig.TAG_WITH_CLASS_NAME;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_FOCUS_LIGHT;
import static com.android.server.wm.RootActivityContainer.FindTaskResult;
import static com.android.server.wm.RootActivityContainer.TAG_STATES;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_FOCUS_LIGHT;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_NORMAL;
@@ -76,7 +76,6 @@ import android.view.Display;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.function.pooled.PooledLambda;
import com.android.server.am.EventLogTags;
-import com.android.server.protolog.common.ProtoLog;
import java.io.PrintWriter;
import java.util.ArrayList;
@@ -1305,8 +1304,8 @@ class ActivityDisplay extends ConfigurationContainer<ActivityStack>
final AppWindowToken newFocus;
final IBinder token = r.appToken;
if (token == null) {
- ProtoLog.v(WM_DEBUG_FOCUS_LIGHT, "Clearing focused app, displayId=%d",
- mDisplayId);
+ if (DEBUG_FOCUS_LIGHT) Slog.v(TAG_WM, "Clearing focused app, displayId="
+ + mDisplayId);
newFocus = null;
} else {
newFocus = mService.mWindowManager.mRoot.getAppWindowToken(token);
@@ -1314,9 +1313,8 @@ class ActivityDisplay extends ConfigurationContainer<ActivityStack>
Slog.w(TAG_WM, "Attempted to set focus to non-existing app token: " + token
+ ", displayId=" + mDisplayId);
}
- ProtoLog.v(WM_DEBUG_FOCUS_LIGHT,
- "Set focused app to: %s moveFocusNow=%b displayId=%d", newFocus,
- moveFocusNow, mDisplayId);
+ if (DEBUG_FOCUS_LIGHT) Slog.v(TAG_WM, "Set focused app to: " + newFocus
+ + " moveFocusNow=" + moveFocusNow + " displayId=" + mDisplayId);
}
final boolean changed = mDisplayContent.setFocusedApp(newFocus);
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java
index c9e84ec2c69b..c54ccd4d6844 100644
--- a/services/core/java/com/android/server/wm/ActivityRecord.java
+++ b/services/core/java/com/android/server/wm/ActivityRecord.java
@@ -154,11 +154,12 @@ import static com.android.server.wm.ActivityTaskManagerService.RELAUNCH_REASON_W
import static com.android.server.wm.IdentifierProto.HASH_CODE;
import static com.android.server.wm.IdentifierProto.TITLE;
import static com.android.server.wm.IdentifierProto.USER_ID;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_ADD_REMOVE;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_ORIENTATION;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_STARTING_WINDOW;
import static com.android.server.wm.TaskPersister.DEBUG;
import static com.android.server.wm.TaskPersister.IMAGE_EXTENSION;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ADD_REMOVE;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ORIENTATION;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_STARTING_WINDOW;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_TOKEN_MOVEMENT;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
import static org.xmlpull.v1.XmlPullParser.END_DOCUMENT;
@@ -238,7 +239,6 @@ import com.android.server.AttributeCache.Entry;
import com.android.server.am.AppTimeTracker;
import com.android.server.am.EventLogTags;
import com.android.server.am.PendingIntentRecord;
-import com.android.server.protolog.common.ProtoLog;
import com.android.server.uri.UriPermissionOwner;
import com.android.server.wm.ActivityMetricsLogger.WindowingModeTransitionInfoSnapshot;
import com.android.server.wm.ActivityStack.ActivityState;
@@ -1183,10 +1183,11 @@ final class ActivityRecord extends ConfigurationContainer {
info.applicationInfo.targetSdkVersion,
info.screenOrientation, mRotationAnimationHint,
mLaunchTaskBehind, isAlwaysFocusable());
- ProtoLog.v(WM_DEBUG_ADD_REMOVE, "addAppToken: %s"
- + " task=%s at %d", mAppWindowToken, container,
- Integer.MAX_VALUE);
-
+ if (DEBUG_TOKEN_MOVEMENT || DEBUG_ADD_REMOVE) {
+ Slog.v(TAG, "addAppToken: "
+ + mAppWindowToken + " task=" + container + " at "
+ + Integer.MAX_VALUE);
+ }
container.addChild(mAppWindowToken, Integer.MAX_VALUE /* add on top */);
}
@@ -1203,11 +1204,12 @@ final class ActivityRecord extends ConfigurationContainer {
CharSequence nonLocalizedLabel, int labelRes, int icon, int logo, int windowFlags,
IBinder transferFrom, boolean newTask, boolean taskSwitch, boolean processRunning,
boolean allowTaskSnapshot, boolean activityCreated, boolean fromRecents) {
- ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "setAppStartingWindow: token=%s"
- + " pkg=%s transferFrom=%s newTask=%b taskSwitch=%b processRunning=%b"
- + " allowTaskSnapshot=%b", appToken, pkg, transferFrom, newTask, taskSwitch,
- processRunning, allowTaskSnapshot);
-
+ if (DEBUG_STARTING_WINDOW) {
+ Slog.v(TAG, "setAppStartingWindow: token=" + appToken
+ + " pkg=" + pkg + " transferFrom=" + transferFrom + " newTask=" + newTask
+ + " taskSwitch=" + taskSwitch + " processRunning=" + processRunning
+ + " allowTaskSnapshot=" + allowTaskSnapshot);
+ }
if (mAppWindowToken == null) {
Slog.w(TAG_WM, "Attempted to set icon of non-existing app token: " + appToken);
return false;
@@ -3213,7 +3215,7 @@ final class ActivityRecord extends ConfigurationContainer {
// Window configuration changes only effect windows, so don't require a screen freeze.
int freezableConfigChanges = configChanges & ~(CONFIG_WINDOW_CONFIGURATION);
if (freezableConfigChanges == 0 && mAppWindowToken.okToDisplay()) {
- ProtoLog.v(WM_DEBUG_ORIENTATION, "Skipping set freeze of %s", appToken);
+ if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Skipping set freeze of " + appToken);
return;
}
@@ -3227,9 +3229,11 @@ final class ActivityRecord extends ConfigurationContainer {
if (mAppWindowToken == null) {
return;
}
- ProtoLog.v(WM_DEBUG_ORIENTATION,
- "Clear freezing of %s: hidden=%b freezing=%b", appToken,
- mAppWindowToken.isHidden(), mAppWindowToken.isFreezingScreen());
+ if (DEBUG_ORIENTATION) {
+ Slog.v(TAG_WM, "Clear freezing of " + appToken + ": hidden="
+ + mAppWindowToken.isHidden() + " freezing="
+ + mAppWindowToken.isFreezingScreen());
+ }
mAppWindowToken.stopFreezingScreen(true, force);
}
}
diff --git a/services/core/java/com/android/server/wm/AppTransition.java b/services/core/java/com/android/server/wm/AppTransition.java
index 93c461f3add9..66d52cc9bf5a 100644
--- a/services/core/java/com/android/server/wm/AppTransition.java
+++ b/services/core/java/com/android/server/wm/AppTransition.java
@@ -70,9 +70,8 @@ import static com.android.internal.R.styleable.WindowAnimation_wallpaperOpenEnte
import static com.android.internal.R.styleable.WindowAnimation_wallpaperOpenExitAnimation;
import static com.android.server.wm.AppTransitionProto.APP_TRANSITION_STATE;
import static com.android.server.wm.AppTransitionProto.LAST_USED_APP_TRANSITION;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_APP_TRANSITIONS;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_APP_TRANSITIONS_ANIM;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ANIM;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_APP_TRANSITIONS;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
import static com.android.server.wm.WindowManagerInternal.AppTransitionListener;
@@ -132,7 +131,6 @@ import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.DumpUtils.Dump;
import com.android.internal.util.function.pooled.PooledLambda;
import com.android.server.AttributeCache;
-import com.android.server.protolog.common.ProtoLog;
import com.android.server.wm.animation.ClipRectLRAnimation;
import com.android.server.wm.animation.ClipRectTBAnimation;
import com.android.server.wm.animation.CurvedTranslateAnimation;
@@ -1632,61 +1630,70 @@ public class AppTransition implements Dump {
a = loadAnimationRes(lp, enter
? com.android.internal.R.anim.voice_activity_open_enter
: com.android.internal.R.anim.voice_activity_open_exit);
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS_ANIM,
- "applyAnimation voice: anim=%s transit=%s isEntrance=%b Callers=%s", a,
- appTransitionToString(transit), enter, Debug.getCallers(3));
+ if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG,
+ "applyAnimation voice:"
+ + " anim=" + a + " transit=" + appTransitionToString(transit)
+ + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3));
} else if (isVoiceInteraction && (transit == TRANSIT_ACTIVITY_CLOSE
|| transit == TRANSIT_TASK_CLOSE
|| transit == TRANSIT_TASK_TO_BACK)) {
a = loadAnimationRes(lp, enter
? com.android.internal.R.anim.voice_activity_close_enter
: com.android.internal.R.anim.voice_activity_close_exit);
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS_ANIM,
- "applyAnimation voice: anim=%s transit=%s isEntrance=%b Callers=%s", a,
- appTransitionToString(transit), enter, Debug.getCallers(3));
+ if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG,
+ "applyAnimation voice:"
+ + " anim=" + a + " transit=" + appTransitionToString(transit)
+ + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3));
} else if (transit == TRANSIT_ACTIVITY_RELAUNCH) {
a = createRelaunchAnimation(frame, insets);
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS_ANIM,
- "applyAnimation: anim=%s nextAppTransition=%d transit=%s Callers=%s", a,
- mNextAppTransition, appTransitionToString(transit),
- Debug.getCallers(3));
+ if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG,
+ "applyAnimation:"
+ + " anim=" + a + " nextAppTransition=" + mNextAppTransition
+ + " transit=" + appTransitionToString(transit)
+ + " Callers=" + Debug.getCallers(3));
} else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_CUSTOM) {
a = loadAnimationRes(mNextAppTransitionPackage, enter ?
mNextAppTransitionEnter : mNextAppTransitionExit);
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS_ANIM,
- "applyAnimation: anim=%s nextAppTransition=ANIM_CUSTOM transit=%s "
- + "isEntrance=%b Callers=%s",
- a, appTransitionToString(transit), enter, Debug.getCallers(3));
+ if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG,
+ "applyAnimation:"
+ + " anim=" + a + " nextAppTransition=ANIM_CUSTOM"
+ + " transit=" + appTransitionToString(transit) + " isEntrance=" + enter
+ + " Callers=" + Debug.getCallers(3));
} else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_CUSTOM_IN_PLACE) {
a = loadAnimationRes(mNextAppTransitionPackage, mNextAppTransitionInPlace);
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS_ANIM,
- "applyAnimation: anim=%s nextAppTransition=ANIM_CUSTOM_IN_PLACE "
- + "transit=%s Callers=%s",
- a, appTransitionToString(transit), Debug.getCallers(3));
+ if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG,
+ "applyAnimation:"
+ + " anim=" + a + " nextAppTransition=ANIM_CUSTOM_IN_PLACE"
+ + " transit=" + appTransitionToString(transit)
+ + " Callers=" + Debug.getCallers(3));
} else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_CLIP_REVEAL) {
a = createClipRevealAnimationLocked(transit, enter, frame, displayFrame);
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS_ANIM,
- "applyAnimation: anim=%s nextAppTransition=ANIM_CLIP_REVEAL "
- + "transit=%s Callers=%s",
- a, appTransitionToString(transit), Debug.getCallers(3));
+ if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG,
+ "applyAnimation:"
+ + " anim=" + a + " nextAppTransition=ANIM_CLIP_REVEAL"
+ + " transit=" + appTransitionToString(transit)
+ + " Callers=" + Debug.getCallers(3));
} else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_SCALE_UP) {
a = createScaleUpAnimationLocked(transit, enter, frame);
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS_ANIM,
- "applyAnimation: anim=%s nextAppTransition=ANIM_SCALE_UP transit=%s "
- + "isEntrance=%s Callers=%s",
- a, appTransitionToString(transit), enter, Debug.getCallers(3));
+ if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG,
+ "applyAnimation:"
+ + " anim=" + a + " nextAppTransition=ANIM_SCALE_UP"
+ + " transit=" + appTransitionToString(transit) + " isEntrance=" + enter
+ + " Callers=" + Debug.getCallers(3));
} else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_THUMBNAIL_SCALE_UP ||
mNextAppTransitionType == NEXT_TRANSIT_TYPE_THUMBNAIL_SCALE_DOWN) {
mNextAppTransitionScaleUp =
(mNextAppTransitionType == NEXT_TRANSIT_TYPE_THUMBNAIL_SCALE_UP);
a = createThumbnailEnterExitAnimationLocked(getThumbnailTransitionState(enter),
frame, transit, taskId);
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS_ANIM,
- "applyAnimation: anim=%s nextAppTransition=%s transit=%s isEntrance=%b "
- + "Callers=%s",
- a, mNextAppTransitionScaleUp
- ? "ANIM_THUMBNAIL_SCALE_UP" : "ANIM_THUMBNAIL_SCALE_DOWN",
- appTransitionToString(transit), enter, Debug.getCallers(3));
+ if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) {
+ String animName = mNextAppTransitionScaleUp ?
+ "ANIM_THUMBNAIL_SCALE_UP" : "ANIM_THUMBNAIL_SCALE_DOWN";
+ Slog.v(TAG, "applyAnimation:"
+ + " anim=" + a + " nextAppTransition=" + animName
+ + " transit=" + appTransitionToString(transit) + " isEntrance=" + enter
+ + " Callers=" + Debug.getCallers(3));
+ }
} else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_THUMBNAIL_ASPECT_SCALE_UP ||
mNextAppTransitionType == NEXT_TRANSIT_TYPE_THUMBNAIL_ASPECT_SCALE_DOWN) {
mNextAppTransitionScaleUp =
@@ -1694,27 +1701,30 @@ public class AppTransition implements Dump {
a = createAspectScaledThumbnailEnterExitAnimationLocked(
getThumbnailTransitionState(enter), uiMode, orientation, transit, frame,
insets, surfaceInsets, stableInsets, freeform, taskId);
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS_ANIM,
- "applyAnimation: anim=%s nextAppTransition=%s transit=%s isEntrance=%b "
- + "Callers=%s",
- a, mNextAppTransitionScaleUp
- ? "ANIM_THUMBNAIL_ASPECT_SCALE_UP"
- : "ANIM_THUMBNAIL_ASPECT_SCALE_DOWN",
- appTransitionToString(transit), enter, Debug.getCallers(3));
+ if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) {
+ String animName = mNextAppTransitionScaleUp ?
+ "ANIM_THUMBNAIL_ASPECT_SCALE_UP" : "ANIM_THUMBNAIL_ASPECT_SCALE_DOWN";
+ Slog.v(TAG, "applyAnimation:"
+ + " anim=" + a + " nextAppTransition=" + animName
+ + " transit=" + appTransitionToString(transit) + " isEntrance=" + enter
+ + " Callers=" + Debug.getCallers(3));
+ }
} else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_OPEN_CROSS_PROFILE_APPS && enter) {
a = loadAnimationRes("android",
com.android.internal.R.anim.task_open_enter_cross_profile_apps);
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS_ANIM,
- "applyAnimation NEXT_TRANSIT_TYPE_OPEN_CROSS_PROFILE_APPS: "
- + "anim=%s transit=%s isEntrance=true Callers=%s",
- a, appTransitionToString(transit), Debug.getCallers(3));
+ Slog.v(TAG,
+ "applyAnimation NEXT_TRANSIT_TYPE_OPEN_CROSS_PROFILE_APPS:"
+ + " anim=" + a + " transit=" + appTransitionToString(transit)
+ + " isEntrance=true" + " Callers=" + Debug.getCallers(3));
} else if (transit == TRANSIT_TASK_CHANGE_WINDOWING_MODE) {
// In the absence of a specific adapter, we just want to keep everything stationary.
a = new AlphaAnimation(1.f, 1.f);
a.setDuration(WindowChangeAnimationSpec.ANIMATION_DURATION);
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS_ANIM,
- "applyAnimation: anim=%s transit=%s isEntrance=%b Callers=%s",
- a, appTransitionToString(transit), enter, Debug.getCallers(3));
+ if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) {
+ Slog.v(TAG, "applyAnimation:"
+ + " anim=" + a + " transit=" + appTransitionToString(transit)
+ + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3));
+ }
} else {
int animAttr = 0;
switch (transit) {
@@ -1777,11 +1787,12 @@ public class AppTransition implements Dump {
: WindowAnimation_launchTaskBehindTargetAnimation;
}
a = animAttr != 0 ? loadAnimationAttr(lp, animAttr, transit) : null;
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS_ANIM,
- "applyAnimation: anim=%s animAttr=0x%x transit=%s isEntrance=%b "
- + "Callers=%s",
- a, animAttr, appTransitionToString(transit), enter,
- Debug.getCallers(3));
+ if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG,
+ "applyAnimation:"
+ + " anim=" + a
+ + " animAttr=0x" + Integer.toHexString(animAttr)
+ + " transit=" + appTransitionToString(transit) + " isEntrance=" + enter
+ + " Callers=" + Debug.getCallers(3));
}
return a;
}
@@ -1930,8 +1941,8 @@ public class AppTransition implements Dump {
}
void overridePendingAppTransitionRemote(RemoteAnimationAdapter remoteAnimationAdapter) {
- ProtoLog.i(WM_DEBUG_APP_TRANSITIONS, "Override pending remote transitionSet=%b adapter=%s",
- isTransitionSet(), remoteAnimationAdapter);
+ if (DEBUG_APP_TRANSITIONS) Slog.i(TAG, "Override pending remote transitionSet="
+ + isTransitionSet() + " adapter=" + remoteAnimationAdapter);
if (isTransitionSet()) {
clear();
mNextAppTransitionType = NEXT_TRANSIT_TYPE_REMOTE;
@@ -2203,11 +2214,12 @@ public class AppTransition implements Dump {
*/
boolean prepareAppTransitionLocked(@TransitionType int transit, boolean alwaysKeepCurrent,
@TransitionFlags int flags, boolean forceOverride) {
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS,
- "Prepare app transition: transit=%s %s alwaysKeepCurrent=%b displayId=%d "
- + "Callers=%s",
- appTransitionToString(transit), this, alwaysKeepCurrent,
- mDisplayContent.getDisplayId(), Debug.getCallers(5));
+ if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "Prepare app transition:"
+ + " transit=" + appTransitionToString(transit)
+ + " " + this
+ + " alwaysKeepCurrent=" + alwaysKeepCurrent
+ + " displayId=" + mDisplayContent.getDisplayId()
+ + " Callers=" + Debug.getCallers(5));
final boolean allowSetCrashing = !isKeyguardTransit(mNextAppTransition)
&& transit == TRANSIT_CRASHING_ACTIVITY_CLOSE;
if (forceOverride || isKeyguardTransit(transit) || !isTransitionSet()
@@ -2293,14 +2305,15 @@ public class AppTransition implements Dump {
}
if (isTransitionSet() || !dc.mOpeningApps.isEmpty() || !dc.mClosingApps.isEmpty()
|| !dc.mChangingApps.isEmpty()) {
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS,
- "*** APP TRANSITION TIMEOUT. displayId=%d isTransitionSet()=%b "
- + "mOpeningApps.size()=%d mClosingApps.size()=%d "
- + "mChangingApps.size()=%d",
- dc.getDisplayId(), dc.mAppTransition.isTransitionSet(),
- dc.mOpeningApps.size(), dc.mClosingApps.size(),
- dc.mChangingApps.size());
-
+ if (DEBUG_APP_TRANSITIONS) {
+ Slog.v(TAG_WM, "*** APP TRANSITION TIMEOUT."
+ + " displayId=" + dc.getDisplayId()
+ + " isTransitionSet()="
+ + dc.mAppTransition.isTransitionSet()
+ + " mOpeningApps.size()=" + dc.mOpeningApps.size()
+ + " mClosingApps.size()=" + dc.mClosingApps.size()
+ + " mChangingApps.size()=" + dc.mChangingApps.size());
+ }
setTimeout();
mService.mWindowPlacerLocked.performSurfacePlacement();
}
diff --git a/services/core/java/com/android/server/wm/AppTransitionController.java b/services/core/java/com/android/server/wm/AppTransitionController.java
index b403aaccd9f1..6b2f9da77f62 100644
--- a/services/core/java/com/android/server/wm/AppTransitionController.java
+++ b/services/core/java/com/android/server/wm/AppTransitionController.java
@@ -48,7 +48,7 @@ import static com.android.server.wm.ActivityTaskManagerInternal.APP_TRANSITION_S
import static com.android.server.wm.ActivityTaskManagerInternal.APP_TRANSITION_SPLASH_SCREEN;
import static com.android.server.wm.ActivityTaskManagerInternal.APP_TRANSITION_WINDOWS_DRAWN;
import static com.android.server.wm.AppTransition.isKeyguardGoingAwayTransit;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_APP_TRANSITIONS;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_APP_TRANSITIONS;
import static com.android.server.wm.WindowManagerDebugConfig.SHOW_LIGHT_TRANSACTIONS;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
@@ -66,7 +66,6 @@ import android.view.WindowManager.LayoutParams;
import android.view.animation.Animation;
import com.android.internal.annotations.VisibleForTesting;
-import com.android.server.protolog.common.ProtoLog;
import java.util.function.Predicate;
@@ -105,7 +104,7 @@ public class AppTransitionController {
}
Trace.traceBegin(Trace.TRACE_TAG_WINDOW_MANAGER, "AppTransitionReady");
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS, "**** GOOD TO GO");
+ if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "**** GOOD TO GO");
final AppTransition appTransition = mDisplayContent.mAppTransition;
int transit = appTransition.getAppTransition();
if (mDisplayContent.mSkipAppTransitionAnimation && !isKeyguardGoingAwayTransit(transit)) {
@@ -349,7 +348,7 @@ public class AppTransitionController {
final int appsCount = openingApps.size();
for (int i = 0; i < appsCount; i++) {
AppWindowToken wtoken = openingApps.valueAt(i);
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS, "Now opening app %s", wtoken);
+ if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "Now opening app" + wtoken);
if (!wtoken.commitVisibility(animLp, true, transit, false, voiceInteraction)) {
// This token isn't going to be animating. Add it to the list of tokens to
@@ -384,7 +383,7 @@ public class AppTransitionController {
for (int i = 0; i < appsCount; i++) {
AppWindowToken wtoken = closingApps.valueAt(i);
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS, "Now closing app %s", wtoken);
+ if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "Now closing app " + wtoken);
// TODO: Do we need to add to mNoAnimationNotifyOnTransitionFinished like above if not
// animating?
wtoken.commitVisibility(animLp, false, transit, false, voiceInteraction);
@@ -411,7 +410,7 @@ public class AppTransitionController {
final int appsCount = apps.size();
for (int i = 0; i < appsCount; i++) {
AppWindowToken wtoken = apps.valueAt(i);
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS, "Now changing app %s", wtoken);
+ if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "Now changing app" + wtoken);
wtoken.cancelAnimationOnly();
wtoken.applyAnimationLocked(null, transit, true, false);
wtoken.updateReportedVisibilityLocked();
@@ -446,9 +445,10 @@ public class AppTransitionController {
}
private boolean transitionGoodToGo(ArraySet<AppWindowToken> apps, SparseIntArray outReasons) {
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS,
- "Checking %d opening apps (frozen=%b timeout=%b)...", apps.size(),
- mService.mDisplayFrozen, mDisplayContent.mAppTransition.isTimeout());
+ if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,
+ "Checking " + apps.size() + " opening apps (frozen="
+ + mService.mDisplayFrozen + " timeout="
+ + mDisplayContent.mAppTransition.isTimeout() + ")...");
final ScreenRotationAnimation screenRotationAnimation =
mService.mAnimator.getScreenRotationAnimationLocked(
Display.DEFAULT_DISPLAY);
@@ -463,18 +463,20 @@ public class AppTransitionController {
// app transition.
if (screenRotationAnimation != null && screenRotationAnimation.isAnimating() &&
mDisplayContent.getDisplayRotation().needsUpdate()) {
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS,
- "Delaying app transition for screen rotation animation to finish");
+ if (DEBUG_APP_TRANSITIONS) {
+ Slog.v(TAG, "Delaying app transition for screen rotation animation to finish");
+ }
return false;
}
for (int i = 0; i < apps.size(); i++) {
AppWindowToken wtoken = apps.valueAt(i);
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS,
- "Check opening app=%s: allDrawn=%b startingDisplayed=%b "
- + "startingMoved=%b isRelaunching()=%b startingWindow=%s",
- wtoken, wtoken.allDrawn, wtoken.startingDisplayed,
- wtoken.startingMoved, wtoken.isRelaunching(),
- wtoken.startingWindow);
+ if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,
+ "Check opening app=" + wtoken + ": allDrawn="
+ + wtoken.allDrawn + " startingDisplayed="
+ + wtoken.startingDisplayed + " startingMoved="
+ + wtoken.startingMoved + " isRelaunching()="
+ + wtoken.isRelaunching() + " startingWindow="
+ + wtoken.startingWindow);
final boolean allDrawn = wtoken.allDrawn && !wtoken.isRelaunching();
@@ -494,13 +496,15 @@ public class AppTransitionController {
// We also need to wait for the specs to be fetched, if needed.
if (mDisplayContent.mAppTransition.isFetchingAppTransitionsSpecs()) {
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS, "isFetchingAppTransitionSpecs=true");
+ if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "isFetchingAppTransitionSpecs=true");
return false;
}
if (!mDisplayContent.mUnknownAppVisibilityController.allResolved()) {
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS, "unknownApps is not empty: %s",
- mDisplayContent.mUnknownAppVisibilityController.getDebugMessage());
+ if (DEBUG_APP_TRANSITIONS) {
+ Slog.v(TAG, "unknownApps is not empty: "
+ + mDisplayContent.mUnknownAppVisibilityController.getDebugMessage());
+ }
return false;
}
@@ -545,20 +549,22 @@ public class AppTransitionController {
true /* ignoreHidden */);
boolean openingCanBeWallpaperTarget = canBeWallpaperTarget(openingApps);
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS,
- "New wallpaper target=%s, oldWallpaper=%s, openingApps=%s, closingApps=%s",
- wallpaperTarget, oldWallpaper, openingApps, closingApps);
+ if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,
+ "New wallpaper target=" + wallpaperTarget
+ + ", oldWallpaper=" + oldWallpaper
+ + ", openingApps=" + openingApps
+ + ", closingApps=" + closingApps);
if (openingCanBeWallpaperTarget && transit == TRANSIT_KEYGUARD_GOING_AWAY) {
transit = TRANSIT_KEYGUARD_GOING_AWAY_ON_WALLPAPER;
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS,
- "New transit: %s", AppTransition.appTransitionToString(transit));
+ if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,
+ "New transit: " + AppTransition.appTransitionToString(transit));
}
// We never want to change from a Keyguard transit to a non-Keyguard transit, as our logic
// relies on the fact that we always execute a Keyguard transition after preparing one.
else if (!isKeyguardGoingAwayTransit(transit)) {
if (closingAppHasWallpaper && openingAppHasWallpaper) {
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS, "Wallpaper animation!");
+ if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "Wallpaper animation!");
switch (transit) {
case TRANSIT_ACTIVITY_OPEN:
case TRANSIT_TASK_OPEN:
@@ -571,17 +577,16 @@ public class AppTransitionController {
transit = TRANSIT_WALLPAPER_INTRA_CLOSE;
break;
}
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS,
- "New transit: %s", AppTransition.appTransitionToString(transit));
+ if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,
+ "New transit: " + AppTransition.appTransitionToString(transit));
} else if (oldWallpaper != null && !mDisplayContent.mOpeningApps.isEmpty()
&& !openingApps.contains(oldWallpaper.mAppToken)
&& closingApps.contains(oldWallpaper.mAppToken)
&& topClosingApp == oldWallpaper.mAppToken) {
// We are transitioning from an activity with a wallpaper to one without.
transit = TRANSIT_WALLPAPER_CLOSE;
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS,
- "New transit away from wallpaper: %s",
- AppTransition.appTransitionToString(transit));
+ if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "New transit away from wallpaper: "
+ + AppTransition.appTransitionToString(transit));
} else if (wallpaperTarget != null && wallpaperTarget.isVisibleLw()
&& openingApps.contains(wallpaperTarget.mAppToken)
&& topOpeningApp == wallpaperTarget.mAppToken
@@ -589,8 +594,8 @@ public class AppTransitionController {
// We are transitioning from an activity without
// a wallpaper to now showing the wallpaper
transit = TRANSIT_WALLPAPER_OPEN;
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS, "New transit into wallpaper: %s",
- AppTransition.appTransitionToString(transit));
+ if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "New transit into wallpaper: "
+ + AppTransition.appTransitionToString(transit));
}
}
return transit;
@@ -717,7 +722,8 @@ public class AppTransitionController {
final WindowState win = mDisplayContent.findFocusedWindow();
if (win != null) {
final AppWindowToken wtoken = win.mAppToken;
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS, "Now animating app in place %s", wtoken);
+ if (DEBUG_APP_TRANSITIONS)
+ Slog.v(TAG, "Now animating app in place " + wtoken);
wtoken.cancelAnimation();
wtoken.applyAnimationLocked(null, transit, false, false);
wtoken.updateReportedVisibilityLocked();
diff --git a/services/core/java/com/android/server/wm/AppWindowThumbnail.java b/services/core/java/com/android/server/wm/AppWindowThumbnail.java
index 2b05024415b9..b52ade415bd4 100644
--- a/services/core/java/com/android/server/wm/AppWindowThumbnail.java
+++ b/services/core/java/com/android/server/wm/AppWindowThumbnail.java
@@ -22,7 +22,7 @@ import static android.view.SurfaceControl.METADATA_WINDOW_TYPE;
import static com.android.server.wm.AppWindowThumbnailProto.HEIGHT;
import static com.android.server.wm.AppWindowThumbnailProto.SURFACE_ANIMATOR;
import static com.android.server.wm.AppWindowThumbnailProto.WIDTH;
-import static com.android.server.wm.ProtoLogGroup.WM_SHOW_TRANSACTIONS;
+import static com.android.server.wm.WindowManagerDebugConfig.SHOW_TRANSACTIONS;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
import static com.android.server.wm.WindowManagerService.MAX_ANIMATION_DURATION;
@@ -31,6 +31,7 @@ import android.graphics.GraphicBuffer;
import android.graphics.PixelFormat;
import android.graphics.Point;
import android.os.Binder;
+import android.util.Slog;
import android.util.proto.ProtoOutputStream;
import android.view.Surface;
import android.view.SurfaceControl;
@@ -38,7 +39,6 @@ import android.view.SurfaceControl.Builder;
import android.view.SurfaceControl.Transaction;
import android.view.animation.Animation;
-import com.android.server.protolog.common.ProtoLog;
import com.android.server.wm.SurfaceAnimator.Animatable;
import java.util.function.Supplier;
@@ -104,7 +104,9 @@ class AppWindowThumbnail implements Animatable {
window != null ? window.mOwnerUid : Binder.getCallingUid())
.build();
- ProtoLog.i(WM_SHOW_TRANSACTIONS, " THUMBNAIL %s: CREATE", mSurfaceControl);
+ if (SHOW_TRANSACTIONS) {
+ Slog.i(TAG, " THUMBNAIL " + mSurfaceControl + ": CREATE");
+ }
// Transfer the thumbnail to the surface
drawSurface.copyFrom(mSurfaceControl);
diff --git a/services/core/java/com/android/server/wm/AppWindowToken.java b/services/core/java/com/android/server/wm/AppWindowToken.java
index 71d7445f98cd..f647fe46f067 100644
--- a/services/core/java/com/android/server/wm/AppWindowToken.java
+++ b/services/core/java/com/android/server/wm/AppWindowToken.java
@@ -62,16 +62,17 @@ import static com.android.server.wm.AppWindowTokenProto.STARTING_MOVED;
import static com.android.server.wm.AppWindowTokenProto.STARTING_WINDOW;
import static com.android.server.wm.AppWindowTokenProto.THUMBNAIL;
import static com.android.server.wm.AppWindowTokenProto.WINDOW_TOKEN;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_ADD_REMOVE;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_APP_TRANSITIONS;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_APP_TRANSITIONS_ANIM;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_FOCUS_LIGHT;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_ORIENTATION;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_STARTING_WINDOW;
+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_APP_TRANSITIONS;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_FOCUS_LIGHT;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_LAYOUT_REPEATS;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ORIENTATION;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_STARTING_WINDOW;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_STARTING_WINDOW_VERBOSE;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_TOKEN_MOVEMENT;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_VISIBILITY;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WINDOW_MOVEMENT;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
import static com.android.server.wm.WindowManagerService.H.NOTIFY_ACTIVITY_DRAWN;
@@ -123,7 +124,6 @@ import com.android.server.LocalServices;
import com.android.server.display.color.ColorDisplayService;
import com.android.server.policy.WindowManagerPolicy;
import com.android.server.policy.WindowManagerPolicy.StartingSurface;
-import com.android.server.protolog.common.ProtoLog;
import com.android.server.wm.RemoteAnimationController.RemoteAnimationRecord;
import com.android.server.wm.WindowManagerService.H;
@@ -388,8 +388,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
removeDeadWindows();
if (startingWindow != null) {
- ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Finish starting %s"
- + ": first real window is shown, no animation", win.mToken);
+ if (DEBUG_STARTING_WINDOW || DEBUG_ANIM) Slog.v(TAG, "Finish starting "
+ + win.mToken + ": first real window is shown, no animation");
// If this initial window is animating, stop it -- we will do an animation to reveal
// it from behind the starting window, so there is no need for it to also be doing its
// own stuff.
@@ -480,9 +480,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
if (mClientHidden == hideClient || (hideClient && mDeferHidingClient)) {
return;
}
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS,
- "setClientHidden: %s clientHidden=%b Callers=%s", this, hideClient,
- Debug.getCallers(5));
+ if (DEBUG_APP_TRANSITIONS) Slog.v(TAG_WM, "setClientHidden: " + this
+ + " clientHidden=" + hideClient + " Callers=" + Debug.getCallers(5));
mClientHidden = hideClient;
sendAppVisibilityToClients();
}
@@ -508,10 +507,12 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
return;
}
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS,
- "setAppVisibility(%s, visible=%b): %s hidden=%b hiddenRequested=%b Callers=%s",
- appToken, visible, appTransition, isHidden(), hiddenRequested,
- Debug.getCallers(6));
+ if (DEBUG_APP_TRANSITIONS || DEBUG_ORIENTATION) {
+ Slog.v(TAG_WM, "setAppVisibility("
+ + appToken + ", visible=" + visible + "): " + appTransition
+ + " hidden=" + isHidden() + " hiddenRequested="
+ + hiddenRequested + " Callers=" + Debug.getCallers(6));
+ }
final DisplayContent displayContent = getDisplayContent();
displayContent.mOpeningApps.remove(this);
@@ -569,7 +570,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
requestUpdateWallpaperIfNeeded();
- ProtoLog.v(WM_DEBUG_ADD_REMOVE, "No longer Stopped: %s", this);
+ if (DEBUG_ADD_REMOVE) Slog.v(TAG_WM, "No longer Stopped: " + this);
mAppStopped = false;
transferStartingWindowFromHiddenAboveTokenIfNeeded();
@@ -592,10 +593,10 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
if (win != null) {
final AppWindowToken focusedToken = win.mAppToken;
if (focusedToken != null) {
- ProtoLog.d(WM_DEBUG_APP_TRANSITIONS,
- "TRANSIT_TASK_OPEN_BEHIND, adding %s to mOpeningApps",
- focusedToken);
-
+ if (DEBUG_APP_TRANSITIONS) {
+ Slog.d(TAG_WM, "TRANSIT_TASK_OPEN_BEHIND, "
+ + " adding " + focusedToken + " to mOpeningApps");
+ }
// Force animation to be loaded.
displayContent.mOpeningApps.add(focusedToken);
}
@@ -634,9 +635,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
final AccessibilityController accessibilityController =
mWmService.mAccessibilityController;
boolean changed = false;
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS,
- "Changing app %s hidden=%b performLayout=%b", this, isHidden(),
- performLayout);
+ if (DEBUG_APP_TRANSITIONS) Slog.v(TAG_WM,
+ "Changing app " + this + " hidden=" + isHidden() + " performLayout=" + performLayout);
boolean runningAppAnimation = false;
@@ -678,9 +678,10 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
forAllWindows(mWmService::makeWindowFreezingScreenIfNeededLocked, true);
}
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS,
- "commitVisibility: %s: hidden=%b hiddenRequested=%b", this,
- isHidden(), hiddenRequested);
+ if (DEBUG_APP_TRANSITIONS) {
+ Slog.v(TAG_WM, "commitVisibility: " + this
+ + ": hidden=" + isHidden() + " hiddenRequested=" + hiddenRequested);
+ }
if (changed) {
displayContent.getInputMonitor().setUpdateInputWindowsNeededLw();
@@ -883,7 +884,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
}
mRemovingFromDisplay = true;
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS, "Removing app token: %s", this);
+ if (DEBUG_APP_TRANSITIONS) Slog.v(TAG_WM, "Removing app token: " + this);
boolean delayed = commitVisibility(null, false, TRANSIT_UNSET, true, mVoiceInteraction);
@@ -899,12 +900,11 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
delayed = true;
}
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS,
- "Removing app %s delayed=%b animation=%s animating=%b", this, delayed,
- getAnimation(), isSelfAnimating());
+ if (DEBUG_APP_TRANSITIONS) Slog.v(TAG_WM, "Removing app " + this + " delayed=" + delayed
+ + " animation=" + getAnimation() + " animating=" + isSelfAnimating());
- ProtoLog.v(WM_DEBUG_ADD_REMOVE, "removeAppToken: %s"
- + " delayed=%b Callers=%s", this, delayed, Debug.getCallers(4));
+ if (DEBUG_ADD_REMOVE || DEBUG_TOKEN_MOVEMENT) Slog.v(TAG_WM, "removeAppToken: "
+ + this + " delayed=" + delayed + " Callers=" + Debug.getCallers(4));
if (mStartingData != null) {
removeStartingWindow();
@@ -920,8 +920,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
final TaskStack stack = getStack();
if (delayed && !isEmpty()) {
// set the token aside because it has an active animation to be finished
- ProtoLog.v(WM_DEBUG_ADD_REMOVE,
- "removeAppToken make exiting: %s", this);
+ if (DEBUG_ADD_REMOVE || DEBUG_TOKEN_MOVEMENT) Slog.v(TAG_WM,
+ "removeAppToken make exiting: " + this);
if (stack != null) {
stack.mExitingAppTokens.add(this);
}
@@ -941,9 +941,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
final DisplayContent dc = getDisplayContent();
if (dc.mFocusedApp == this) {
- ProtoLog.v(WM_DEBUG_FOCUS_LIGHT,
- "Removing focused app token:%s displayId=%d", this,
- dc.getDisplayId());
+ if (DEBUG_FOCUS_LIGHT) Slog.v(TAG_WM, "Removing focused app token:" + this
+ + " displayId=" + dc.getDisplayId());
dc.setFocusedApp(null);
mWmService.updateFocusedWindowLocked(UPDATE_FOCUS_NORMAL, true /*updateInputWindows*/);
}
@@ -1007,8 +1006,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
* up of the surfaces
*/
void notifyAppResumed(boolean wasStopped) {
- ProtoLog.v(WM_DEBUG_ADD_REMOVE, "notifyAppResumed: wasStopped=%b %s",
- wasStopped, this);
+ if (DEBUG_ADD_REMOVE) Slog.v(TAG, "notifyAppResumed: wasStopped=" + wasStopped
+ + " " + this);
mAppStopped = false;
// Allow the window to turn the screen on once the app is resumed again.
setCurrentLaunchCanTurnScreenOn(true);
@@ -1022,7 +1021,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
* keeping alive in case they were still being used.
*/
void notifyAppStopped() {
- ProtoLog.v(WM_DEBUG_ADD_REMOVE, "notifyAppStopped: %s", this);
+ if (DEBUG_ADD_REMOVE) Slog.v(TAG, "notifyAppStopped: " + this);
mAppStopped = true;
// Reset the last saved PiP snap fraction on app stop.
mDisplayContent.mPinnedStackControllerLocked.resetReentrySnapFraction(mActivityComponent);
@@ -1085,12 +1084,12 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
void postWindowRemoveStartingWindowCleanup(WindowState win) {
// TODO: Something smells about the code below...Is there a better way?
if (startingWindow == win) {
- ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Notify removed startingWindow %s", win);
+ if (DEBUG_STARTING_WINDOW) Slog.v(TAG_WM, "Notify removed startingWindow " + win);
removeStartingWindow();
} else if (mChildren.size() == 0) {
// If this is the last window and we had requested a starting transition window,
// well there is no point now.
- ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Nulling last startingData");
+ if (DEBUG_STARTING_WINDOW) Slog.v(TAG_WM, "Nulling last startingData");
mStartingData = null;
if (mHiddenSetFromTransferredStartingWindow) {
// We set the hidden state to false for the token from a transferred starting window.
@@ -1101,7 +1100,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
} else if (mChildren.size() == 1 && startingSurface != null && !isRelaunching()) {
// If this is the last window except for a starting transition window,
// we need to get rid of the starting transition.
- ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Last window, removing starting window %s", win);
+ if (DEBUG_STARTING_WINDOW) Slog.v(TAG_WM, "Last window, removing starting window "
+ + win);
removeStartingWindow();
}
}
@@ -1110,8 +1110,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
for (int winNdx = mChildren.size() - 1; winNdx >= 0; --winNdx) {
WindowState win = mChildren.get(winNdx);
if (win.mAppDied) {
- ProtoLog.w(WM_DEBUG_ADD_REMOVE,
- "removeDeadWindows: %s", win);
+ if (DEBUG_WINDOW_MOVEMENT || DEBUG_ADD_REMOVE) Slog.w(TAG,
+ "removeDeadWindows: " + win);
// Set mDestroying, we don't want any animation or delayed removal here.
win.mDestroying = true;
// Also removes child windows.
@@ -1132,8 +1132,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
}
void setWillReplaceWindows(boolean animate) {
- ProtoLog.d(WM_DEBUG_ADD_REMOVE,
- "Marking app token %s with replacing windows.", this);
+ if (DEBUG_ADD_REMOVE) Slog.d(TAG_WM,
+ "Marking app token " + this + " with replacing windows.");
for (int i = mChildren.size() - 1; i >= 0; i--) {
final WindowState w = mChildren.get(i);
@@ -1142,8 +1142,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
}
void setWillReplaceChildWindows() {
- ProtoLog.d(WM_DEBUG_ADD_REMOVE, "Marking app token %s"
- + " with replacing child windows.", this);
+ if (DEBUG_ADD_REMOVE) Slog.d(TAG_WM, "Marking app token " + this
+ + " with replacing child windows.");
for (int i = mChildren.size() - 1; i >= 0; i--) {
final WindowState w = mChildren.get(i);
w.setWillReplaceChildWindows();
@@ -1151,8 +1151,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
}
void clearWillReplaceWindows() {
- ProtoLog.d(WM_DEBUG_ADD_REMOVE,
- "Resetting app token %s of replacing window marks.", this);
+ if (DEBUG_ADD_REMOVE) Slog.d(TAG_WM,
+ "Resetting app token " + this + " of replacing window marks.");
for (int i = mChildren.size() - 1; i >= 0; i--) {
final WindowState w = mChildren.get(i);
@@ -1317,9 +1317,10 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
}
void reparent(Task task, int position) {
- ProtoLog.i(WM_DEBUG_ADD_REMOVE, "reparent: moving app token=%s"
- + " to task=%d at %d", this, task.mTaskId, position);
-
+ if (DEBUG_ADD_REMOVE) {
+ Slog.i(TAG_WM, "reparent: moving app token=" + this
+ + " to task=" + task.mTaskId + " at " + position);
+ }
if (task == null) {
throw new IllegalArgumentException("reparent: could not find task");
}
@@ -1335,8 +1336,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
+ " belongs to a different stack than " + task);
}
- ProtoLog.i(WM_DEBUG_ADD_REMOVE, "reParentWindowToken: removing window token=%s"
- + " from task=%s" , this, currentTask);
+ if (DEBUG_ADD_REMOVE) Slog.i(TAG, "reParentWindowToken: removing window token=" + this
+ + " from task=" + currentTask);
final DisplayContent prevDisplayContent = getDisplayContent();
mReparenting = true;
@@ -1456,10 +1457,9 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
}
void startFreezingScreen() {
- ProtoLog.i(WM_DEBUG_ORIENTATION,
- "Set freezing of %s: hidden=%b freezing=%b hiddenRequested=%b. %s",
- appToken, isHidden(), mFreezingScreen, hiddenRequested,
- new RuntimeException().fillInStackTrace());
+ if (DEBUG_ORIENTATION) logWithStack(TAG, "Set freezing of " + appToken + ": hidden="
+ + isHidden() + " freezing=" + mFreezingScreen + " hiddenRequested="
+ + hiddenRequested);
if (!hiddenRequested) {
if (!mFreezingScreen) {
mFreezingScreen = true;
@@ -1483,8 +1483,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
if (!mFreezingScreen) {
return;
}
- ProtoLog.v(WM_DEBUG_ORIENTATION,
- "Clear freezing of %s force=%b", this, force);
+ if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Clear freezing of " + this + " force=" + force);
final int count = mChildren.size();
boolean unfrozeWindows = false;
for (int i = 0; i < count; i++) {
@@ -1492,7 +1491,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
unfrozeWindows |= w.onStopFreezingScreen();
}
if (force || unfrozeWindows) {
- ProtoLog.v(WM_DEBUG_ORIENTATION, "No longer freezing: %s", this);
+ if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "No longer freezing: " + this);
mFreezingScreen = false;
mWmService.unregisterAppFreezeListener(this);
mWmService.mAppsFreezingScreen--;
@@ -1543,8 +1542,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
// letting windows get shown immediately without any more transitions.
getDisplayContent().mSkipAppTransitionAnimation = true;
- ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Moving existing starting %s"
- + " from %s to %s", tStartingWindow, fromToken, this);
+ if (DEBUG_STARTING_WINDOW) Slog.v(TAG_WM, "Moving existing starting " + tStartingWindow
+ + " from " + fromToken + " to " + this);
final long origId = Binder.clearCallingIdentity();
try {
@@ -1562,8 +1561,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
tStartingWindow.mToken = this;
tStartingWindow.mAppToken = this;
- ProtoLog.v(WM_DEBUG_ADD_REMOVE,
- "Removing starting %s from %s", tStartingWindow, fromToken);
+ if (DEBUG_ADD_REMOVE || DEBUG_STARTING_WINDOW) Slog.v(TAG_WM,
+ "Removing starting " + tStartingWindow + " from " + fromToken);
fromToken.removeChild(tStartingWindow);
fromToken.postWindowRemoveStartingWindowCleanup(tStartingWindow);
fromToken.mHiddenSetFromTransferredStartingWindow = false;
@@ -1604,8 +1603,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
} else if (fromToken.mStartingData != null) {
// The previous app was getting ready to show a
// starting window, but hasn't yet done so. Steal it!
- ProtoLog.v(WM_DEBUG_STARTING_WINDOW,
- "Moving pending starting from %s to %s", fromToken, this);
+ if (DEBUG_STARTING_WINDOW) Slog.v(TAG_WM,
+ "Moving pending starting from " + fromToken + " to " + this);
mStartingData = fromToken.mStartingData;
fromToken.mStartingData = null;
fromToken.startingMoved = true;
@@ -1877,10 +1876,9 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
if (mFreezingScreen) {
showAllWindowsLocked();
stopFreezingScreen(false, true);
- ProtoLog.i(WM_DEBUG_ORIENTATION,
- "Setting mOrientationChangeComplete=true because wtoken %s "
- + "numInteresting=%d numDrawn=%d",
- this, mNumInterestingWindows, mNumDrawnWindows);
+ if (DEBUG_ORIENTATION) Slog.i(TAG,
+ "Setting mOrientationChangeComplete=true because wtoken " + this
+ + " numInteresting=" + mNumInterestingWindows + " numDrawn=" + mNumDrawnWindows);
// This will set mOrientationChangeComplete and cause a pass through layout.
setAppLayoutChanges(FINISH_LAYOUT_REDO_WALLPAPER,
"checkAppWindowsReadyToShow: freezingScreen");
@@ -1984,7 +1982,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
boolean isInterestingAndDrawn = false;
if (!allDrawn && w.mightAffectAllDrawn()) {
- if (DEBUG_VISIBILITY || WM_DEBUG_ORIENTATION.isLogToLogcat()) {
+ if (DEBUG_VISIBILITY || DEBUG_ORIENTATION) {
Slog.v(TAG, "Eval win " + w + ": isDrawn=" + w.isDrawnLw()
+ ", isAnimationSet=" + isSelfAnimating());
if (!w.isDrawnLw()) {
@@ -2005,12 +2003,10 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
if (w.isDrawnLw()) {
mNumDrawnWindows++;
- if (DEBUG_VISIBILITY || WM_DEBUG_ORIENTATION.isLogToLogcat()) {
- Slog.v(TAG, "tokenMayBeDrawn: "
- + this + " w=" + w + " numInteresting=" + mNumInterestingWindows
- + " freezingScreen=" + mFreezingScreen
- + " mAppFreezing=" + w.mAppFreezing);
- }
+ if (DEBUG_VISIBILITY || DEBUG_ORIENTATION) Slog.v(TAG, "tokenMayBeDrawn: "
+ + this + " w=" + w + " numInteresting=" + mNumInterestingWindows
+ + " freezingScreen=" + mFreezingScreen
+ + " mAppFreezing=" + w.mAppFreezing);
isInterestingAndDrawn = true;
}
@@ -2126,7 +2122,9 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
// If this is a translucent window, then don't show a starting window -- the current
// effect (a full-screen opaque starting window that fades away to the real contents
// when it is ready) does not work for this.
- ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Checking theme of starting window: 0x%x", theme);
+ if (DEBUG_STARTING_WINDOW) {
+ Slog.v(TAG, "Checking theme of starting window: 0x" + Integer.toHexString(theme));
+ }
if (theme != 0) {
AttributeCache.Entry ent = AttributeCache.instance().get(pkg, theme,
com.android.internal.R.styleable.Window,
@@ -2144,8 +2142,11 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
com.android.internal.R.styleable.Window_windowShowWallpaper, false);
final boolean windowDisableStarting = ent.array.getBoolean(
com.android.internal.R.styleable.Window_windowDisablePreview, false);
- ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Translucent=%s Floating=%s ShowWallpaper=%s",
- windowIsTranslucent, windowIsFloating, windowShowWallpaper);
+ if (DEBUG_STARTING_WINDOW) {
+ Slog.v(TAG, "Translucent=" + windowIsTranslucent
+ + " Floating=" + windowIsFloating
+ + " ShowWallpaper=" + windowShowWallpaper);
+ }
if (windowIsTranslucent) {
return false;
}
@@ -2177,7 +2178,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
return false;
}
- ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Creating SplashScreenStartingData");
+ if (DEBUG_STARTING_WINDOW) Slog.v(TAG_WM, "Creating SplashScreenStartingData");
mStartingData = new SplashScreenStartingData(mWmService, pkg,
theme, compatInfo, nonLocalizedLabel, labelRes, icon, logo, windowFlags,
getMergedOverrideConfiguration());
@@ -2191,7 +2192,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
return false;
}
- ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Creating SnapshotStartingData");
+ if (DEBUG_STARTING_WINDOW) Slog.v(TAG_WM, "Creating SnapshotStartingData");
mStartingData = new SnapshotStartingData(mWmService, snapshot);
scheduleAddStartingWindow();
return true;
@@ -2202,7 +2203,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
// want to process the message ASAP, before any other queued
// messages.
if (!mWmService.mAnimationHandler.hasCallbacks(mAddStartingWindow)) {
- ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Enqueueing ADD_STARTING");
+ if (DEBUG_STARTING_WINDOW) Slog.v(TAG, "Enqueueing ADD_STARTING");
mWmService.mAnimationHandler.postAtFrontOfQueue(mAddStartingWindow);
}
}
@@ -2219,17 +2220,18 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
if (mStartingData == null) {
// Animation has been canceled... do nothing.
- ProtoLog.v(WM_DEBUG_STARTING_WINDOW,
- "startingData was nulled out before handling"
- + " mAddStartingWindow: %s", AppWindowToken.this);
+ if (DEBUG_STARTING_WINDOW) {
+ Slog.v(TAG, "startingData was nulled out before handling"
+ + " mAddStartingWindow: " + AppWindowToken.this);
+ }
return;
}
startingData = mStartingData;
}
- ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Add starting %s: startingData=%s",
- this, startingData);
-
+ if (DEBUG_STARTING_WINDOW) {
+ Slog.v(TAG, "Add starting " + this + ": startingData=" + startingData);
+ }
WindowManagerPolicy.StartingSurface surface = null;
try {
@@ -2243,28 +2245,27 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
// If the window was successfully added, then
// we need to remove it.
if (removed || mStartingData == null) {
- ProtoLog.v(WM_DEBUG_STARTING_WINDOW,
- "Aborted starting %s: removed=%b startingData=%s",
- AppWindowToken.this, removed, mStartingData);
-
+ if (DEBUG_STARTING_WINDOW) {
+ Slog.v(TAG, "Aborted starting " + AppWindowToken.this
+ + ": removed=" + removed + " startingData=" + mStartingData);
+ }
startingWindow = null;
mStartingData = null;
abort = true;
} else {
startingSurface = surface;
}
- if (!abort) {
- ProtoLog.v(WM_DEBUG_STARTING_WINDOW,
- "Added starting %s: startingWindow=%s startingView=%s",
- AppWindowToken.this, startingWindow, startingSurface);
+ if (DEBUG_STARTING_WINDOW && !abort) {
+ Slog.v(TAG,
+ "Added starting " + AppWindowToken.this + ": startingWindow="
+ + startingWindow + " startingView=" + startingSurface);
}
}
if (abort) {
surface.remove();
}
- } else {
- ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Surface returned was null: %s",
- AppWindowToken.this);
+ } else if (DEBUG_STARTING_WINDOW) {
+ Slog.v(TAG, "Surface returned was null: " + AppWindowToken.this);
}
}
};
@@ -2307,7 +2308,9 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
if (mStartingData != null) {
// Starting window has not been added yet, but it is scheduled to be added.
// Go ahead and cancel the request.
- ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Clearing startingData for token=%s", this);
+ if (DEBUG_STARTING_WINDOW) {
+ Slog.v(TAG_WM, "Clearing startingData for token=" + this);
+ }
mStartingData = null;
}
return;
@@ -2321,28 +2324,31 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
startingWindow = null;
startingDisplayed = false;
if (surface == null) {
- ProtoLog.v(WM_DEBUG_STARTING_WINDOW,
- "startingWindow was set but startingSurface==null, couldn't "
+ if (DEBUG_STARTING_WINDOW) {
+ Slog.v(TAG_WM, "startingWindow was set but startingSurface==null, couldn't "
+ "remove");
-
+ }
return;
}
} else {
- ProtoLog.v(WM_DEBUG_STARTING_WINDOW,
- "Tried to remove starting window but startingWindow was null: %s",
- this);
+ if (DEBUG_STARTING_WINDOW) {
+ Slog.v(TAG_WM, "Tried to remove starting window but startingWindow was null:"
+ + this);
+ }
return;
}
- ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Schedule remove starting %s startingWindow=%s"
- + " startingView=%s Callers=%s",
- this, startingWindow, startingSurface, Debug.getCallers(5));
-
+ if (DEBUG_STARTING_WINDOW) {
+ Slog.v(TAG_WM, "Schedule remove starting " + this
+ + " startingWindow=" + startingWindow
+ + " startingView=" + startingSurface
+ + " Callers=" + Debug.getCallers(5));
+ }
// Use the same thread to remove the window as we used to add it, as otherwise we end up
// with things in the view hierarchy being called from different threads.
mWmService.mAnimationHandler.post(() -> {
- ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Removing startingView=%s", surface);
+ if (DEBUG_STARTING_WINDOW) Slog.v(TAG_WM, "Removing startingView=" + surface);
try {
surface.remove();
} catch (Exception e) {
@@ -2538,7 +2544,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
* Creates a layer to apply crop to an animation.
*/
private SurfaceControl createAnimationBoundsLayer(Transaction t) {
- ProtoLog.i(WM_DEBUG_APP_TRANSITIONS_ANIM, "Creating animation bounds layer");
+ if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.i(TAG, "Creating animation bounds layer");
final SurfaceControl.Builder builder = makeAnimationLeash()
.setParent(getAnimationLeashParent())
.setName(getSurfaceControl() + " - animation-bounds");
@@ -2574,9 +2580,10 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
boolean isVoiceInteraction) {
if (mWmService.mDisableTransitionAnimation || !shouldAnimate(transit)) {
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS_ANIM,
- "applyAnimation: transition animation is disabled or skipped. "
- + "atoken=%s", this);
+ if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) {
+ Slog.v(TAG_WM, "applyAnimation: transition animation is disabled or skipped."
+ + " atoken=" + this);
+ }
cancelAnimation();
return false;
}
@@ -2676,8 +2683,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
final DisplayInfo displayInfo = displayContent.getDisplayInfo();
final int width = displayInfo.appWidth;
final int height = displayInfo.appHeight;
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS_ANIM,
- "applyAnimation: atoken=%s", this);
+ if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG_WM,
+ "applyAnimation: atoken=" + this);
// Determine the visible rect to calculate the thumbnail clip
final WindowState win = findMainWindow();
@@ -2717,10 +2724,9 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
// screen gets the enter animation. Both appear in the mOpeningApps set.
enter = false;
}
- ProtoLog.d(WM_DEBUG_APP_TRANSITIONS,
- "Loading animation for app transition. transit=%s enter=%b frame=%s insets=%s "
- + "surfaceInsets=%s",
- AppTransition.appTransitionToString(transit), enter, frame, insets, surfaceInsets);
+ if (DEBUG_APP_TRANSITIONS) Slog.d(TAG_WM, "Loading animation for app transition."
+ + " transit=" + AppTransition.appTransitionToString(transit) + " enter=" + enter
+ + " frame=" + frame + " insets=" + insets + " surfaceInsets=" + surfaceInsets);
final Configuration displayConfig = displayContent.getConfiguration();
final Animation a = getDisplayContent().mAppTransition.loadAnimation(lp, transit, enter,
displayConfig.uiMode, displayConfig.orientation, frame, displayFrame, insets,
@@ -2976,7 +2982,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
final GraphicBuffer thumbnailHeader =
getDisplayContent().mAppTransition.getAppTransitionThumbnailHeader(taskId);
if (thumbnailHeader == null) {
- ProtoLog.d(WM_DEBUG_APP_TRANSITIONS, "No thumbnail header bitmap for: %d", taskId);
+ if (DEBUG_APP_TRANSITIONS) Slog.d(TAG, "No thumbnail header bitmap for: " + taskId);
return;
}
clearThumbnail();
diff --git a/services/core/java/com/android/server/wm/BlackFrame.java b/services/core/java/com/android/server/wm/BlackFrame.java
index 84c5f8c7d93a..7557271a2416 100644
--- a/services/core/java/com/android/server/wm/BlackFrame.java
+++ b/services/core/java/com/android/server/wm/BlackFrame.java
@@ -16,7 +16,8 @@
package com.android.server.wm;
-import static com.android.server.wm.ProtoLogGroup.WM_SHOW_SURFACE_ALLOC;
+import static com.android.server.wm.WindowManagerDebugConfig.SHOW_SURFACE_ALLOC;
+import static com.android.server.wm.WindowManagerDebugConfig.SHOW_TRANSACTIONS;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
import android.graphics.Matrix;
@@ -25,8 +26,6 @@ import android.util.Slog;
import android.view.Surface.OutOfResourcesException;
import android.view.SurfaceControl;
-import com.android.server.protolog.common.ProtoLog;
-
import java.io.PrintWriter;
import java.util.function.Supplier;
@@ -59,8 +58,8 @@ public class BlackFrame {
transaction.setLayer(surface, layer);
transaction.setPosition(surface, left, top);
transaction.show(surface);
- ProtoLog.i(WM_SHOW_SURFACE_ALLOC,
- " BLACK %s: CREATE layer=%d", surface, layer);
+ if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) Slog.i(TAG_WM,
+ " BLACK " + surface + ": CREATE layer=" + layer);
}
void setAlpha(SurfaceControl.Transaction t, float alpha) {
@@ -156,8 +155,8 @@ public class BlackFrame {
SurfaceControl.Transaction t = mTransactionFactory.get();
for (int i=0; i<mBlackSurfaces.length; i++) {
if (mBlackSurfaces[i] != null) {
- ProtoLog.i(WM_SHOW_SURFACE_ALLOC,
- " BLACK %s: DESTROY", mBlackSurfaces[i].surface);
+ if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) Slog.i(TAG_WM,
+ " BLACK " + mBlackSurfaces[i].surface + ": DESTROY");
t.remove(mBlackSurfaces[i].surface);
mBlackSurfaces[i] = null;
}
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java
index 09e2a4bf91e0..6462744703a3 100644
--- a/services/core/java/com/android/server/wm/DisplayContent.java
+++ b/services/core/java/com/android/server/wm/DisplayContent.java
@@ -100,21 +100,24 @@ import static com.android.server.wm.DisplayContentProto.ROTATION;
import static com.android.server.wm.DisplayContentProto.SCREEN_ROTATION_ANIMATION;
import static com.android.server.wm.DisplayContentProto.STACKS;
import static com.android.server.wm.DisplayContentProto.WINDOW_CONTAINER;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_ADD_REMOVE;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_APP_TRANSITIONS;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_FOCUS;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_FOCUS_LIGHT;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_ORIENTATION;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_SCREEN_ON;
-import static com.android.server.wm.ProtoLogGroup.WM_SHOW_TRANSACTIONS;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ADD_REMOVE;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_APP_TRANSITIONS;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_BOOT;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_DISPLAY;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_FOCUS;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_FOCUS_LIGHT;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_INPUT_METHOD;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_LAYOUT;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_LAYOUT_REPEATS;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ORIENTATION;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_SCREENSHOT;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_SCREEN_ON;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_STACK;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_TOKEN_MOVEMENT;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WALLPAPER_LIGHT;
import static com.android.server.wm.WindowManagerDebugConfig.SHOW_STACK_CRAWLS;
+import static com.android.server.wm.WindowManagerDebugConfig.SHOW_TRANSACTIONS;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
import static com.android.server.wm.WindowManagerService.H.REPORT_FOCUS_CHANGE;
@@ -130,6 +133,7 @@ import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_WILL_ASSIG
import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_WILL_PLACE_SURFACES;
import static com.android.server.wm.WindowManagerService.WINDOWS_FREEZING_SCREENS_TIMEOUT;
import static com.android.server.wm.WindowManagerService.dipToPixel;
+import static com.android.server.wm.WindowManagerService.logSurface;
import static com.android.server.wm.WindowState.EXCLUSION_LEFT;
import static com.android.server.wm.WindowState.EXCLUSION_RIGHT;
import static com.android.server.wm.WindowState.RESIZE_HANDLE_WIDTH_IN_DP;
@@ -198,7 +202,6 @@ import com.android.internal.util.function.pooled.PooledConsumer;
import com.android.internal.util.function.pooled.PooledLambda;
import com.android.server.AnimationThread;
import com.android.server.policy.WindowManagerPolicy;
-import com.android.server.protolog.common.ProtoLog;
import com.android.server.wm.utils.DisplayRotationUtil;
import com.android.server.wm.utils.RotationCache;
import com.android.server.wm.utils.WmDisplayCutout;
@@ -597,8 +600,8 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
private final ToBooleanFunction<WindowState> mFindFocusedWindow = w -> {
final AppWindowToken focusedApp = mFocusedApp;
- ProtoLog.v(WM_DEBUG_FOCUS, "Looking for focus: %s, flags=%d, canReceive=%b",
- w, w.mAttrs.flags, w.canReceiveKeys());
+ if (DEBUG_FOCUS) Slog.v(TAG_WM, "Looking for focus: " + w
+ + ", flags=" + w.mAttrs.flags + ", canReceive=" + w.canReceiveKeys());
if (!w.canReceiveKeys()) {
return false;
@@ -608,22 +611,22 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
// If this window's application has been removed, just skip it.
if (wtoken != null && (wtoken.removed || wtoken.sendingToBottom)) {
- ProtoLog.v(WM_DEBUG_FOCUS, "Skipping %s because %s", wtoken,
- (wtoken.removed ? "removed" : "sendingToBottom"));
+ if (DEBUG_FOCUS) Slog.v(TAG_WM, "Skipping " + wtoken + " because "
+ + (wtoken.removed ? "removed" : "sendingToBottom"));
return false;
}
if (focusedApp == null) {
- ProtoLog.v(WM_DEBUG_FOCUS_LIGHT,
- "findFocusedWindow: focusedApp=null using new focus @ %s", w);
+ if (DEBUG_FOCUS_LIGHT) Slog.v(TAG_WM, "findFocusedWindow: focusedApp=null"
+ + " using new focus @ " + w);
mTmpWindow = w;
return true;
}
if (!focusedApp.windowsAreFocusable()) {
// Current focused app windows aren't focusable...
- ProtoLog.v(WM_DEBUG_FOCUS_LIGHT, "findFocusedWindow: focusedApp windows not"
- + " focusable using new focus @ %s", w);
+ if (DEBUG_FOCUS_LIGHT) Slog.v(TAG_WM, "findFocusedWindow: focusedApp windows not"
+ + " focusable using new focus @ " + w);
mTmpWindow = w;
return true;
}
@@ -633,14 +636,14 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
if (wtoken != null && w.mAttrs.type != TYPE_APPLICATION_STARTING) {
if (focusedApp.compareTo(wtoken) > 0) {
// App stack below focused app stack. No focus for you!!!
- ProtoLog.v(WM_DEBUG_FOCUS_LIGHT,
- "findFocusedWindow: Reached focused app=%s", focusedApp);
+ if (DEBUG_FOCUS_LIGHT) Slog.v(TAG_WM,
+ "findFocusedWindow: Reached focused app=" + focusedApp);
mTmpWindow = null;
return true;
}
}
- ProtoLog.v(WM_DEBUG_FOCUS_LIGHT, "findFocusedWindow: Found new focus @ %s", w);
+ if (DEBUG_FOCUS_LIGHT) Slog.v(TAG_WM, "findFocusedWindow: Found new focus @ " + w);
mTmpWindow = w;
return true;
};
@@ -1331,7 +1334,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
forAllWindows(w -> {
if (w.mHasSurface && !rotateSeamlessly) {
- ProtoLog.v(WM_DEBUG_ORIENTATION, "Set mOrientationChanging of %s", w);
+ if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Set mOrientationChanging of " + w);
w.setOrientationChanging(true);
mWmService.mRoot.mOrientationChangeComplete = false;
w.mLastFreezeDuration = 0;
@@ -1995,9 +1998,8 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
if (mWmService.mDisplayFrozen) {
if (mLastWindowForcedOrientation != SCREEN_ORIENTATION_UNSPECIFIED) {
- ProtoLog.v(WM_DEBUG_ORIENTATION,
- "Display id=%d is frozen, return %d", mDisplayId,
- mLastWindowForcedOrientation);
+ if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Display id=" + mDisplayId
+ + " is frozen, return " + mLastWindowForcedOrientation);
// If the display is frozen, some activities may be in the middle of restarting, and
// thus have removed their old window. If the window has the flag to hide the lock
// screen, then the lock screen can re-appear and inflict its own orientation on us.
@@ -2009,9 +2011,8 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
// window. We don't want to check the show when locked window directly though as
// things aren't stable while the display is frozen, for example the window could be
// momentarily unavailable due to activity relaunch.
- ProtoLog.v(WM_DEBUG_ORIENTATION,
- "Display id=%d is frozen while keyguard locked, return %d",
- mDisplayId, getLastOrientation());
+ if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Display id=" + mDisplayId
+ + " is frozen while keyguard locked, return " + getLastOrientation());
return getLastOrientation();
}
} else {
@@ -2850,7 +2851,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
forAllWindows(mFindFocusedWindow, true /* traverseTopToBottom */);
if (mTmpWindow == null) {
- ProtoLog.v(WM_DEBUG_FOCUS_LIGHT, "findFocusedWindow: No focusable windows.");
+ if (DEBUG_FOCUS_LIGHT) Slog.v(TAG_WM, "findFocusedWindow: No focusable windows.");
return null;
}
return mTmpWindow;
@@ -2896,8 +2897,11 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
mWmService.mH.obtainMessage(REPORT_FOCUS_CHANGE, this).sendToTarget();
}
- ProtoLog.v(WM_DEBUG_FOCUS_LIGHT, "Changing focus from %s to %s displayId=%d Callers=%s",
- mCurrentFocus, newFocus, getDisplayId(), Debug.getCallers(4));
+ if (DEBUG_FOCUS_LIGHT || DEBUG) {
+ Slog.v(TAG_WM, "Changing focus from "
+ + mCurrentFocus + " to " + newFocus + " displayId=" + getDisplayId()
+ + " Callers=" + Debug.getCallers(4));
+ }
final WindowState oldFocus = mCurrentFocus;
mCurrentFocus = newFocus;
mLosingFocus.remove(newFocus);
@@ -3034,7 +3038,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
Slog.w(TAG_WM, "LEAKED SURFACE (app token hidden): "
+ w + " surface=" + wsa.mSurfaceController
+ " token=" + w.mAppToken);
- ProtoLog.i(WM_SHOW_TRANSACTIONS, "SURFACE LEAK DESTROY: %s", w);
+ if (SHOW_TRANSACTIONS) logSurface(w, "LEAK DESTROY", false);
wsa.destroySurface();
mTmpWindow = w;
}
@@ -3368,11 +3372,12 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
com.android.internal.R.bool.config_checkWallpaperAtBoot)
&& !mWmService.mOnlyCore;
- ProtoLog.i(WM_DEBUG_SCREEN_ON,
- "******** booted=%b msg=%b haveBoot=%b haveApp=%b haveWall=%b "
- + "wallEnabled=%b haveKeyguard=%b",
- mWmService.mSystemBooted, mWmService.mShowingBootMessages, mHaveBootMsg,
- mHaveApp, mHaveWallpaper, wallpaperEnabled, mHaveKeyguard);
+ if (DEBUG_SCREEN_ON || DEBUG_BOOT) Slog.i(TAG_WM,
+ "******** booted=" + mWmService.mSystemBooted
+ + " msg=" + mWmService.mShowingBootMessages
+ + " haveBoot=" + mHaveBootMsg + " haveApp=" + mHaveApp
+ + " haveWall=" + mHaveWallpaper + " wallEnabled=" + wallpaperEnabled
+ + " haveKeyguard=" + mHaveKeyguard);
// If we are turning on the screen to show the boot message, don't do it until the boot
// message is actually displayed.
@@ -4209,8 +4214,8 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
// associated with it will be removed as soon as their animations are
// complete.
cancelAnimation();
- ProtoLog.v(WM_DEBUG_ADD_REMOVE,
- "performLayout: App token exiting now removed %s", token);
+ if (DEBUG_ADD_REMOVE || DEBUG_TOKEN_MOVEMENT) Slog.v(TAG,
+ "performLayout: App token exiting now removed" + token);
token.removeIfPossible();
}
}
@@ -4240,15 +4245,15 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
final int orientation = super.getOrientation();
if (orientation != SCREEN_ORIENTATION_UNSET
&& orientation != SCREEN_ORIENTATION_BEHIND) {
- ProtoLog.v(WM_DEBUG_ORIENTATION,
- "App is requesting an orientation, return %d for display id=%d",
- orientation, mDisplayId);
+ if (DEBUG_ORIENTATION) Slog.v(TAG_WM,
+ "App is requesting an orientation, return " + orientation
+ + " for display id=" + mDisplayId);
return orientation;
}
- ProtoLog.v(WM_DEBUG_ORIENTATION,
- "No app is requesting an orientation, return %d for display id=%d",
- getLastOrientation(), mDisplayId);
+ if (DEBUG_ORIENTATION) Slog.v(TAG_WM,
+ "No app is requesting an orientation, return " + getLastOrientation()
+ + " for display id=" + mDisplayId);
// The next app has not been requested to be visible, so we keep the current orientation
// to prevent freezing/unfreezing the display too early.
return getLastOrientation();
@@ -4485,9 +4490,8 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
return SCREEN_ORIENTATION_UNSET;
}
}
- ProtoLog.v(WM_DEBUG_ORIENTATION,
- "%s forcing orientation to %d for display id=%d", win, req,
- mDisplayId);
+ if (DEBUG_ORIENTATION) Slog.v(TAG_WM, win + " forcing orientation to " + req
+ + " for display id=" + mDisplayId);
return (mLastWindowForcedOrientation = req);
}
@@ -4755,9 +4759,10 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
void executeAppTransition() {
if (mAppTransition.isTransitionSet()) {
- ProtoLog.w(WM_DEBUG_APP_TRANSITIONS,
- "Execute app transition: %s, displayId: %d Callers=%s",
- mAppTransition, mDisplayId, Debug.getCallers(5));
+ if (DEBUG_APP_TRANSITIONS) {
+ Slog.w(TAG_WM, "Execute app transition: " + mAppTransition + ", displayId: "
+ + mDisplayId + " Callers=" + Debug.getCallers(5));
+ }
mAppTransition.setReady();
mWmService.mWindowPlacerLocked.requestTraversal();
}
diff --git a/services/core/java/com/android/server/wm/DisplayPolicy.java b/services/core/java/com/android/server/wm/DisplayPolicy.java
index 7be4dbd99766..10d48c4d5282 100644
--- a/services/core/java/com/android/server/wm/DisplayPolicy.java
+++ b/services/core/java/com/android/server/wm/DisplayPolicy.java
@@ -98,9 +98,9 @@ import static com.android.server.policy.WindowManagerPolicy.TRANSIT_PREVIEW_DONE
import static com.android.server.policy.WindowManagerPolicy.TRANSIT_SHOW;
import static com.android.server.policy.WindowManagerPolicy.WindowManagerFuncs.LID_ABSENT;
import static com.android.server.wm.ActivityTaskManagerInternal.SleepToken;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_SCREEN_ON;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ANIM;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_LAYOUT;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_SCREEN_ON;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
@@ -168,7 +168,6 @@ import com.android.server.policy.WindowManagerPolicy.NavigationBarPosition;
import com.android.server.policy.WindowManagerPolicy.ScreenOnListener;
import com.android.server.policy.WindowManagerPolicy.WindowManagerFuncs;
import com.android.server.policy.WindowOrientationListener;
-import com.android.server.protolog.common.ProtoLog;
import com.android.server.statusbar.StatusBarManagerInternal;
import com.android.server.wallpaper.WallpaperManagerInternal;
import com.android.server.wm.utils.InsetUtils;
@@ -766,19 +765,19 @@ public class DisplayPolicy {
/** Return false if it is not ready to turn on. */
public boolean finishScreenTurningOn() {
synchronized (mLock) {
- ProtoLog.d(WM_DEBUG_SCREEN_ON,
- "finishScreenTurningOn: mAwake=%b, mScreenOnEarly=%b, "
- + "mScreenOnFully=%b, mKeyguardDrawComplete=%b, "
- + "mWindowManagerDrawComplete=%b",
- mAwake, mScreenOnEarly, mScreenOnFully, mKeyguardDrawComplete,
- mWindowManagerDrawComplete);
+ if (DEBUG_SCREEN_ON) Slog.d(TAG,
+ "finishScreenTurningOn: mAwake=" + mAwake
+ + ", mScreenOnEarly=" + mScreenOnEarly
+ + ", mScreenOnFully=" + mScreenOnFully
+ + ", mKeyguardDrawComplete=" + mKeyguardDrawComplete
+ + ", mWindowManagerDrawComplete=" + mWindowManagerDrawComplete);
if (mScreenOnFully || !mScreenOnEarly || !mWindowManagerDrawComplete
|| (mAwake && !mKeyguardDrawComplete)) {
return false;
}
- ProtoLog.i(WM_DEBUG_SCREEN_ON, "Finished screen turning on...");
+ if (DEBUG_SCREEN_ON) Slog.i(TAG, "Finished screen turning on...");
mScreenOnListener = null;
mScreenOnFully = true;
}
diff --git a/services/core/java/com/android/server/wm/DisplayRotation.java b/services/core/java/com/android/server/wm/DisplayRotation.java
index fafa1f99f6f9..4d188f4f1e19 100644
--- a/services/core/java/com/android/server/wm/DisplayRotation.java
+++ b/services/core/java/com/android/server/wm/DisplayRotation.java
@@ -23,8 +23,8 @@ import static android.view.WindowManager.LayoutParams.ROTATION_ANIMATION_ROTATE;
import static android.view.WindowManager.LayoutParams.ROTATION_ANIMATION_SEAMLESS;
import static com.android.server.policy.WindowManagerPolicy.WindowManagerFuncs.LID_OPEN;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_ORIENTATION;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ANIM;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ORIENTATION;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
import static com.android.server.wm.WindowManagerService.WINDOWS_FREEZING_SCREENS_ACTIVE;
@@ -58,7 +58,6 @@ import com.android.server.LocalServices;
import com.android.server.UiThread;
import com.android.server.policy.WindowManagerPolicy;
import com.android.server.policy.WindowOrientationListener;
-import com.android.server.protolog.common.ProtoLog;
import com.android.server.statusbar.StatusBarManagerInternal;
import java.io.PrintWriter;
@@ -400,7 +399,7 @@ public class DisplayRotation {
if (mDeferredRotationPauseCount > 0) {
// Rotation updates have been paused temporarily. Defer the update until updates
// have been resumed.
- ProtoLog.v(WM_DEBUG_ORIENTATION, "Deferring rotation, rotation is paused.");
+ if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Deferring rotation, rotation is paused.");
return false;
}
@@ -410,14 +409,14 @@ public class DisplayRotation {
// Rotation updates cannot be performed while the previous rotation change animation
// is still in progress. Skip this update. We will try updating again after the
// animation is finished and the display is unfrozen.
- ProtoLog.v(WM_DEBUG_ORIENTATION, "Deferring rotation, animation in progress.");
+ if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Deferring rotation, animation in progress.");
return false;
}
if (mService.mDisplayFrozen) {
// Even if the screen rotation animation has finished (e.g. isAnimating returns
// false), there is still some time where we haven't yet unfrozen the display. We
// also need to abort rotation here.
- ProtoLog.v(WM_DEBUG_ORIENTATION,
+ if (DEBUG_ORIENTATION) Slog.v(TAG_WM,
"Deferring rotation, still finishing previous rotation");
return false;
}
@@ -425,30 +424,30 @@ public class DisplayRotation {
if (!mService.mDisplayEnabled) {
// No point choosing a rotation if the display is not enabled.
- ProtoLog.v(WM_DEBUG_ORIENTATION, "Deferring rotation, display is not enabled.");
+ if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Deferring rotation, display is not enabled.");
return false;
}
final int oldRotation = mRotation;
final int lastOrientation = mLastOrientation;
final int rotation = rotationForOrientation(lastOrientation, oldRotation);
- ProtoLog.v(WM_DEBUG_ORIENTATION,
- "Computed rotation=%d for display id=%d based on lastOrientation=%d and "
- + "oldRotation=%d",
- rotation, displayId, lastOrientation, oldRotation);
+ if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Computed rotation=" + rotation + " for display id="
+ + displayId + " based on lastOrientation=" + lastOrientation
+ + " and oldRotation=" + oldRotation);
- ProtoLog.v(WM_DEBUG_ORIENTATION,
- "Display id=%d selected orientation %d, got rotation %d", displayId,
- lastOrientation, rotation);
+ if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Display id=" + displayId
+ + " selected orientation " + lastOrientation
+ + ", got rotation " + rotation);
if (oldRotation == rotation) {
// No change.
return false;
}
- ProtoLog.v(WM_DEBUG_ORIENTATION,
- "Display id=%d rotation changed to %d from %d, lastOrientation=%d",
- displayId, rotation, oldRotation, lastOrientation);
+ if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Display id=" + displayId
+ + " rotation changed to " + rotation
+ + " from " + oldRotation
+ + ", lastOrientation=" + lastOrientation);
if (DisplayContent.deltaRotation(rotation, oldRotation) != 2) {
mDisplayContent.mWaitingForConfig = true;
@@ -552,8 +551,9 @@ public class DisplayRotation {
mSeamlessRotationCount--;
}
if (mSeamlessRotationCount == 0) {
- ProtoLog.i(WM_DEBUG_ORIENTATION,
- "Performing post-rotate rotation after seamless rotation");
+ if (DEBUG_ORIENTATION) {
+ Slog.i(TAG, "Performing post-rotate rotation after seamless rotation");
+ }
// Finish seamless rotation.
mRotatingSeamlessly = false;
@@ -844,12 +844,11 @@ public class DisplayRotation {
// Could have been invoked due to screen turning on or off or
// change of the currently visible window's orientation.
- ProtoLog.v(WM_DEBUG_ORIENTATION,
- "screenOnEarly=%b, awake=%b, currentAppOrientation=%d, "
- + "orientationSensorEnabled=%b, keyguardDrawComplete=%b, "
- + "windowManagerDrawComplete=%b",
- screenOnEarly, awake, mCurrentAppOrientation, mOrientationListener.mEnabled,
- keyguardDrawComplete, windowManagerDrawComplete);
+ if (DEBUG_ORIENTATION) Slog.v(TAG, "screenOnEarly=" + screenOnEarly
+ + ", awake=" + awake + ", currentAppOrientation=" + mCurrentAppOrientation
+ + ", orientationSensorEnabled=" + mOrientationListener.mEnabled
+ + ", keyguardDrawComplete=" + keyguardDrawComplete
+ + ", windowManagerDrawComplete=" + windowManagerDrawComplete);
boolean disable = true;
// Note: We postpone the rotating of the screen until the keyguard as well as the
@@ -953,11 +952,14 @@ public class DisplayRotation {
*/
@VisibleForTesting
int rotationForOrientation(int orientation, int lastRotation) {
- ProtoLog.v(WM_DEBUG_ORIENTATION, "rotationForOrientation(orient=%d, last=%d); user=%d %s",
- orientation, lastRotation, mUserRotation,
- mUserRotationMode == WindowManagerPolicy.USER_ROTATION_LOCKED
- ? "USER_ROTATION_LOCKED" : ""
+ if (DEBUG_ORIENTATION) {
+ Slog.v(TAG, "rotationForOrientation(orient="
+ + orientation + ", last=" + lastRotation
+ + "); user=" + mUserRotation + " "
+ + (mUserRotationMode == WindowManagerPolicy.USER_ROTATION_LOCKED
+ ? "USER_ROTATION_LOCKED" : "")
);
+ }
if (isFixedToUserRotation()) {
return mUserRotation;
@@ -1370,7 +1372,7 @@ public class DisplayRotation {
@Override
public void onProposedRotationChanged(int rotation) {
- ProtoLog.v(WM_DEBUG_ORIENTATION, "onProposedRotationChanged, rotation=%d", rotation);
+ if (DEBUG_ORIENTATION) Slog.v(TAG, "onProposedRotationChanged, rotation=" + rotation);
Runnable r = mRunnableCache.get(rotation, null);
if (r == null) {
r = new UpdateRunnable(rotation);
@@ -1383,14 +1385,14 @@ public class DisplayRotation {
public void enable(boolean clearCurrentRotation) {
super.enable(clearCurrentRotation);
mEnabled = true;
- ProtoLog.v(WM_DEBUG_ORIENTATION, "Enabling listeners");
+ if (DEBUG_ORIENTATION) Slog.v(TAG, "Enabling listeners");
}
@Override
public void disable() {
super.disable();
mEnabled = false;
- ProtoLog.v(WM_DEBUG_ORIENTATION, "Disabling listeners");
+ if (DEBUG_ORIENTATION) Slog.v(TAG, "Disabling listeners");
}
}
diff --git a/services/core/java/com/android/server/wm/DragState.java b/services/core/java/com/android/server/wm/DragState.java
index 34820acfeccc..3c616945f762 100644
--- a/services/core/java/com/android/server/wm/DragState.java
+++ b/services/core/java/com/android/server/wm/DragState.java
@@ -19,10 +19,10 @@ package com.android.server.wm;
import static com.android.server.wm.DragDropController.MSG_ANIMATION_END;
import static com.android.server.wm.DragDropController.MSG_DRAG_END_TIMEOUT;
import static com.android.server.wm.DragDropController.MSG_TEAR_DOWN_DRAG_AND_DROP_INPUT;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_ORIENTATION;
-import static com.android.server.wm.ProtoLogGroup.WM_SHOW_TRANSACTIONS;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_DRAG;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ORIENTATION;
import static com.android.server.wm.WindowManagerDebugConfig.SHOW_LIGHT_TRANSACTIONS;
+import static com.android.server.wm.WindowManagerDebugConfig.SHOW_TRANSACTIONS;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
import android.animation.Animator;
@@ -58,7 +58,6 @@ import android.view.animation.Interpolator;
import com.android.internal.view.IDragAndDropPermissions;
import com.android.server.LocalServices;
-import com.android.server.protolog.common.ProtoLog;
import java.util.ArrayList;
@@ -301,7 +300,9 @@ class DragState {
mDragWindowHandle.frameBottom = mDisplaySize.y;
// Pause rotations before a drag.
- ProtoLog.d(WM_DEBUG_ORIENTATION, "Pausing rotation during drag");
+ if (DEBUG_ORIENTATION) {
+ Slog.d(TAG_WM, "Pausing rotation during drag");
+ }
mDisplayContent.getDisplayRotation().pause();
}
@@ -318,7 +319,9 @@ class DragState {
mDragApplicationHandle = null;
// Resume rotations after a drag.
- ProtoLog.d(WM_DEBUG_ORIENTATION, "Resuming rotation after drag");
+ if (DEBUG_ORIENTATION) {
+ Slog.d(TAG_WM, "Resuming rotation after drag");
+ }
mDisplayContent.getDisplayRotation().resume();
}
}
@@ -496,9 +499,10 @@ class DragState {
Slog.i(TAG_WM, ">>> OPEN TRANSACTION notifyMoveLocked");
}
mTransaction.setPosition(mSurfaceControl, x - mThumbOffsetX, y - mThumbOffsetY).apply();
- ProtoLog.i(WM_SHOW_TRANSACTIONS, "DRAG %s: pos=(%d,%d)", mSurfaceControl,
- (int) (x - mThumbOffsetX), (int) (y - mThumbOffsetY));
-
+ if (SHOW_TRANSACTIONS) {
+ Slog.i(TAG_WM, " DRAG " + mSurfaceControl + ": pos=(" + (int) (x - mThumbOffsetX) + ","
+ + (int) (y - mThumbOffsetY) + ")");
+ }
notifyLocationLocked(x, y);
}
diff --git a/services/core/java/com/android/server/wm/InputMonitor.java b/services/core/java/com/android/server/wm/InputMonitor.java
index 932b4fac4592..8e0531ce3652 100644
--- a/services/core/java/com/android/server/wm/InputMonitor.java
+++ b/services/core/java/com/android/server/wm/InputMonitor.java
@@ -26,7 +26,7 @@ import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_DISABLE_WALLP
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_KEYGUARD;
import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_FOCUS_LIGHT;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_FOCUS_LIGHT;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_INPUT;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_TASK_POSITIONING;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
@@ -49,7 +49,6 @@ import android.view.SurfaceControl;
import com.android.server.AnimationThread;
import com.android.server.policy.WindowManagerPolicy;
-import com.android.server.protolog.common.ProtoLog;
import java.io.PrintWriter;
import java.util.Set;
@@ -332,7 +331,9 @@ final class InputMonitor {
* Layer assignment is assumed to be complete by the time this is called.
*/
public void setInputFocusLw(WindowState newWindow, boolean updateInputWindows) {
- ProtoLog.d(WM_DEBUG_FOCUS_LIGHT, "Input focus has changed to %s", newWindow);
+ if (DEBUG_FOCUS_LIGHT || DEBUG_INPUT) {
+ Slog.d(TAG_WM, "Input focus has changed to " + newWindow);
+ }
if (newWindow != mInputFocus) {
if (newWindow != null && newWindow.canReceiveKeys()) {
diff --git a/services/core/java/com/android/server/wm/ProtoLogGroup.java b/services/core/java/com/android/server/wm/ProtoLogGroup.java
index 2e0ef14e4303..313ccebc778d 100644
--- a/services/core/java/com/android/server/wm/ProtoLogGroup.java
+++ b/services/core/java/com/android/server/wm/ProtoLogGroup.java
@@ -27,38 +27,8 @@ import com.android.server.protolog.common.ProtoLog;
* must be included in services.core.wm.protologgroups build target.
*/
public enum ProtoLogGroup implements IProtoLogGroup {
- WM_ERROR(true, true, true, Consts.TAG_WM),
- WM_DEBUG_ORIENTATION(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, true,
- Consts.TAG_WM),
- WM_DEBUG_FOCUS_LIGHT(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false,
- Consts.TAG_WM),
- WM_DEBUG_BOOT(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false,
- Consts.TAG_WM),
- WM_DEBUG_RESIZE(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false,
- Consts.TAG_WM),
- WM_DEBUG_ADD_REMOVE(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false,
- Consts.TAG_WM),
- WM_DEBUG_FOCUS(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false, Consts.TAG_WM),
- WM_DEBUG_STARTING_WINDOW(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false,
- Consts.TAG_WM),
- WM_SHOW_TRANSACTIONS(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false,
- Consts.TAG_WM),
- WM_SHOW_SURFACE_ALLOC(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false,
- Consts.TAG_WM),
- WM_DEBUG_APP_TRANSITIONS(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false,
- Consts.TAG_WM),
- WM_DEBUG_APP_TRANSITIONS_ANIM(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false,
- Consts.TAG_WM),
- WM_DEBUG_RECENTS_ANIMATIONS(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false,
- Consts.TAG_WM),
- WM_DEBUG_DRAW(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false, Consts.TAG_WM),
- WM_DEBUG_REMOTE_ANIMATIONS(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false,
- Consts.TAG_WM),
- WM_DEBUG_SCREEN_ON(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false, Consts.TAG_WM),
- WM_DEBUG_KEEP_SCREEN_ON(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false,
- Consts.TAG_WM),
- WM_DEBUG_WINDOW_MOVEMENT(Consts.ENABLE_DEBUG, Consts.ENABLE_LOG_TO_PROTO_DEBUG, false,
- Consts.TAG_WM),
+ GENERIC_WM(true, true, false, "WindowManager"),
+
TEST_GROUP(true, true, false, "WindowManagetProtoLogTest");
private final boolean mEnabled;
@@ -125,11 +95,4 @@ public enum ProtoLogGroup implements IProtoLogGroup {
"Test completed successfully: %b %d %o %x %e %g %f %% %s.",
true, 1, 2, 3, 0.4, 0.5, 0.6, "ok");
}
-
- private static class Consts {
- private static final String TAG_WM = "WindowManager";
-
- private static final boolean ENABLE_DEBUG = true;
- private static final boolean ENABLE_LOG_TO_PROTO_DEBUG = true;
- }
}
diff --git a/services/core/java/com/android/server/wm/RecentsAnimation.java b/services/core/java/com/android/server/wm/RecentsAnimation.java
index 31f4584cded9..5cabbd97b1f7 100644
--- a/services/core/java/com/android/server/wm/RecentsAnimation.java
+++ b/services/core/java/com/android/server/wm/RecentsAnimation.java
@@ -28,10 +28,10 @@ import static android.view.WindowManager.TRANSIT_NONE;
import static com.android.server.wm.ActivityStackSupervisor.PRESERVE_WINDOWS;
import static com.android.server.wm.BoundsAnimationController.BOUNDS;
import static com.android.server.wm.BoundsAnimationController.FADE_IN;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_RECENTS_ANIMATIONS;
import static com.android.server.wm.RecentsAnimationController.REORDER_KEEP_IN_PLACE;
import static com.android.server.wm.RecentsAnimationController.REORDER_MOVE_TO_ORIGINAL_POSITION;
import static com.android.server.wm.RecentsAnimationController.REORDER_MOVE_TO_TOP;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_RECENTS_ANIMATIONS;
import android.annotation.Nullable;
import android.app.ActivityOptions;
@@ -42,7 +42,6 @@ import android.os.Trace;
import android.util.Slog;
import android.view.IRecentsAnimationRunner;
-import com.android.server.protolog.common.ProtoLog;
import com.android.server.wm.RecentsAnimationController.RecentsAnimationCallbacks;
/**
@@ -52,6 +51,7 @@ import com.android.server.wm.RecentsAnimationController.RecentsAnimationCallback
class RecentsAnimation implements RecentsAnimationCallbacks,
ActivityDisplay.OnStackOrderChangedListener {
private static final String TAG = RecentsAnimation.class.getSimpleName();
+ private static final boolean DEBUG = DEBUG_RECENTS_ANIMATIONS;
private final ActivityTaskManagerService mService;
private final ActivityStackSupervisor mStackSupervisor;
@@ -101,8 +101,7 @@ class RecentsAnimation implements RecentsAnimationCallbacks,
* is updated to the current one.
*/
void preloadRecentsActivity() {
- ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, "Preload recents with %s",
- mTargetIntent);
+ if (DEBUG) Slog.d(TAG, "Preload recents with " + mTargetIntent);
ActivityStack targetStack = mDefaultDisplay.getStack(WINDOWING_MODE_UNDEFINED,
mTargetActivityType);
ActivityRecord targetActivity = getTargetActivity(targetStack);
@@ -117,8 +116,7 @@ class RecentsAnimation implements RecentsAnimationCallbacks,
// keeps the original stopped state.
targetActivity.ensureActivityConfiguration(0 /* globalChanges */,
false /* preserveWindow */, true /* ignoreVisibility */);
- ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, "Updated config=%s",
- targetActivity.getConfiguration());
+ if (DEBUG) Slog.d(TAG, "Updated config=" + targetActivity.getConfiguration());
}
} else {
// Create the activity record. Because the activity is invisible, this doesn't really
@@ -133,7 +131,7 @@ class RecentsAnimation implements RecentsAnimationCallbacks,
}
if (!targetActivity.attachedToProcess()) {
- ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, "Real start recents");
+ if (DEBUG) Slog.d(TAG, "Real start recents");
mStackSupervisor.startSpecificActivityLocked(targetActivity, false /* andResume */,
false /* checkConfig */);
// Make sure the activity won't be involved in transition.
@@ -157,7 +155,7 @@ class RecentsAnimation implements RecentsAnimationCallbacks,
}
void startRecentsActivity(IRecentsAnimationRunner recentsAnimationRunner) {
- ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, "startRecentsActivity(): intent=%s", mTargetIntent);
+ if (DEBUG) Slog.d(TAG, "startRecentsActivity(): intent=" + mTargetIntent);
Trace.traceBegin(TRACE_TAG_ACTIVITY_MANAGER, "RecentsAnimation#startRecentsActivity");
// TODO(multi-display) currently only support recents animation in default display.
@@ -165,9 +163,8 @@ class RecentsAnimation implements RecentsAnimationCallbacks,
mService.mRootActivityContainer.getDefaultDisplay().mDisplayContent;
if (!mWindowManager.canStartRecentsAnimation()) {
notifyAnimationCancelBeforeStart(recentsAnimationRunner);
- ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS,
- "Can't start recents animation, nextAppTransition=%s",
- dc.mAppTransition.getAppTransition());
+ if (DEBUG) Slog.d(TAG, "Can't start recents animation, nextAppTransition="
+ + dc.mAppTransition.getAppTransition());
return;
}
@@ -181,8 +178,7 @@ class RecentsAnimation implements RecentsAnimationCallbacks,
mRestoreTargetBehindStack = display.getStackAbove(targetStack);
if (mRestoreTargetBehindStack == null) {
notifyAnimationCancelBeforeStart(recentsAnimationRunner);
- ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS,
- "No stack above target stack=%s", targetStack);
+ if (DEBUG) Slog.d(TAG, "No stack above target stack=" + targetStack);
return;
}
}
@@ -205,8 +201,8 @@ class RecentsAnimation implements RecentsAnimationCallbacks,
if (hasExistingActivity) {
// Move the recents activity into place for the animation if it is not top most
mDefaultDisplay.moveStackBehindBottomMostVisibleStack(targetStack);
- ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, "Moved stack=%s behind stack=%s",
- targetStack, mDefaultDisplay.getStackAbove(targetStack));
+ if (DEBUG) Slog.d(TAG, "Moved stack=" + targetStack + " behind stack="
+ + mDefaultDisplay.getStackAbove(targetStack));
// If there are multiple tasks in the target stack (ie. the home stack, with 3p
// and default launchers coexisting), then move the task to the top as a part of
@@ -224,15 +220,17 @@ class RecentsAnimation implements RecentsAnimationCallbacks,
mTargetActivityType);
targetActivity = getTargetActivity(targetStack);
mDefaultDisplay.moveStackBehindBottomMostVisibleStack(targetStack);
- ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, "Moved stack=%s behind stack=%s",
- targetStack, mDefaultDisplay.getStackAbove(targetStack));
+ if (DEBUG) {
+ Slog.d(TAG, "Moved stack=" + targetStack + " behind stack="
+ + mDefaultDisplay.getStackAbove(targetStack));
+ }
mWindowManager.prepareAppTransition(TRANSIT_NONE, false);
mWindowManager.executeAppTransition();
// TODO: Maybe wait for app to draw in this particular case?
- ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, "Started intent=%s", mTargetIntent);
+ if (DEBUG) Slog.d(TAG, "Started intent=" + mTargetIntent);
}
// Mark the target activity as launch-behind to bump its visibility for the
@@ -270,9 +268,9 @@ class RecentsAnimation implements RecentsAnimationCallbacks,
private void finishAnimation(@RecentsAnimationController.ReorderMode int reorderMode,
boolean sendUserLeaveHint) {
synchronized (mService.mGlobalLock) {
- ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS,
- "onAnimationFinished(): controller=%s reorderMode=%d",
- mWindowManager.getRecentsAnimationController(), reorderMode);
+ if (DEBUG) Slog.d(TAG, "onAnimationFinished(): controller="
+ + mWindowManager.getRecentsAnimationController()
+ + " reorderMode=" + reorderMode);
// Unregister for stack order changes
mDefaultDisplay.unregisterStackOrderChangedListener(this);
@@ -310,10 +308,9 @@ class RecentsAnimation implements RecentsAnimationCallbacks,
final ActivityRecord targetActivity = targetStack != null
? targetStack.isInStackLocked(mLaunchedTargetActivity)
: null;
- ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS,
- "onAnimationFinished(): targetStack=%s targetActivity=%s "
- + "mRestoreTargetBehindStack=%s",
- targetStack, targetActivity, mRestoreTargetBehindStack);
+ if (DEBUG) Slog.d(TAG, "onAnimationFinished(): targetStack=" + targetStack
+ + " targetActivity=" + targetActivity
+ + " mRestoreTargetBehindStack=" + mRestoreTargetBehindStack);
if (targetActivity == null) {
return;
}
@@ -336,28 +333,25 @@ class RecentsAnimation implements RecentsAnimationCallbacks,
targetStack.moveToFront("RecentsAnimation.onAnimationFinished()");
}
- if (WM_DEBUG_RECENTS_ANIMATIONS.isLogToAny()) {
+ if (DEBUG) {
final ActivityStack topStack = getTopNonAlwaysOnTopStack();
if (topStack != targetStack) {
- ProtoLog.w(WM_DEBUG_RECENTS_ANIMATIONS,
- "Expected target stack=%s"
- + " to be top most but found stack=%s",
- targetStack, topStack);
+ Slog.w(TAG, "Expected target stack=" + targetStack
+ + " to be top most but found stack=" + topStack);
}
}
} else if (reorderMode == REORDER_MOVE_TO_ORIGINAL_POSITION){
// Restore the target stack to its previous position
final ActivityDisplay display = targetActivity.getDisplay();
display.moveStackBehindStack(targetStack, mRestoreTargetBehindStack);
- if (WM_DEBUG_RECENTS_ANIMATIONS.isLogToAny()) {
+ if (DEBUG) {
final ActivityStack aboveTargetStack =
mDefaultDisplay.getStackAbove(targetStack);
if (mRestoreTargetBehindStack != null
&& aboveTargetStack != mRestoreTargetBehindStack) {
- ProtoLog.w(WM_DEBUG_RECENTS_ANIMATIONS,
- "Expected target stack=%s to restored behind stack=%s but"
- + " it is behind stack=%s",
- targetStack, mRestoreTargetBehindStack, aboveTargetStack);
+ Slog.w(TAG, "Expected target stack=" + targetStack
+ + " to restored behind stack=" + mRestoreTargetBehindStack
+ + " but it is behind stack=" + aboveTargetStack);
}
}
} else {
@@ -408,7 +402,7 @@ class RecentsAnimation implements RecentsAnimationCallbacks,
@Override
public void onStackOrderChanged(ActivityStack stack) {
- ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, "onStackOrderChanged(): stack=%s", stack);
+ if (DEBUG) Slog.d(TAG, "onStackOrderChanged(): stack=" + stack);
if (mDefaultDisplay.getIndexOf(stack) == -1 || !stack.shouldBeVisible(null)) {
// The stack is not visible, so ignore this change
return;
diff --git a/services/core/java/com/android/server/wm/RecentsAnimationController.java b/services/core/java/com/android/server/wm/RecentsAnimationController.java
index bd27905e1a0f..795a2ca67ac3 100644
--- a/services/core/java/com/android/server/wm/RecentsAnimationController.java
+++ b/services/core/java/com/android/server/wm/RecentsAnimationController.java
@@ -29,8 +29,8 @@ import static com.android.server.policy.WindowManagerPolicy.FINISH_LAYOUT_REDO_W
import static com.android.server.wm.ActivityTaskManagerInternal.APP_TRANSITION_RECENTS_ANIM;
import static com.android.server.wm.AnimationAdapterProto.REMOTE;
import static com.android.server.wm.BoundsAnimationController.FADE_IN;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_RECENTS_ANIMATIONS;
import static com.android.server.wm.RemoteAnimationAdapterWrapperProto.TARGET;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_RECENTS_ANIMATIONS;
import static com.android.server.wm.WindowManagerInternal.AppTransitionListener;
import android.annotation.IntDef;
@@ -57,7 +57,6 @@ import android.view.SurfaceControl.Transaction;
import com.android.internal.annotations.VisibleForTesting;
import com.android.server.LocalServices;
import com.android.server.inputmethod.InputMethodManagerInternal;
-import com.android.server.protolog.common.ProtoLog;
import com.android.server.statusbar.StatusBarManagerInternal;
import com.android.server.wm.SurfaceAnimator.OnAnimationFinishedCallback;
import com.android.server.wm.utils.InsetUtils;
@@ -66,7 +65,6 @@ import com.google.android.collect.Sets;
import java.io.PrintWriter;
import java.util.ArrayList;
-import java.util.stream.Collectors;
/**
* Controls a single instance of the remote driven recents animation. In particular, this allows
@@ -180,8 +178,8 @@ public class RecentsAnimationController implements DeathRecipient {
@Override
public TaskSnapshot screenshotTask(int taskId) {
- ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS,
- "screenshotTask(%d): mCanceled=%b", taskId, mCanceled);
+ if (DEBUG_RECENTS_ANIMATIONS) Slog.d(TAG, "screenshotTask(" + taskId + "):"
+ + " mCanceled=" + mCanceled);
final long token = Binder.clearCallingIdentity();
try {
synchronized (mService.getWindowManagerLock()) {
@@ -210,8 +208,8 @@ public class RecentsAnimationController implements DeathRecipient {
@Override
public void finish(boolean moveHomeToTop, boolean sendUserLeaveHint) {
- ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS,
- "finish(%b): mCanceled=%b", moveHomeToTop, mCanceled);
+ if (DEBUG_RECENTS_ANIMATIONS) Slog.d(TAG, "finish(" + moveHomeToTop + "):"
+ + " mCanceled=" + mCanceled);
final long token = Binder.clearCallingIdentity();
try {
synchronized (mService.getWindowManagerLock()) {
@@ -252,8 +250,8 @@ public class RecentsAnimationController implements DeathRecipient {
@Override
public void setInputConsumerEnabled(boolean enabled) {
- ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS,
- "setInputConsumerEnabled(%s): mCanceled=%b", enabled, mCanceled);
+ if (DEBUG_RECENTS_ANIMATIONS) Slog.d(TAG, "setInputConsumerEnabled(" + enabled + "):"
+ + " mCanceled=" + mCanceled);
final long token = Binder.clearCallingIdentity();
try {
synchronized (mService.getWindowManagerLock()) {
@@ -394,8 +392,8 @@ public class RecentsAnimationController implements DeathRecipient {
final AppWindowToken recentsComponentAppToken =
targetStack.getTopChild().getTopFullscreenAppToken();
if (recentsComponentAppToken != null) {
- ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS,
- "setHomeApp(%s)", recentsComponentAppToken.getName());
+ if (DEBUG_RECENTS_ANIMATIONS) Slog.d(TAG, "setHomeApp("
+ + recentsComponentAppToken.getName() + ")");
mTargetAppToken = recentsComponentAppToken;
if (recentsComponentAppToken.windowsCanBeWallpaperTarget()) {
mDisplayContent.pendingLayoutChanges |= FINISH_LAYOUT_REDO_WALLPAPER;
@@ -420,7 +418,7 @@ public class RecentsAnimationController implements DeathRecipient {
@VisibleForTesting
AnimationAdapter addAnimation(Task task, boolean isRecentTaskInvisible) {
- ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, "addAnimation(%s)", task.getName());
+ if (DEBUG_RECENTS_ANIMATIONS) Slog.d(TAG, "addAnimation(" + task.getName() + ")");
final TaskAnimationAdapter taskAdapter = new TaskAnimationAdapter(task,
isRecentTaskInvisible);
task.startAnimation(task.getPendingTransaction(), taskAdapter, false /* hidden */);
@@ -431,8 +429,8 @@ public class RecentsAnimationController implements DeathRecipient {
@VisibleForTesting
void removeAnimation(TaskAnimationAdapter taskAdapter) {
- ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS,
- "removeAnimation(%d)", taskAdapter.mTask.mTaskId);
+ if (DEBUG_RECENTS_ANIMATIONS) Slog.d(TAG, "removeAnimation("
+ + taskAdapter.mTask.mTaskId + ")");
taskAdapter.mTask.setCanAffectSystemUiFlags(true);
taskAdapter.mCapturedFinishCallback.onAnimationFinished(taskAdapter);
mPendingAnimations.remove(taskAdapter);
@@ -440,14 +438,14 @@ public class RecentsAnimationController implements DeathRecipient {
@VisibleForTesting
void removeWallpaperAnimation(WallpaperAnimationAdapter wallpaperAdapter) {
- ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, "removeWallpaperAnimation()");
+ if (DEBUG_RECENTS_ANIMATIONS) Slog.d(TAG, "removeWallpaperAnimation()");
wallpaperAdapter.getLeashFinishedCallback().onAnimationFinished(wallpaperAdapter);
mPendingWallpaperAnimations.remove(wallpaperAdapter);
}
void startAnimation() {
- ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS,
- "startAnimation(): mPendingStart=%b mCanceled=%b", mPendingStart, mCanceled);
+ if (DEBUG_RECENTS_ANIMATIONS) Slog.d(TAG, "startAnimation(): mPendingStart=" + mPendingStart
+ + " mCanceled=" + mCanceled);
if (!mPendingStart || mCanceled) {
// Skip starting if we've already started or canceled the animation
return;
@@ -485,10 +483,13 @@ public class RecentsAnimationController implements DeathRecipient {
}
mRunner.onAnimationStart(mController, appTargets, wallpaperTargets, contentInsets,
minimizedHomeBounds);
- ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS,
- "startAnimation(): Notify animation start: %s",
- mPendingAnimations.stream()
- .map(anim->anim.mTask.mTaskId).collect(Collectors.toList()));
+ if (DEBUG_RECENTS_ANIMATIONS) {
+ Slog.d(TAG, "startAnimation(): Notify animation start:");
+ for (int i = 0; i < mPendingAnimations.size(); i++) {
+ final Task task = mPendingAnimations.get(i).mTask;
+ Slog.d(TAG, "\t" + task.mTaskId);
+ }
+ }
} catch (RemoteException e) {
Slog.e(TAG, "Failed to start recents animation", e);
}
@@ -512,7 +513,7 @@ public class RecentsAnimationController implements DeathRecipient {
}
private RemoteAnimationTarget[] createWallpaperAnimations() {
- ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, "createWallpaperAnimations()");
+ if (DEBUG_RECENTS_ANIMATIONS) Slog.d(TAG, "createWallpaperAnimations()");
return WallpaperAnimationAdapter.startWallpaperAnimations(mService, 0L, 0L,
adapter -> {
synchronized (mService.mGlobalLock) {
@@ -532,7 +533,7 @@ public class RecentsAnimationController implements DeathRecipient {
}
private void cancelAnimation(@ReorderMode int reorderMode, boolean screenshot, String reason) {
- ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, "cancelAnimation(): reason=%s", reason);
+ if (DEBUG_RECENTS_ANIMATIONS) Slog.d(TAG, "cancelAnimation(): reason=" + reason);
synchronized (mService.getWindowManagerLock()) {
if (mCanceled) {
// We've already canceled the animation
@@ -626,7 +627,9 @@ public class RecentsAnimationController implements DeathRecipient {
mRecentScreenshotAnimator = new SurfaceAnimator(
animatable,
() -> {
- ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, "mRecentScreenshotAnimator finish");
+ if (DEBUG_RECENTS_ANIMATIONS) {
+ Slog.d(TAG, "mRecentScreenshotAnimator finish");
+ }
mCallbacks.onAnimationFinished(reorderMode, false /* sendUserLeaveHint */);
}, mService);
mRecentScreenshotAnimator.transferAnimation(task.mSurfaceAnimator);
@@ -634,10 +637,9 @@ public class RecentsAnimationController implements DeathRecipient {
}
void cleanupAnimation(@ReorderMode int reorderMode) {
- ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS,
- "cleanupAnimation(): Notify animation finished mPendingAnimations=%d "
- + "reorderMode=%d",
- mPendingAnimations.size(), reorderMode);
+ if (DEBUG_RECENTS_ANIMATIONS) Slog.d(TAG,
+ "cleanupAnimation(): Notify animation finished mPendingAnimations="
+ + mPendingAnimations.size() + " reorderMode=" + reorderMode);
for (int i = mPendingAnimations.size() - 1; i >= 0; i--) {
final TaskAnimationAdapter taskAdapter = mPendingAnimations.get(i);
if (reorderMode == REORDER_MOVE_TO_TOP || reorderMode == REORDER_KEEP_IN_PLACE) {
diff --git a/services/core/java/com/android/server/wm/RemoteAnimationController.java b/services/core/java/com/android/server/wm/RemoteAnimationController.java
index 2b2ae927dd96..87bda4a545e1 100644
--- a/services/core/java/com/android/server/wm/RemoteAnimationController.java
+++ b/services/core/java/com/android/server/wm/RemoteAnimationController.java
@@ -17,8 +17,9 @@
package com.android.server.wm;
import static com.android.server.wm.AnimationAdapterProto.REMOTE;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_REMOTE_ANIMATIONS;
import static com.android.server.wm.RemoteAnimationAdapterWrapperProto.TARGET;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_APP_TRANSITIONS;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_REMOTE_ANIMATIONS;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
@@ -38,8 +39,6 @@ import android.view.SurfaceControl;
import android.view.SurfaceControl.Transaction;
import com.android.internal.util.FastPrintWriter;
-import com.android.server.protolog.ProtoLogImpl;
-import com.android.server.protolog.common.ProtoLog;
import com.android.server.wm.SurfaceAnimator.OnAnimationFinishedCallback;
import com.android.server.wm.utils.InsetUtils;
@@ -52,6 +51,7 @@ import java.util.ArrayList;
*/
class RemoteAnimationController implements DeathRecipient {
private static final String TAG = TAG_WITH_CLASS_NAME
+ || (DEBUG_REMOTE_ANIMATIONS && !DEBUG_APP_TRANSITIONS)
? "RemoteAnimationController" : TAG_WM;
private static final long TIMEOUT_MS = 2000;
@@ -86,8 +86,8 @@ class RemoteAnimationController implements DeathRecipient {
*/
RemoteAnimationRecord createRemoteAnimationRecord(AppWindowToken appWindowToken,
Point position, Rect stackBounds, Rect startBounds) {
- ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "createAnimationAdapter(): token=%s",
- appWindowToken);
+ if (DEBUG_REMOTE_ANIMATIONS) Slog.d(TAG, "createAnimationAdapter(): token="
+ + appWindowToken);
final RemoteAnimationRecord adapters =
new RemoteAnimationRecord(appWindowToken, position, stackBounds, startBounds);
mPendingAnimations.add(adapters);
@@ -98,11 +98,11 @@ class RemoteAnimationController implements DeathRecipient {
* Called when the transition is ready to be started, and all leashes have been set up.
*/
void goodToGo() {
- ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "goodToGo()");
+ if (DEBUG_REMOTE_ANIMATIONS) Slog.d(TAG, "goodToGo()");
if (mPendingAnimations.isEmpty() || mCanceled) {
- ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS,
- "goodToGo(): Animation finished already, canceled=%s mPendingAnimations=%d",
- mCanceled, mPendingAnimations.size());
+ if (DEBUG_REMOTE_ANIMATIONS) Slog.d(TAG, "goodToGo(): Animation finished already,"
+ + " canceled=" + mCanceled
+ + " mPendingAnimations=" + mPendingAnimations.size());
onAnimationFinished();
return;
}
@@ -115,7 +115,7 @@ class RemoteAnimationController implements DeathRecipient {
// Create the app targets
final RemoteAnimationTarget[] appTargets = createAppAnimations();
if (appTargets.length == 0) {
- ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "goodToGo(): No apps to animate");
+ if (DEBUG_REMOTE_ANIMATIONS) Slog.d(TAG, "goodToGo(): No apps to animate");
onAnimationFinished();
return;
}
@@ -131,8 +131,8 @@ class RemoteAnimationController implements DeathRecipient {
Slog.e(TAG, "Failed to start remote animation", e);
onAnimationFinished();
}
- if (ProtoLogImpl.isEnabled(WM_DEBUG_REMOTE_ANIMATIONS)) {
- ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "startAnimation(): Notify animation start:");
+ if (DEBUG_REMOTE_ANIMATIONS) {
+ Slog.d(TAG, "startAnimation(): Notify animation start:");
writeStartDebugStatement();
}
});
@@ -140,7 +140,7 @@ class RemoteAnimationController implements DeathRecipient {
}
void cancelAnimation(String reason) {
- ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "cancelAnimation(): reason=%s", reason);
+ if (DEBUG_REMOTE_ANIMATIONS) Slog.d(TAG, "cancelAnimation(): reason=" + reason);
synchronized (mService.getWindowManagerLock()) {
if (mCanceled) {
return;
@@ -152,28 +152,28 @@ class RemoteAnimationController implements DeathRecipient {
}
private void writeStartDebugStatement() {
- ProtoLog.i(WM_DEBUG_REMOTE_ANIMATIONS, "Starting remote animation");
+ Slog.i(TAG, "Starting remote animation");
final StringWriter sw = new StringWriter();
final FastPrintWriter pw = new FastPrintWriter(sw);
for (int i = mPendingAnimations.size() - 1; i >= 0; i--) {
mPendingAnimations.get(i).mAdapter.dump(pw, "");
}
pw.close();
- ProtoLog.i(WM_DEBUG_REMOTE_ANIMATIONS, "%s", sw.toString());
+ Slog.i(TAG, sw.toString());
}
private RemoteAnimationTarget[] createAppAnimations() {
- ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "createAppAnimations()");
+ if (DEBUG_REMOTE_ANIMATIONS) Slog.d(TAG, "createAppAnimations()");
final ArrayList<RemoteAnimationTarget> targets = new ArrayList<>();
for (int i = mPendingAnimations.size() - 1; i >= 0; i--) {
final RemoteAnimationRecord wrappers = mPendingAnimations.get(i);
final RemoteAnimationTarget target = wrappers.createRemoteAnimationTarget();
if (target != null) {
- ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "\tAdd token=%s", wrappers.mAppWindowToken);
+ if (DEBUG_REMOTE_ANIMATIONS) Slog.d(TAG, "\tAdd token=" + wrappers.mAppWindowToken);
targets.add(target);
} else {
- ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "\tRemove token=%s",
- wrappers.mAppWindowToken);
+ if (DEBUG_REMOTE_ANIMATIONS) Slog.d(TAG, "\tRemove token="
+ + wrappers.mAppWindowToken);
// We can't really start an animation but we still need to make sure to finish the
// pending animation that was started by SurfaceAnimator
@@ -194,7 +194,7 @@ class RemoteAnimationController implements DeathRecipient {
}
private RemoteAnimationTarget[] createWallpaperAnimations() {
- ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "createWallpaperAnimations()");
+ if (DEBUG_REMOTE_ANIMATIONS) Slog.d(TAG, "createWallpaperAnimations()");
return WallpaperAnimationAdapter.startWallpaperAnimations(mService,
mRemoteAnimationAdapter.getDuration(),
mRemoteAnimationAdapter.getStatusBarTransitionDelay(),
@@ -207,15 +207,15 @@ class RemoteAnimationController implements DeathRecipient {
}
private void onAnimationFinished() {
- ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "onAnimationFinished(): mPendingAnimations=%d",
- mPendingAnimations.size());
+ if (DEBUG_REMOTE_ANIMATIONS) Slog.d(TAG, "onAnimationFinished(): mPendingAnimations="
+ + mPendingAnimations.size());
mHandler.removeCallbacks(mTimeoutRunnable);
synchronized (mService.mGlobalLock) {
unlinkToDeathOfRunner();
releaseFinishedCallback();
mService.openSurfaceTransaction();
try {
- ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS,
+ if (DEBUG_REMOTE_ANIMATIONS) Slog.d(TAG,
"onAnimationFinished(): Notify animation finished:");
for (int i = mPendingAnimations.size() - 1; i >= 0; i--) {
final RemoteAnimationRecord adapters = mPendingAnimations.get(i);
@@ -228,14 +228,14 @@ class RemoteAnimationController implements DeathRecipient {
.onAnimationFinished(adapters.mThumbnailAdapter);
}
mPendingAnimations.remove(i);
- ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "\tapp=%s", adapters.mAppWindowToken);
+ if (DEBUG_REMOTE_ANIMATIONS) Slog.d(TAG, "\tapp=" + adapters.mAppWindowToken);
}
for (int i = mPendingWallpaperAnimations.size() - 1; i >= 0; i--) {
final WallpaperAnimationAdapter adapter = mPendingWallpaperAnimations.get(i);
adapter.getLeashFinishedCallback().onAnimationFinished(adapter);
mPendingWallpaperAnimations.remove(i);
- ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "\twallpaper=%s", adapter.getToken());
+ if (DEBUG_REMOTE_ANIMATIONS) Slog.d(TAG, "\twallpaper=" + adapter.getToken());
}
} catch (Exception e) {
Slog.e(TAG, "Failed to finish remote animation", e);
@@ -245,7 +245,7 @@ class RemoteAnimationController implements DeathRecipient {
}
}
setRunningRemoteAnimation(false);
- ProtoLog.i(WM_DEBUG_REMOTE_ANIMATIONS, "Finishing remote animation");
+ if (DEBUG_REMOTE_ANIMATIONS) Slog.i(TAG, "Finishing remote animation");
}
private void invokeAnimationCancelled() {
@@ -306,7 +306,7 @@ class RemoteAnimationController implements DeathRecipient {
@Override
public void onAnimationFinished() throws RemoteException {
- ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "app-onAnimationFinished(): mOuter=%s", mOuter);
+ if (DEBUG_REMOTE_ANIMATIONS) Slog.d(TAG, "app-onAnimationFinished(): mOuter=" + mOuter);
final long token = Binder.clearCallingIdentity();
try {
if (mOuter != null) {
@@ -326,7 +326,7 @@ class RemoteAnimationController implements DeathRecipient {
* to prevent memory leak.
*/
void release() {
- ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "app-release(): mOuter=%s", mOuter);
+ if (DEBUG_REMOTE_ANIMATIONS) Slog.d(TAG, "app-release(): mOuter=" + mOuter);
mOuter = null;
}
};
@@ -420,7 +420,7 @@ class RemoteAnimationController implements DeathRecipient {
@Override
public void startAnimation(SurfaceControl animationLeash, Transaction t,
OnAnimationFinishedCallback finishCallback) {
- ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "startAnimation");
+ if (DEBUG_REMOTE_ANIMATIONS) Slog.d(TAG, "startAnimation");
// Restore z-layering, position and stack crop until client has a chance to modify it.
t.setLayer(animationLeash, mRecord.mAppWindowToken.getPrefixOrderIndex());
diff --git a/services/core/java/com/android/server/wm/RootWindowContainer.java b/services/core/java/com/android/server/wm/RootWindowContainer.java
index 78fcb37aacd1..4365d0325545 100644
--- a/services/core/java/com/android/server/wm/RootWindowContainer.java
+++ b/services/core/java/com/android/server/wm/RootWindowContainer.java
@@ -29,19 +29,20 @@ import static android.view.WindowManager.LayoutParams.TYPE_TOAST;
import static com.android.server.policy.WindowManagerPolicy.FINISH_LAYOUT_REDO_LAYOUT;
import static com.android.server.policy.WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_FOCUS_LIGHT;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_KEEP_SCREEN_ON;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_ORIENTATION;
-import static com.android.server.wm.ProtoLogGroup.WM_SHOW_SURFACE_ALLOC;
-import static com.android.server.wm.ProtoLogGroup.WM_SHOW_TRANSACTIONS;
import static com.android.server.wm.RootWindowContainerProto.DISPLAYS;
import static com.android.server.wm.RootWindowContainerProto.WINDOWS;
import static com.android.server.wm.RootWindowContainerProto.WINDOW_CONTAINER;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_DISPLAY;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_FOCUS_LIGHT;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_KEEP_SCREEN_ON;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_LAYOUT_REPEATS;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ORIENTATION;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WALLPAPER_LIGHT;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WINDOW_TRACE;
import static com.android.server.wm.WindowManagerDebugConfig.SHOW_LIGHT_TRANSACTIONS;
+import static com.android.server.wm.WindowManagerDebugConfig.SHOW_SURFACE_ALLOC;
+import static com.android.server.wm.WindowManagerDebugConfig.SHOW_TRANSACTIONS;
+import static com.android.server.wm.WindowManagerDebugConfig.TAG_KEEP_SCREEN_ON;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
import static com.android.server.wm.WindowManagerService.H.WINDOW_FREEZE_TIMEOUT;
@@ -49,6 +50,7 @@ import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_NORMAL;
import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_PLACING_SURFACES;
import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_WILL_PLACE_SURFACES;
import static com.android.server.wm.WindowManagerService.WINDOWS_FREEZING_SCREENS_NONE;
+import static com.android.server.wm.WindowManagerService.logSurface;
import static com.android.server.wm.WindowSurfacePlacer.SET_ORIENTATION_CHANGE_COMPLETE;
import static com.android.server.wm.WindowSurfacePlacer.SET_UPDATE_ROTATION;
import static com.android.server.wm.WindowSurfacePlacer.SET_WALLPAPER_ACTION_PENDING;
@@ -78,7 +80,6 @@ import android.view.SurfaceControl;
import android.view.WindowManager;
import com.android.server.EventLogTags;
-import com.android.server.protolog.common.ProtoLog;
import java.io.PrintWriter;
import java.util.ArrayList;
@@ -194,8 +195,8 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
mTopFocusedDisplayId = topFocusedDisplayId;
mWmService.mInputManager.setFocusedDisplay(topFocusedDisplayId);
mWmService.mPolicy.setTopFocusedDisplay(topFocusedDisplayId);
- ProtoLog.v(WM_DEBUG_FOCUS_LIGHT, "New topFocusedDisplayId=%d",
- topFocusedDisplayId);
+ if (DEBUG_FOCUS_LIGHT) Slog.v(TAG_WM, "New topFocusedDisplayId="
+ + topFocusedDisplayId);
}
return changed;
}
@@ -456,13 +457,13 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
}
void removeReplacedWindows() {
- ProtoLog.i(WM_SHOW_TRANSACTIONS, ">>> OPEN TRANSACTION removeReplacedWindows");
+ if (SHOW_TRANSACTIONS) Slog.i(TAG, ">>> OPEN TRANSACTION removeReplacedWindows");
mWmService.openSurfaceTransaction();
try {
forAllWindows(sRemoveReplacedWindowsConsumer, true /* traverseTopToBottom */);
} finally {
mWmService.closeSurfaceTransaction("removeReplacedWindows");
- ProtoLog.i(WM_SHOW_TRANSACTIONS, "<<< CLOSE TRANSACTION removeReplacedWindows");
+ if (SHOW_TRANSACTIONS) Slog.i(TAG, "<<< CLOSE TRANSACTION removeReplacedWindows");
}
}
@@ -538,8 +539,8 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
Slog.w(TAG_WM,
"Looks like we have reclaimed some memory, clearing surface for retry.");
if (surfaceController != null) {
- ProtoLog.i(WM_SHOW_SURFACE_ALLOC,
- "SURFACE RECOVER DESTROY: %s", winAnimator.mWin);
+ if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) logSurface(winAnimator.mWin,
+ "RECOVER DESTROY", false);
winAnimator.destroySurface();
if (winAnimator.mWin.mAppToken != null) {
winAnimator.mWin.mAppToken.removeStartingWindow();
@@ -650,11 +651,8 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
handleResizingWindows();
- if (mWmService.mDisplayFrozen) {
- ProtoLog.v(WM_DEBUG_ORIENTATION,
- "With display frozen, orientationChangeComplete=%b",
- mOrientationChangeComplete);
- }
+ if (DEBUG_ORIENTATION && mWmService.mDisplayFrozen) Slog.v(TAG,
+ "With display frozen, orientationChangeComplete=" + mOrientationChangeComplete);
if (mOrientationChangeComplete) {
if (mWmService.mWindowsFreezingScreen != WINDOWS_FREEZING_SCREENS_NONE) {
mWmService.mWindowsFreezingScreen = WINDOWS_FREEZING_SCREENS_NONE;
@@ -716,7 +714,7 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
}
if (mUpdateRotation) {
- ProtoLog.d(WM_DEBUG_ORIENTATION, "Performing post-rotate rotation");
+ if (DEBUG_ORIENTATION) Slog.d(TAG, "Performing post-rotate rotation");
mUpdateRotation = updateRotationUnchecked();
}
@@ -870,26 +868,29 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
final int privateflags = attrs.privateFlags;
boolean displayHasContent = false;
- ProtoLog.d(WM_DEBUG_KEEP_SCREEN_ON,
- "handleNotObscuredLocked w: %s, w.mHasSurface: %b, w.isOnScreen(): %b, w"
- + ".isDisplayedLw(): %b, w.mAttrs.userActivityTimeout: %d",
- w, w.mHasSurface, onScreen, w.isDisplayedLw(), w.mAttrs.userActivityTimeout);
+ if (DEBUG_KEEP_SCREEN_ON) {
+ Slog.d(TAG_KEEP_SCREEN_ON, "handleNotObscuredLocked w: " + w
+ + ", w.mHasSurface: " + w.mHasSurface
+ + ", w.isOnScreen(): " + onScreen
+ + ", w.isDisplayedLw(): " + w.isDisplayedLw()
+ + ", w.mAttrs.userActivityTimeout: " + w.mAttrs.userActivityTimeout);
+ }
if (w.mHasSurface && onScreen) {
if (!syswin && w.mAttrs.userActivityTimeout >= 0 && mUserActivityTimeout < 0) {
mUserActivityTimeout = w.mAttrs.userActivityTimeout;
- ProtoLog.d(WM_DEBUG_KEEP_SCREEN_ON, "mUserActivityTimeout set to %d",
- mUserActivityTimeout);
+ if (DEBUG_KEEP_SCREEN_ON) {
+ Slog.d(TAG, "mUserActivityTimeout set to " + mUserActivityTimeout);
+ }
}
}
if (w.mHasSurface && canBeSeen) {
if ((attrFlags & FLAG_KEEP_SCREEN_ON) != 0) {
mHoldScreen = w.mSession;
mHoldScreenWindow = w;
- } else if (w == mWmService.mLastWakeLockHoldingWindow) {
- ProtoLog.d(WM_DEBUG_KEEP_SCREEN_ON,
- "handleNotObscuredLocked: %s was holding screen wakelock but no longer "
- + "has FLAG_KEEP_SCREEN_ON!!! called by%s",
- w, Debug.getCallers(10));
+ } else if (DEBUG_KEEP_SCREEN_ON && w == mWmService.mLastWakeLockHoldingWindow) {
+ Slog.d(TAG_KEEP_SCREEN_ON, "handleNotObscuredLocked: " + w + " was holding "
+ + "screen wakelock but no longer has FLAG_KEEP_SCREEN_ON!!! called by"
+ + Debug.getCallers(10));
}
if (!syswin && w.mAttrs.screenBrightness >= 0 && mScreenBrightness < 0) {
mScreenBrightness = w.mAttrs.screenBrightness;
diff --git a/services/core/java/com/android/server/wm/ScreenRotationAnimation.java b/services/core/java/com/android/server/wm/ScreenRotationAnimation.java
index af474ec05ca4..cbaf098fa4bd 100644
--- a/services/core/java/com/android/server/wm/ScreenRotationAnimation.java
+++ b/services/core/java/com/android/server/wm/ScreenRotationAnimation.java
@@ -16,9 +16,10 @@
package com.android.server.wm;
-import static com.android.server.wm.ProtoLogGroup.WM_SHOW_SURFACE_ALLOC;
import static com.android.server.wm.ScreenRotationAnimationProto.ANIMATION_RUNNING;
import static com.android.server.wm.ScreenRotationAnimationProto.STARTED;
+import static com.android.server.wm.WindowManagerDebugConfig.SHOW_SURFACE_ALLOC;
+import static com.android.server.wm.WindowManagerDebugConfig.SHOW_TRANSACTIONS;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
import static com.android.server.wm.WindowManagerService.TYPE_LAYER_MULTIPLIER;
@@ -38,8 +39,6 @@ import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.Transformation;
-import com.android.server.protolog.common.ProtoLog;
-
import java.io.PrintWriter;
class ScreenRotationAnimation {
@@ -172,8 +171,10 @@ class ScreenRotationAnimation {
Slog.w(TAG, "Unable to allocate freeze surface", e);
}
- ProtoLog.i(WM_SHOW_SURFACE_ALLOC,
- " FREEZE %s: CREATE", mSurfaceControl);
+ if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) {
+ Slog.i(TAG_WM,
+ " FREEZE " + mSurfaceControl + ": CREATE");
+ }
setRotation(t, originalRotation);
t.apply();
}
@@ -421,8 +422,11 @@ class ScreenRotationAnimation {
public void kill() {
if (mSurfaceControl != null) {
- ProtoLog.i(WM_SHOW_SURFACE_ALLOC,
- " FREEZE %s: DESTROY", mSurfaceControl);
+ if (SHOW_TRANSACTIONS ||
+ SHOW_SURFACE_ALLOC) {
+ Slog.i(TAG_WM,
+ " FREEZE " + mSurfaceControl + ": DESTROY");
+ }
mService.mTransactionFactory.get().remove(mSurfaceControl).apply();
mSurfaceControl = null;
}
diff --git a/services/core/java/com/android/server/wm/Session.java b/services/core/java/com/android/server/wm/Session.java
index b047d8f8a7b9..72bb355146d1 100644
--- a/services/core/java/com/android/server/wm/Session.java
+++ b/services/core/java/com/android/server/wm/Session.java
@@ -24,9 +24,9 @@ import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
import static android.view.WindowManager.LayoutParams.isSystemAlertWindowType;
-import static com.android.server.wm.ProtoLogGroup.WM_SHOW_TRANSACTIONS;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_TASK_POSITIONING;
+import static com.android.server.wm.WindowManagerDebugConfig.SHOW_TRANSACTIONS;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
import android.annotation.Nullable;
@@ -56,7 +56,6 @@ import android.view.SurfaceSession;
import android.view.WindowManager;
import com.android.internal.os.logging.MetricsLoggerWrapper;
-import com.android.server.protolog.common.ProtoLog;
import com.android.server.wm.WindowManagerService.H;
import java.io.PrintWriter;
@@ -479,7 +478,8 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient {
Slog.v(TAG_WM, "First window added to " + this + ", creating SurfaceSession");
}
mSurfaceSession = new SurfaceSession();
- ProtoLog.i(WM_SHOW_TRANSACTIONS, " NEW SURFACE SESSION %s", mSurfaceSession);
+ if (SHOW_TRANSACTIONS) Slog.i(
+ TAG_WM, " NEW SURFACE SESSION " + mSurfaceSession);
mService.mSessions.add(this);
if (mLastReportedAnimatorScale != mService.getCurrentAnimatorScale()) {
mService.dispatchNewAnimatorScaleLocked(this);
@@ -570,7 +570,7 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient {
Slog.v(TAG_WM, "Last window removed from " + this
+ ", destroying " + mSurfaceSession);
}
- ProtoLog.i(WM_SHOW_TRANSACTIONS, " KILL SURFACE SESSION %s", mSurfaceSession);
+ if (SHOW_TRANSACTIONS) Slog.i(TAG_WM, " KILL SURFACE SESSION " + mSurfaceSession);
try {
mSurfaceSession.kill();
} catch (Exception e) {
diff --git a/services/core/java/com/android/server/wm/TaskPositioner.java b/services/core/java/com/android/server/wm/TaskPositioner.java
index b680fa45f00f..fc8a27d64fce 100644
--- a/services/core/java/com/android/server/wm/TaskPositioner.java
+++ b/services/core/java/com/android/server/wm/TaskPositioner.java
@@ -21,7 +21,7 @@ import static android.app.ActivityTaskManager.RESIZE_MODE_USER_FORCED;
import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER;
import static com.android.server.wm.DragResizeMode.DRAG_RESIZE_MODE_FREEFORM;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_ORIENTATION;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ORIENTATION;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_TASK_POSITIONING;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
@@ -54,7 +54,6 @@ import android.view.SurfaceControl;
import android.view.WindowManager;
import com.android.internal.annotations.VisibleForTesting;
-import com.android.server.protolog.common.ProtoLog;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -298,7 +297,9 @@ class TaskPositioner implements IBinder.DeathRecipient {
mDragWindowHandle.frameBottom = p.y;
// Pause rotations before a drag.
- ProtoLog.d(WM_DEBUG_ORIENTATION, "Pausing rotation during re-position");
+ if (DEBUG_ORIENTATION) {
+ Slog.d(TAG, "Pausing rotation during re-position");
+ }
mDisplayContent.getDisplayRotation().pause();
// Notify InputMonitor to take mDragWindowHandle.
@@ -339,7 +340,9 @@ class TaskPositioner implements IBinder.DeathRecipient {
mDisplayContent.getInputMonitor().updateInputWindowsLw(true /*force*/);
// Resume rotations after a drag.
- ProtoLog.d(WM_DEBUG_ORIENTATION, "Resuming rotation after re-position");
+ if (DEBUG_ORIENTATION) {
+ Slog.d(TAG, "Resuming rotation after re-position");
+ }
mDisplayContent.getDisplayRotation().resume();
mDisplayContent = null;
mClientCallback.unlinkToDeath(this, 0 /* flags */);
diff --git a/services/core/java/com/android/server/wm/TaskScreenshotAnimatable.java b/services/core/java/com/android/server/wm/TaskScreenshotAnimatable.java
index adecc36671c9..f291573f854a 100644
--- a/services/core/java/com/android/server/wm/TaskScreenshotAnimatable.java
+++ b/services/core/java/com/android/server/wm/TaskScreenshotAnimatable.java
@@ -15,15 +15,14 @@
*/
package com.android.server.wm;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_RECENTS_ANIMATIONS;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_RECENTS_ANIMATIONS;
import android.graphics.GraphicBuffer;
+import android.util.Slog;
import android.view.Surface;
import android.view.SurfaceControl;
import android.view.SurfaceSession;
-import com.android.server.protolog.common.ProtoLog;
-
import java.util.function.Function;
/**
@@ -46,9 +45,10 @@ class TaskScreenshotAnimatable implements SurfaceAnimator.Animatable {
mTask = task;
mWidth = (buffer != null) ? buffer.getWidth() : 1;
mHeight = (buffer != null) ? buffer.getHeight() : 1;
- ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS,
- "Creating TaskScreenshotAnimatable: task: %s width: %d height: %d",
- task, mWidth, mHeight);
+ if (DEBUG_RECENTS_ANIMATIONS) {
+ Slog.d(TAG, "Creating TaskScreenshotAnimatable: task: " + task
+ + "width: " + mWidth + "height: " + mHeight);
+ }
mSurfaceControl = surfaceControlFactory.apply(new SurfaceSession())
.setName("RecentTaskScreenshotSurface")
.setBufferSize(mWidth, mHeight)
diff --git a/services/core/java/com/android/server/wm/TaskSnapshotSurface.java b/services/core/java/com/android/server/wm/TaskSnapshotSurface.java
index d070850a895f..7456f0d78137 100644
--- a/services/core/java/com/android/server/wm/TaskSnapshotSurface.java
+++ b/services/core/java/com/android/server/wm/TaskSnapshotSurface.java
@@ -42,7 +42,7 @@ import static com.android.internal.policy.DecorView.STATUS_BAR_COLOR_VIEW_ATTRIB
import static com.android.internal.policy.DecorView.getColorViewLeftInset;
import static com.android.internal.policy.DecorView.getColorViewTopInset;
import static com.android.internal.policy.DecorView.getNavigationBarRect;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_STARTING_WINDOW;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_STARTING_WINDOW;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
@@ -79,7 +79,6 @@ import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.policy.DecorView;
import com.android.internal.view.BaseIWindow;
import com.android.server.policy.WindowManagerPolicy.StartingSurface;
-import com.android.server.protolog.common.ProtoLog;
/**
* This class represents a starting window that shows a snapshot.
@@ -260,14 +259,14 @@ class TaskSnapshotSurface implements StartingSurface {
final long now = SystemClock.uptimeMillis();
if (mSizeMismatch && now - mShownTime < SIZE_MISMATCH_MINIMUM_TIME_MS) {
mHandler.postAtTime(this::remove, mShownTime + SIZE_MISMATCH_MINIMUM_TIME_MS);
- ProtoLog.v(WM_DEBUG_STARTING_WINDOW,
- "Defer removing snapshot surface in %dms", (now - mShownTime));
-
+ if (DEBUG_STARTING_WINDOW) {
+ Slog.v(TAG, "Defer removing snapshot surface in " + (now - mShownTime) + "ms");
+ }
return;
}
}
try {
- ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Removing snapshot surface");
+ if (DEBUG_STARTING_WINDOW) Slog.v(TAG, "Removing snapshot surface");
mSession.remove(mWindow);
} catch (RemoteException e) {
// Local call.
@@ -287,8 +286,8 @@ class TaskSnapshotSurface implements StartingSurface {
private void drawSnapshot() {
mSurface.copyFrom(mSurfaceControl);
- ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Drawing snapshot surface sizeMismatch=%b",
- mSizeMismatch);
+ if (DEBUG_STARTING_WINDOW) Slog.v(TAG, "Drawing snapshot surface sizeMismatch="
+ + mSizeMismatch);
if (mSizeMismatch) {
// The dimensions of the buffer and the window don't match, so attaching the buffer
// will fail. Better create a child window with the exact dimensions and fill the parent
diff --git a/services/core/java/com/android/server/wm/WallpaperAnimationAdapter.java b/services/core/java/com/android/server/wm/WallpaperAnimationAdapter.java
index 513008d3c3c3..895350b43eeb 100644
--- a/services/core/java/com/android/server/wm/WallpaperAnimationAdapter.java
+++ b/services/core/java/com/android/server/wm/WallpaperAnimationAdapter.java
@@ -16,17 +16,17 @@
package com.android.server.wm;
import static com.android.server.wm.AnimationAdapterProto.REMOTE;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_REMOTE_ANIMATIONS;
import static com.android.server.wm.RemoteAnimationAdapterWrapperProto.TARGET;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_RECENTS_ANIMATIONS;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_REMOTE_ANIMATIONS;
import android.graphics.Point;
import android.os.SystemClock;
+import android.util.Slog;
import android.util.proto.ProtoOutputStream;
import android.view.RemoteAnimationTarget;
import android.view.SurfaceControl;
-import com.android.server.protolog.common.ProtoLog;
-
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.function.Consumer;
@@ -68,11 +68,15 @@ class WallpaperAnimationAdapter implements AnimationAdapter {
final ArrayList<RemoteAnimationTarget> targets = new ArrayList<>();
service.mRoot.forAllWallpaperWindows(wallpaperWindow -> {
if (!wallpaperWindow.getDisplayContent().mWallpaperController.isWallpaperVisible()) {
- ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "\tNot visible=%s", wallpaperWindow);
+ if (DEBUG_REMOTE_ANIMATIONS || DEBUG_RECENTS_ANIMATIONS) {
+ Slog.d(TAG, "\tNot visible=" + wallpaperWindow);
+ }
return;
}
- ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "\tvisible=%s", wallpaperWindow);
+ if (DEBUG_REMOTE_ANIMATIONS || DEBUG_RECENTS_ANIMATIONS) {
+ Slog.d(TAG, "\tvisible=" + wallpaperWindow);
+ }
final WallpaperAnimationAdapter wallpaperAdapter = new WallpaperAnimationAdapter(
wallpaperWindow, durationHint, statusBarTransitionDelay,
animationCanceledRunnable);
@@ -125,7 +129,7 @@ class WallpaperAnimationAdapter implements AnimationAdapter {
@Override
public void startAnimation(SurfaceControl animationLeash, SurfaceControl.Transaction t,
SurfaceAnimator.OnAnimationFinishedCallback finishCallback) {
- ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "startAnimation");
+ if (DEBUG_REMOTE_ANIMATIONS) Slog.d(TAG, "startAnimation");
// Restore z-layering until client has a chance to modify it.
t.setLayer(animationLeash, mWallpaperToken.getPrefixOrderIndex());
@@ -135,7 +139,7 @@ class WallpaperAnimationAdapter implements AnimationAdapter {
@Override
public void onAnimationCancelled(SurfaceControl animationLeash) {
- ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "onAnimationCancelled");
+ if (DEBUG_REMOTE_ANIMATIONS) Slog.d(TAG, "onAnimationCancelled");
mAnimationCanceledRunnable.accept(this);
}
diff --git a/services/core/java/com/android/server/wm/WallpaperController.java b/services/core/java/com/android/server/wm/WallpaperController.java
index e7b09db9368a..13902eedbfba 100644
--- a/services/core/java/com/android/server/wm/WallpaperController.java
+++ b/services/core/java/com/android/server/wm/WallpaperController.java
@@ -24,6 +24,7 @@ import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER;
import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_GOING_AWAY_WITH_WALLPAPER;
import static com.android.server.policy.WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_APP_TRANSITIONS;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_SCREENSHOT;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WALLPAPER;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WALLPAPER_LIGHT;
@@ -606,9 +607,8 @@ class WallpaperController {
boolean processWallpaperDrawPendingTimeout() {
if (mWallpaperDrawState == WALLPAPER_DRAW_PENDING) {
mWallpaperDrawState = WALLPAPER_DRAW_TIMEOUT;
- if (DEBUG_WALLPAPER) {
- Slog.v(TAG, "*** WALLPAPER DRAW TIMEOUT");
- }
+ if (DEBUG_APP_TRANSITIONS || DEBUG_WALLPAPER) Slog.v(TAG,
+ "*** WALLPAPER DRAW TIMEOUT");
// If there was a pending recents animation, start the animation anyways (it's better
// to not see the wallpaper than for the animation to not start)
@@ -641,11 +641,9 @@ class WallpaperController {
WALLPAPER_DRAW_PENDING_TIMEOUT_DURATION);
}
- if (DEBUG_WALLPAPER) {
- Slog.v(TAG,
- "Wallpaper should be visible but has not been drawn yet. "
- + "mWallpaperDrawState=" + mWallpaperDrawState);
- }
+ if (DEBUG_APP_TRANSITIONS || DEBUG_WALLPAPER) Slog.v(TAG,
+ "Wallpaper should be visible but has not been drawn yet. " +
+ "mWallpaperDrawState=" + mWallpaperDrawState);
break;
}
}
diff --git a/services/core/java/com/android/server/wm/WindowAnimator.java b/services/core/java/com/android/server/wm/WindowAnimator.java
index 37f75e6a543a..c7916e829349 100644
--- a/services/core/java/com/android/server/wm/WindowAnimator.java
+++ b/services/core/java/com/android/server/wm/WindowAnimator.java
@@ -16,8 +16,8 @@
package com.android.server.wm;
-import static com.android.server.wm.ProtoLogGroup.WM_SHOW_TRANSACTIONS;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WINDOW_TRACE;
+import static com.android.server.wm.WindowManagerDebugConfig.SHOW_TRANSACTIONS;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
import static com.android.server.wm.WindowSurfacePlacer.SET_ORIENTATION_CHANGE_COMPLETE;
@@ -33,7 +33,6 @@ import android.view.SurfaceControl;
import com.android.server.AnimationThread;
import com.android.server.policy.WindowManagerPolicy;
-import com.android.server.protolog.common.ProtoLog;
import java.io.PrintWriter;
import java.util.ArrayList;
@@ -148,7 +147,7 @@ public class WindowAnimator {
Slog.i(TAG, "!!! animate: entry time=" + mCurrentTime);
}
- ProtoLog.i(WM_SHOW_TRANSACTIONS, ">>> OPEN TRANSACTION animate");
+ if (SHOW_TRANSACTIONS) Slog.i(TAG, ">>> OPEN TRANSACTION animate");
mService.openSurfaceTransaction();
try {
final AccessibilityController accessibilityController =
@@ -214,7 +213,7 @@ public class WindowAnimator {
Slog.wtf(TAG, "Unhandled exception in Window Manager", e);
} finally {
mService.closeSurfaceTransaction("WindowAnimator");
- ProtoLog.i(WM_SHOW_TRANSACTIONS, "<<< CLOSE TRANSACTION animate");
+ if (SHOW_TRANSACTIONS) Slog.i(TAG, "<<< CLOSE TRANSACTION animate");
}
boolean hasPendingLayoutChanges = mService.mRoot.hasPendingLayoutChanges(this);
diff --git a/services/core/java/com/android/server/wm/WindowManagerDebugConfig.java b/services/core/java/com/android/server/wm/WindowManagerDebugConfig.java
index 93b0fd9b1fe3..c366e4d6108b 100644
--- a/services/core/java/com/android/server/wm/WindowManagerDebugConfig.java
+++ b/services/core/java/com/android/server/wm/WindowManagerDebugConfig.java
@@ -33,19 +33,32 @@ public class WindowManagerDebugConfig {
// Default log tag for the window manager package.
static final String TAG_WM = "WindowManager";
+ static final boolean DEBUG_RESIZE = false;
static final boolean DEBUG = false;
+ static final boolean DEBUG_ADD_REMOVE = false;
+ static final boolean DEBUG_FOCUS = false;
+ static final boolean DEBUG_FOCUS_LIGHT = DEBUG_FOCUS || false;
static final boolean DEBUG_ANIM = false;
+ static final boolean DEBUG_KEYGUARD = false;
static final boolean DEBUG_LAYOUT = false;
static final boolean DEBUG_LAYERS = false;
static final boolean DEBUG_INPUT = false;
static final boolean DEBUG_INPUT_METHOD = false;
static final boolean DEBUG_VISIBILITY = false;
+ static final boolean DEBUG_WINDOW_MOVEMENT = false;
+ static final boolean DEBUG_TOKEN_MOVEMENT = false;
+ static final boolean DEBUG_ORIENTATION = false;
+ static final boolean DEBUG_APP_ORIENTATION = false;
static final boolean DEBUG_CONFIGURATION = false;
+ static final boolean DEBUG_APP_TRANSITIONS = false;
static final boolean DEBUG_STARTING_WINDOW_VERBOSE = false;
+ static final boolean DEBUG_STARTING_WINDOW = DEBUG_STARTING_WINDOW_VERBOSE || false;
static final boolean DEBUG_WALLPAPER = false;
static final boolean DEBUG_WALLPAPER_LIGHT = false || DEBUG_WALLPAPER;
static final boolean DEBUG_DRAG = false;
+ static final boolean DEBUG_SCREEN_ON = false;
static final boolean DEBUG_SCREENSHOT = false;
+ static final boolean DEBUG_BOOT = false;
static final boolean DEBUG_LAYOUT_REPEATS = false;
static final boolean DEBUG_WINDOW_TRACE = false;
static final boolean DEBUG_TASK_MOVEMENT = false;
@@ -53,9 +66,17 @@ public class WindowManagerDebugConfig {
static final boolean DEBUG_STACK = false;
static final boolean DEBUG_DISPLAY = false;
static final boolean DEBUG_POWER = false;
- static final boolean SHOW_VERBOSE_TRANSACTIONS = false;
- static final boolean SHOW_LIGHT_TRANSACTIONS = false;
+ static final boolean DEBUG_DIM_LAYER = false;
+ static final boolean SHOW_SURFACE_ALLOC = false;
+ static final boolean SHOW_TRANSACTIONS = false;
+ static final boolean SHOW_VERBOSE_TRANSACTIONS = false && SHOW_TRANSACTIONS;
+ static final boolean SHOW_LIGHT_TRANSACTIONS = false || SHOW_TRANSACTIONS;
static final boolean SHOW_STACK_CRAWLS = false;
static final boolean DEBUG_WINDOW_CROP = false;
static final boolean DEBUG_UNKNOWN_APP_VISIBILITY = false;
+ static final boolean DEBUG_RECENTS_ANIMATIONS = false;
+ static final boolean DEBUG_REMOTE_ANIMATIONS = DEBUG_APP_TRANSITIONS || false;
+
+ static final String TAG_KEEP_SCREEN_ON = "DebugKeepScreenOn";
+ static final boolean DEBUG_KEEP_SCREEN_ON = false;
}
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index a0f2e7904abc..b4309c74b390 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -81,27 +81,27 @@ import static com.android.server.LockGuard.INDEX_WINDOW;
import static com.android.server.LockGuard.installLock;
import static com.android.server.policy.WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
import static com.android.server.wm.ActivityStackSupervisor.PRESERVE_WINDOWS;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_ADD_REMOVE;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_BOOT;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_FOCUS;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_FOCUS_LIGHT;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_KEEP_SCREEN_ON;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_ORIENTATION;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_SCREEN_ON;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_STARTING_WINDOW;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_WINDOW_MOVEMENT;
-import static com.android.server.wm.ProtoLogGroup.WM_ERROR;
-import static com.android.server.wm.ProtoLogGroup.WM_SHOW_TRANSACTIONS;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ADD_REMOVE;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_BOOT;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_DISPLAY;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_FOCUS;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_FOCUS_LIGHT;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_INPUT_METHOD;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_KEEP_SCREEN_ON;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_LAYOUT;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ORIENTATION;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_SCREENSHOT;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_SCREEN_ON;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_STARTING_WINDOW;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_VISIBILITY;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WINDOW_MOVEMENT;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WINDOW_TRACE;
import static com.android.server.wm.WindowManagerDebugConfig.SHOW_LIGHT_TRANSACTIONS;
import static com.android.server.wm.WindowManagerDebugConfig.SHOW_STACK_CRAWLS;
+import static com.android.server.wm.WindowManagerDebugConfig.SHOW_TRANSACTIONS;
import static com.android.server.wm.WindowManagerDebugConfig.SHOW_VERBOSE_TRANSACTIONS;
+import static com.android.server.wm.WindowManagerDebugConfig.TAG_KEEP_SCREEN_ON;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
import static com.android.server.wm.WindowManagerServiceDumpProto.DISPLAY_FROZEN;
@@ -267,7 +267,6 @@ import com.android.server.policy.WindowManagerPolicy;
import com.android.server.policy.WindowManagerPolicy.ScreenOffListener;
import com.android.server.power.ShutdownThread;
import com.android.server.protolog.ProtoLogImpl;
-import com.android.server.protolog.common.ProtoLog;
import com.android.server.utils.PriorityDump;
import java.io.BufferedWriter;
@@ -1294,7 +1293,7 @@ public class WindowManagerService extends IWindowManager.Stub
// The window manager only throws security exceptions, so let's
// log all others.
if (!(e instanceof SecurityException)) {
- ProtoLog.wtf(WM_ERROR, "Window Manager Crash %s", e);
+ Slog.wtf(TAG_WM, "Window Manager Crash", e);
}
throw e;
}
@@ -1334,41 +1333,38 @@ public class WindowManagerService extends IWindowManager.Stub
final DisplayContent displayContent = getDisplayContentOrCreate(displayId, attrs.token);
if (displayContent == null) {
- ProtoLog.w(WM_ERROR, "Attempted to add window to a display that does "
- + "not exist: %d. Aborting.", displayId);
+ Slog.w(TAG_WM, "Attempted to add window to a display that does not exist: "
+ + displayId + ". Aborting.");
return WindowManagerGlobal.ADD_INVALID_DISPLAY;
}
if (!displayContent.hasAccess(session.mUid)) {
- ProtoLog.w(WM_ERROR,
- "Attempted to add window to a display for which the application "
- + "does not have access: %d. Aborting.", displayId);
+ Slog.w(TAG_WM, "Attempted to add window to a display for which the application "
+ + "does not have access: " + displayId + ". Aborting.");
return WindowManagerGlobal.ADD_INVALID_DISPLAY;
}
if (mWindowMap.containsKey(client.asBinder())) {
- ProtoLog.w(WM_ERROR, "Window %s is already added", client);
+ Slog.w(TAG_WM, "Window " + client + " is already added");
return WindowManagerGlobal.ADD_DUPLICATE_ADD;
}
if (type >= FIRST_SUB_WINDOW && type <= LAST_SUB_WINDOW) {
parentWindow = windowForClientLocked(null, attrs.token, false);
if (parentWindow == null) {
- ProtoLog.w(WM_ERROR, "Attempted to add window with token that is not a window: "
- + "%s. Aborting.", attrs.token);
+ Slog.w(TAG_WM, "Attempted to add window with token that is not a window: "
+ + attrs.token + ". Aborting.");
return WindowManagerGlobal.ADD_BAD_SUBWINDOW_TOKEN;
}
if (parentWindow.mAttrs.type >= FIRST_SUB_WINDOW
&& parentWindow.mAttrs.type <= LAST_SUB_WINDOW) {
- ProtoLog.w(WM_ERROR, "Attempted to add window with token that is a sub-window: "
- + "%s. Aborting.", attrs.token);
+ Slog.w(TAG_WM, "Attempted to add window with token that is a sub-window: "
+ + attrs.token + ". Aborting.");
return WindowManagerGlobal.ADD_BAD_SUBWINDOW_TOKEN;
}
}
if (type == TYPE_PRIVATE_PRESENTATION && !displayContent.isPrivate()) {
- ProtoLog.w(WM_ERROR,
- "Attempted to add private presentation window to a non-private display. "
- + "Aborting.");
+ Slog.w(TAG_WM, "Attempted to add private presentation window to a non-private display. Aborting.");
return WindowManagerGlobal.ADD_PERMISSION_DENIED;
}
@@ -1386,48 +1382,46 @@ public class WindowManagerService extends IWindowManager.Stub
if (token == null) {
if (rootType >= FIRST_APPLICATION_WINDOW && rootType <= LAST_APPLICATION_WINDOW) {
- ProtoLog.w(WM_ERROR, "Attempted to add application window with unknown token "
- + "%s. Aborting.", attrs.token);
+ Slog.w(TAG_WM, "Attempted to add application window with unknown token "
+ + attrs.token + ". Aborting.");
return WindowManagerGlobal.ADD_BAD_APP_TOKEN;
}
if (rootType == TYPE_INPUT_METHOD) {
- ProtoLog.w(WM_ERROR, "Attempted to add input method window with unknown token "
- + "%s. Aborting.", attrs.token);
+ Slog.w(TAG_WM, "Attempted to add input method window with unknown token "
+ + attrs.token + ". Aborting.");
return WindowManagerGlobal.ADD_BAD_APP_TOKEN;
}
if (rootType == TYPE_VOICE_INTERACTION) {
- ProtoLog.w(WM_ERROR,
- "Attempted to add voice interaction window with unknown token "
- + "%s. Aborting.", attrs.token);
+ Slog.w(TAG_WM, "Attempted to add voice interaction window with unknown token "
+ + attrs.token + ". Aborting.");
return WindowManagerGlobal.ADD_BAD_APP_TOKEN;
}
if (rootType == TYPE_WALLPAPER) {
- ProtoLog.w(WM_ERROR, "Attempted to add wallpaper window with unknown token "
- + "%s. Aborting.", attrs.token);
+ Slog.w(TAG_WM, "Attempted to add wallpaper window with unknown token "
+ + attrs.token + ". Aborting.");
return WindowManagerGlobal.ADD_BAD_APP_TOKEN;
}
if (rootType == TYPE_DREAM) {
- ProtoLog.w(WM_ERROR, "Attempted to add Dream window with unknown token "
- + "%s. Aborting.", attrs.token);
+ Slog.w(TAG_WM, "Attempted to add Dream window with unknown token "
+ + attrs.token + ". Aborting.");
return WindowManagerGlobal.ADD_BAD_APP_TOKEN;
}
if (rootType == TYPE_QS_DIALOG) {
- ProtoLog.w(WM_ERROR, "Attempted to add QS dialog window with unknown token "
- + "%s. Aborting.", attrs.token);
+ Slog.w(TAG_WM, "Attempted to add QS dialog window with unknown token "
+ + attrs.token + ". Aborting.");
return WindowManagerGlobal.ADD_BAD_APP_TOKEN;
}
if (rootType == TYPE_ACCESSIBILITY_OVERLAY) {
- ProtoLog.w(WM_ERROR,
- "Attempted to add Accessibility overlay window with unknown token "
- + "%s. Aborting.", attrs.token);
+ Slog.w(TAG_WM, "Attempted to add Accessibility overlay window with unknown token "
+ + attrs.token + ". Aborting.");
return WindowManagerGlobal.ADD_BAD_APP_TOKEN;
}
if (type == TYPE_TOAST) {
// Apps targeting SDK above N MR1 cannot arbitrary add toast windows.
if (doesAddToastWindowRequireToken(attrs.packageName, callingUid,
parentWindow)) {
- ProtoLog.w(WM_ERROR, "Attempted to add a toast window with unknown token "
- + "%s. Aborting.", attrs.token);
+ Slog.w(TAG_WM, "Attempted to add a toast window with unknown token "
+ + attrs.token + ". Aborting.");
return WindowManagerGlobal.ADD_BAD_APP_TOKEN;
}
}
@@ -1436,52 +1430,49 @@ public class WindowManagerService extends IWindowManager.Stub
(attrs.privateFlags & PRIVATE_FLAG_IS_ROUNDED_CORNERS_OVERLAY) != 0;
token = new WindowToken(this, binder, type, false, displayContent,
session.mCanAddInternalSystemWindow, isRoundedCornerOverlay);
- } else if (rootType >= FIRST_APPLICATION_WINDOW
- && rootType <= LAST_APPLICATION_WINDOW) {
+ } else if (rootType >= FIRST_APPLICATION_WINDOW && rootType <= LAST_APPLICATION_WINDOW) {
atoken = token.asAppWindowToken();
if (atoken == null) {
- ProtoLog.w(WM_ERROR, "Attempted to add window with non-application token "
- + ".%s Aborting.", token);
+ Slog.w(TAG_WM, "Attempted to add window with non-application token "
+ + token + ". Aborting.");
return WindowManagerGlobal.ADD_NOT_APP_TOKEN;
} else if (atoken.removed) {
- ProtoLog.w(WM_ERROR, "Attempted to add window with exiting application token "
- + ".%s Aborting.", token);
+ Slog.w(TAG_WM, "Attempted to add window with exiting application token "
+ + token + ". Aborting.");
return WindowManagerGlobal.ADD_APP_EXITING;
} else if (type == TYPE_APPLICATION_STARTING && atoken.startingWindow != null) {
- ProtoLog.w(WM_ERROR,
- "Attempted to add starting window to token with already existing"
- + " starting window");
+ Slog.w(TAG_WM, "Attempted to add starting window to token with already existing"
+ + " starting window");
return WindowManagerGlobal.ADD_DUPLICATE_ADD;
}
} else if (rootType == TYPE_INPUT_METHOD) {
if (token.windowType != TYPE_INPUT_METHOD) {
- ProtoLog.w(WM_ERROR, "Attempted to add input method window with bad token "
- + "%s. Aborting.", attrs.token);
- return WindowManagerGlobal.ADD_BAD_APP_TOKEN;
+ Slog.w(TAG_WM, "Attempted to add input method window with bad token "
+ + attrs.token + ". Aborting.");
+ return WindowManagerGlobal.ADD_BAD_APP_TOKEN;
}
} else if (rootType == TYPE_VOICE_INTERACTION) {
if (token.windowType != TYPE_VOICE_INTERACTION) {
- ProtoLog.w(WM_ERROR, "Attempted to add voice interaction window with bad token "
- + "%s. Aborting.", attrs.token);
- return WindowManagerGlobal.ADD_BAD_APP_TOKEN;
+ Slog.w(TAG_WM, "Attempted to add voice interaction window with bad token "
+ + attrs.token + ". Aborting.");
+ return WindowManagerGlobal.ADD_BAD_APP_TOKEN;
}
} else if (rootType == TYPE_WALLPAPER) {
if (token.windowType != TYPE_WALLPAPER) {
- ProtoLog.w(WM_ERROR, "Attempted to add wallpaper window with bad token "
- + "%s. Aborting.", attrs.token);
- return WindowManagerGlobal.ADD_BAD_APP_TOKEN;
+ Slog.w(TAG_WM, "Attempted to add wallpaper window with bad token "
+ + attrs.token + ". Aborting.");
+ return WindowManagerGlobal.ADD_BAD_APP_TOKEN;
}
} else if (rootType == TYPE_DREAM) {
if (token.windowType != TYPE_DREAM) {
- ProtoLog.w(WM_ERROR, "Attempted to add Dream window with bad token "
- + "%s. Aborting.", attrs.token);
- return WindowManagerGlobal.ADD_BAD_APP_TOKEN;
+ Slog.w(TAG_WM, "Attempted to add Dream window with bad token "
+ + attrs.token + ". Aborting.");
+ return WindowManagerGlobal.ADD_BAD_APP_TOKEN;
}
} else if (rootType == TYPE_ACCESSIBILITY_OVERLAY) {
if (token.windowType != TYPE_ACCESSIBILITY_OVERLAY) {
- ProtoLog.w(WM_ERROR,
- "Attempted to add Accessibility overlay window with bad token "
- + "%s. Aborting.", attrs.token);
+ Slog.w(TAG_WM, "Attempted to add Accessibility overlay window with bad token "
+ + attrs.token + ". Aborting.");
return WindowManagerGlobal.ADD_BAD_APP_TOKEN;
}
} else if (type == TYPE_TOAST) {
@@ -1489,19 +1480,18 @@ public class WindowManagerService extends IWindowManager.Stub
addToastWindowRequiresToken = doesAddToastWindowRequireToken(attrs.packageName,
callingUid, parentWindow);
if (addToastWindowRequiresToken && token.windowType != TYPE_TOAST) {
- ProtoLog.w(WM_ERROR, "Attempted to add a toast window with bad token "
- + "%s. Aborting.", attrs.token);
+ Slog.w(TAG_WM, "Attempted to add a toast window with bad token "
+ + attrs.token + ". Aborting.");
return WindowManagerGlobal.ADD_BAD_APP_TOKEN;
}
} else if (type == TYPE_QS_DIALOG) {
if (token.windowType != TYPE_QS_DIALOG) {
- ProtoLog.w(WM_ERROR, "Attempted to add QS dialog window with bad token "
- + "%s. Aborting.", attrs.token);
+ Slog.w(TAG_WM, "Attempted to add QS dialog window with bad token "
+ + attrs.token + ". Aborting.");
return WindowManagerGlobal.ADD_BAD_APP_TOKEN;
}
} else if (token.asAppWindowToken() != null) {
- ProtoLog.w(WM_ERROR, "Non-null appWindowToken for system window of rootType=%d",
- rootType);
+ Slog.w(TAG_WM, "Non-null appWindowToken for system window of rootType=" + rootType);
// It is not valid to use an app token with other system types; we will
// instead make a new token for it (as if null had been passed in for the token).
attrs.token = null;
@@ -1515,13 +1505,13 @@ public class WindowManagerService extends IWindowManager.Stub
if (win.mDeathRecipient == null) {
// Client has apparently died, so there is no reason to
// continue.
- ProtoLog.w(WM_ERROR, "Adding window client %s"
- + " that is dead, aborting.", client.asBinder());
+ Slog.w(TAG_WM, "Adding window client " + client.asBinder()
+ + " that is dead, aborting.");
return WindowManagerGlobal.ADD_APP_EXITING;
}
if (win.getDisplayContent() == null) {
- ProtoLog.w(WM_ERROR, "Adding window to Display that has been removed.");
+ Slog.w(TAG_WM, "Adding window to Display that has been removed.");
return WindowManagerGlobal.ADD_INVALID_DISPLAY;
}
@@ -1553,7 +1543,7 @@ public class WindowManagerService extends IWindowManager.Stub
// schedule hiding all of its toast windows.
if (type == TYPE_TOAST) {
if (!displayContent.canAddToastWindowForUid(callingUid)) {
- ProtoLog.w(WM_ERROR, "Adding more than one toast window for UID at a time.");
+ Slog.w(TAG_WM, "Adding more than one toast window for UID at a time.");
return WindowManagerGlobal.ADD_DUPLICATE_ADD;
}
// Make sure this happens before we moved focus as one can make the
@@ -1599,8 +1589,8 @@ public class WindowManagerService extends IWindowManager.Stub
final AppWindowToken aToken = token.asAppWindowToken();
if (type == TYPE_APPLICATION_STARTING && aToken != null) {
aToken.startingWindow = win;
- ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "addWindow: %s startingWindow=%s",
- aToken, win);
+ if (DEBUG_STARTING_WINDOW) Slog.v (TAG_WM, "addWindow: " + aToken
+ + " startingWindow=" + win);
}
boolean imMayMove = true;
@@ -1617,7 +1607,7 @@ public class WindowManagerService extends IWindowManager.Stub
if (type == TYPE_WALLPAPER) {
displayContent.mWallpaperController.clearLastWallpaperTimeoutTime();
displayContent.pendingLayoutChanges |= FINISH_LAYOUT_REDO_WALLPAPER;
- } else if ((attrs.flags & FLAG_SHOW_WALLPAPER) != 0) {
+ } else if ((attrs.flags&FLAG_SHOW_WALLPAPER) != 0) {
displayContent.pendingLayoutChanges |= FINISH_LAYOUT_REDO_WALLPAPER;
} else if (displayContent.mWallpaperController.isBelowWallpaperTarget(win)) {
// If there is currently a wallpaper being shown, and
@@ -1702,9 +1692,10 @@ public class WindowManagerService extends IWindowManager.Stub
}
displayContent.getInputMonitor().updateInputWindowsLw(false /*force*/);
- ProtoLog.v(WM_DEBUG_ADD_REMOVE, "addWindow: New client %s"
- + ": window=%s Callers=%s", client.asBinder(), win, Debug.getCallers(5));
-
+ if (DEBUG || DEBUG_ADD_REMOVE) {
+ Slog.v(TAG_WM, "addWindow: New client " + client.asBinder()
+ + ": window=" + win + " Callers=" + Debug.getCallers(5));
+ }
if (win.isVisibleOrAdding() && displayContent.updateOrientation()) {
displayContent.sendNewConfiguration();
@@ -1867,7 +1858,7 @@ public class WindowManagerService extends IWindowManager.Stub
* forgetting to add the wiring when a new parent of WindowState is added.
*/
void postWindowRemoveCleanupLocked(WindowState win) {
- ProtoLog.v(WM_DEBUG_ADD_REMOVE, "postWindowRemoveCleanupLocked: %s", win);
+ if (DEBUG_ADD_REMOVE) Slog.v(TAG_WM, "postWindowRemoveCleanupLocked: " + win);
mWindowMap.remove(win.mClient.asBinder());
final DisplayContent dc = win.getDisplayContent();
@@ -1882,7 +1873,7 @@ public class WindowManagerService extends IWindowManager.Stub
mResizingWindows.remove(win);
updateNonSystemOverlayWindowsVisibilityIfNeeded(win, false /* surfaceShown */);
mWindowsChanged = true;
- ProtoLog.v(WM_DEBUG_WINDOW_MOVEMENT, "Final remove of window: %s", win);
+ if (DEBUG_WINDOW_MOVEMENT) Slog.v(TAG_WM, "Final remove of window: " + win);
final DisplayContent displayContent = win.getDisplayContent();
if (displayContent.mInputMethodWindow == win) {
@@ -1891,7 +1882,7 @@ public class WindowManagerService extends IWindowManager.Stub
final WindowToken token = win.mToken;
final AppWindowToken atoken = win.mAppToken;
- ProtoLog.v(WM_DEBUG_ADD_REMOVE, "Removing %s from %s", win, token);
+ if (DEBUG_ADD_REMOVE) Slog.v(TAG_WM, "Removing " + win + " from " + token);
// Window will already be removed from token before this post clean-up method is called.
if (token.isEmpty()) {
if (!token.mPersistOnEmpty) {
@@ -1951,6 +1942,11 @@ public class WindowManagerService extends IWindowManager.Stub
}
}
+ static void logSurface(SurfaceControl s, String title, String msg) {
+ String str = " SURFACE " + s + ": " + msg + " / " + title;
+ Slog.i(TAG_WM, str);
+ }
+
static void logWithStack(String tag, String s) {
RuntimeException e = null;
if (SHOW_STACK_CRAWLS) {
@@ -1965,8 +1961,8 @@ public class WindowManagerService extends IWindowManager.Stub
try {
synchronized (mGlobalLock) {
WindowState w = windowForClientLocked(session, client, false);
- ProtoLog.i(WM_SHOW_TRANSACTIONS, "SURFACE transparentRegionHint=%s: %s",
- region, w);
+ if (SHOW_TRANSACTIONS) WindowManagerService.logSurface(w,
+ "transparentRegionHint=" + region, false);
if ((w != null) && w.mHasSurface) {
w.mWinAnimator.setTransparentRegionHintLocked(region);
@@ -2190,10 +2186,12 @@ public class WindowManagerService extends IWindowManager.Stub
win.mInRelayout = true;
win.mViewVisibility = viewVisibility;
- ProtoLog.i(WM_DEBUG_SCREEN_ON,
- "Relayout %s: oldVis=%d newVis=%d. %s", win, oldVisibility,
- viewVisibility, new RuntimeException().fillInStackTrace());
-
+ if (DEBUG_SCREEN_ON) {
+ RuntimeException stack = new RuntimeException();
+ stack.fillInStackTrace();
+ Slog.i(TAG_WM, "Relayout " + win + ": oldVis=" + oldVisibility
+ + " newVis=" + viewVisibility, stack);
+ }
win.setDisplayLayoutNeeded();
win.mGivenInsetsPending = (flags & WindowManagerGlobal.RELAYOUT_INSETS_PENDING) != 0;
@@ -2238,9 +2236,9 @@ public class WindowManagerService extends IWindowManager.Stub
} catch (Exception e) {
displayContent.getInputMonitor().updateInputWindowsLw(true /*force*/);
- ProtoLog.w(WM_ERROR,
- "Exception thrown when creating surface for client %s (%s). %s",
- client, win.mAttrs.getTitle(), e);
+ Slog.w(TAG_WM, "Exception thrown when creating surface for client "
+ + client + " (" + win.mAttrs.getTitle() + ")",
+ e);
Binder.restoreCallingIdentity(origId);
return 0;
}
@@ -2364,21 +2362,21 @@ public class WindowManagerService extends IWindowManager.Stub
outInsetsState.set(displayContent.getInsetsStateController().getInsetsForDispatch(win));
if (DEBUG) {
Slog.v(TAG_WM, "Relayout given client " + client.asBinder()
- + ", requestedWidth=" + requestedWidth
- + ", requestedHeight=" + requestedHeight
- + ", viewVisibility=" + viewVisibility
- + "\nRelayout returning frame=" + outFrame
- + ", surface=" + outSurfaceControl);
+ + ", requestedWidth=" + requestedWidth
+ + ", requestedHeight=" + requestedHeight
+ + ", viewVisibility=" + viewVisibility
+ + "\nRelayout returning frame=" + outFrame
+ + ", surface=" + outSurfaceControl);
}
- ProtoLog.v(WM_DEBUG_FOCUS, "Relayout of %s: focusMayChange=%b",
- win, focusMayChange);
+ if (DEBUG || DEBUG_FOCUS) {
+ Slog.v(TAG_WM, "Relayout of " + win + ": focusMayChange=" + focusMayChange);
+ }
result |= mInTouchMode ? WindowManagerGlobal.RELAYOUT_RES_IN_TOUCH_MODE : 0;
if (DEBUG_LAYOUT) {
- Slog.v(TAG_WM,
- "Relayout complete " + win + ": outFrame=" + outFrame.toShortString());
+ Slog.v(TAG_WM, "Relayout complete " + win + ": outFrame=" + outFrame.toShortString());
}
win.mInRelayout = false;
@@ -2456,12 +2454,11 @@ public class WindowManagerService extends IWindowManager.Stub
}
if (surfaceController != null) {
surfaceController.getSurfaceControl(outSurfaceControl);
- ProtoLog.i(WM_SHOW_TRANSACTIONS, "OUT SURFACE %s: copied", outSurfaceControl);
-
+ if (SHOW_TRANSACTIONS) Slog.i(TAG_WM, " OUT SURFACE " + outSurfaceControl + ": copied");
} else {
// For some reason there isn't a surface. Clear the
// caller's object so they see the same state.
- ProtoLog.w(WM_ERROR, "Failed to create surface control for %s", win);
+ Slog.w(TAG_WM, "Failed to create surface control for " + win);
outSurfaceControl.release();
}
@@ -2490,8 +2487,8 @@ public class WindowManagerService extends IWindowManager.Stub
try {
synchronized (mGlobalLock) {
WindowState win = windowForClientLocked(session, client, false);
- ProtoLog.d(WM_DEBUG_ADD_REMOVE, "finishDrawingWindow: %s mDrawState=%s",
- win, (win != null ? win.mWinAnimator.drawStateToString() : "null"));
+ if (DEBUG_ADD_REMOVE) Slog.d(TAG_WM, "finishDrawingWindow: " + win + " mDrawState="
+ + (win != null ? win.mWinAnimator.drawStateToString() : "null"));
if (win != null && win.mWinAnimator.finishDrawingLocked(postDrawTransaction)) {
if ((win.mAttrs.flags & FLAG_SHOW_WALLPAPER) != 0) {
win.getDisplayContent().pendingLayoutChanges |=
@@ -2516,8 +2513,9 @@ public class WindowManagerService extends IWindowManager.Stub
== PackageManager.PERMISSION_GRANTED) {
return true;
}
- ProtoLog.w(WM_ERROR, "Permission Denial: %s from pid=%d, uid=%d requires %s",
- func, Binder.getCallingPid(), Binder.getCallingUid(), permission);
+ final String msg = "Permission Denial: " + func + " from pid=" + Binder.getCallingPid()
+ + ", uid=" + Binder.getCallingUid() + " requires " + permission;
+ Slog.w(TAG_WM, msg);
return false;
}
@@ -2530,16 +2528,16 @@ public class WindowManagerService extends IWindowManager.Stub
synchronized (mGlobalLock) {
final DisplayContent dc = getDisplayContentOrCreate(displayId, null /* token */);
if (dc == null) {
- ProtoLog.w(WM_ERROR, "addWindowToken: Attempted to add token: %s"
- + " for non-exiting displayId=%d", binder, displayId);
+ Slog.w(TAG_WM, "addWindowToken: Attempted to add token: " + binder
+ + " for non-exiting displayId=" + displayId);
return;
}
WindowToken token = dc.getWindowToken(binder);
if (token != null) {
- ProtoLog.w(WM_ERROR, "addWindowToken: Attempted to add binder token: %s"
- + " for already created window token: %s"
- + " displayId=%d", binder, token, displayId);
+ Slog.w(TAG_WM, "addWindowToken: Attempted to add binder token: " + binder
+ + " for already created window token: " + token
+ + " displayId=" + displayId);
return;
}
if (type == TYPE_WALLPAPER) {
@@ -2562,16 +2560,15 @@ public class WindowManagerService extends IWindowManager.Stub
synchronized (mGlobalLock) {
final DisplayContent dc = mRoot.getDisplayContent(displayId);
if (dc == null) {
- ProtoLog.w(WM_ERROR, "removeWindowToken: Attempted to remove token: %s"
- + " for non-exiting displayId=%d", binder, displayId);
+ Slog.w(TAG_WM, "removeWindowToken: Attempted to remove token: " + binder
+ + " for non-exiting displayId=" + displayId);
return;
}
final WindowToken token = dc.removeWindowToken(binder);
if (token == null) {
- ProtoLog.w(WM_ERROR,
- "removeWindowToken: Attempted to remove non-existing token: %s",
- binder);
+ Slog.w(TAG_WM,
+ "removeWindowToken: Attempted to remove non-existing token: " + binder);
return;
}
@@ -3211,11 +3208,14 @@ public class WindowManagerService extends IWindowManager.Stub
public void enableScreenAfterBoot() {
synchronized (mGlobalLock) {
- ProtoLog.i(WM_DEBUG_BOOT, "enableScreenAfterBoot: mDisplayEnabled=%b "
- + "mForceDisplayEnabled=%b mShowingBootMessages=%b mSystemBooted=%b. "
- + "%s",
- mDisplayEnabled, mForceDisplayEnabled, mShowingBootMessages, mSystemBooted,
- new RuntimeException("here").fillInStackTrace());
+ if (DEBUG_BOOT) {
+ RuntimeException here = new RuntimeException("here");
+ here.fillInStackTrace();
+ Slog.i(TAG_WM, "enableScreenAfterBoot: mDisplayEnabled=" + mDisplayEnabled
+ + " mForceDisplayEnabled=" + mForceDisplayEnabled
+ + " mShowingBootMessages=" + mShowingBootMessages
+ + " mSystemBooted=" + mSystemBooted, here);
+ }
if (mSystemBooted) {
return;
}
@@ -3239,11 +3239,14 @@ public class WindowManagerService extends IWindowManager.Stub
}
void enableScreenIfNeededLocked() {
- ProtoLog.i(WM_DEBUG_BOOT, "enableScreenIfNeededLocked: mDisplayEnabled=%b "
- + "mForceDisplayEnabled=%b mShowingBootMessages=%b mSystemBooted=%b. "
- + "%s",
- mDisplayEnabled, mForceDisplayEnabled, mShowingBootMessages, mSystemBooted,
- new RuntimeException("here").fillInStackTrace());
+ if (DEBUG_BOOT) {
+ RuntimeException here = new RuntimeException("here");
+ here.fillInStackTrace();
+ Slog.i(TAG_WM, "enableScreenIfNeededLocked: mDisplayEnabled=" + mDisplayEnabled
+ + " mForceDisplayEnabled=" + mForceDisplayEnabled
+ + " mShowingBootMessages=" + mShowingBootMessages
+ + " mSystemBooted=" + mSystemBooted, here);
+ }
if (mDisplayEnabled) {
return;
}
@@ -3258,7 +3261,7 @@ public class WindowManagerService extends IWindowManager.Stub
if (mDisplayEnabled) {
return;
}
- ProtoLog.w(WM_ERROR, "***** BOOT TIMEOUT: forcing display enabled");
+ Slog.w(TAG_WM, "***** BOOT TIMEOUT: forcing display enabled");
mForceDisplayEnabled = true;
}
performEnableScreen();
@@ -3273,10 +3276,11 @@ public class WindowManagerService extends IWindowManager.Stub
private void performEnableScreen() {
synchronized (mGlobalLock) {
- ProtoLog.i(WM_DEBUG_BOOT, "performEnableScreen: mDisplayEnabled=%b"
- + " mForceDisplayEnabled=%b" + " mShowingBootMessages=%b"
- + " mSystemBooted=%b mOnlyCore=%b. %s", mDisplayEnabled,
- mForceDisplayEnabled, mShowingBootMessages, mSystemBooted, mOnlyCore,
+ if (DEBUG_BOOT) Slog.i(TAG_WM, "performEnableScreen: mDisplayEnabled=" + mDisplayEnabled
+ + " mForceDisplayEnabled=" + mForceDisplayEnabled
+ + " mShowingBootMessages=" + mShowingBootMessages
+ + " mSystemBooted=" + mSystemBooted
+ + " mOnlyCore=" + mOnlyCore,
new RuntimeException("here").fillInStackTrace());
if (mDisplayEnabled) {
return;
@@ -3306,14 +3310,14 @@ public class WindowManagerService extends IWindowManager.Stub
}
if (!mForceDisplayEnabled && !checkBootAnimationCompleteLocked()) {
- ProtoLog.i(WM_DEBUG_BOOT, "performEnableScreen: Waiting for anim complete");
+ if (DEBUG_BOOT) Slog.i(TAG_WM, "performEnableScreen: Waiting for anim complete");
return;
}
try {
IBinder surfaceFlinger = ServiceManager.getService("SurfaceFlinger");
if (surfaceFlinger != null) {
- ProtoLog.i(WM_ERROR, "******* TELLING SURFACE FLINGER WE ARE BOOTED!");
+ 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
@@ -3321,13 +3325,13 @@ public class WindowManagerService extends IWindowManager.Stub
data.recycle();
}
} catch (RemoteException ex) {
- ProtoLog.e(WM_ERROR, "Boot completed: SurfaceFlinger is dead!");
+ 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;
- ProtoLog.i(WM_DEBUG_SCREEN_ON, "******************** ENABLING SCREEN!");
+ if (DEBUG_SCREEN_ON || DEBUG_BOOT) Slog.i(TAG_WM, "******************** ENABLING SCREEN!");
// Enable input dispatch.
mInputManagerCallback.setEventDispatchingLw(mEventDispatchingEnabled);
@@ -3349,21 +3353,24 @@ public class WindowManagerService extends IWindowManager.Stub
mH.removeMessages(H.CHECK_IF_BOOT_ANIMATION_FINISHED);
mH.sendEmptyMessageDelayed(H.CHECK_IF_BOOT_ANIMATION_FINISHED,
BOOT_ANIMATION_POLL_INTERVAL);
- ProtoLog.i(WM_DEBUG_BOOT, "checkBootAnimationComplete: Waiting for anim complete");
+ if (DEBUG_BOOT) Slog.i(TAG_WM, "checkBootAnimationComplete: Waiting for anim complete");
return false;
}
- ProtoLog.i(WM_DEBUG_BOOT, "checkBootAnimationComplete: Animation complete!");
+ if (DEBUG_BOOT) Slog.i(TAG_WM, "checkBootAnimationComplete: Animation complete!");
return true;
}
public void showBootMessage(final CharSequence msg, final boolean always) {
boolean first = false;
synchronized (mGlobalLock) {
- ProtoLog.i(WM_DEBUG_BOOT, "showBootMessage: msg=%s always=%b"
- + " mAllowBootMessages=%b mShowingBootMessages=%b"
- + " mSystemBooted=%b. %s", msg, always, mAllowBootMessages,
- mShowingBootMessages, mSystemBooted,
- new RuntimeException("here").fillInStackTrace());
+ if (DEBUG_BOOT) {
+ RuntimeException here = new RuntimeException("here");
+ here.fillInStackTrace();
+ Slog.i(TAG_WM, "showBootMessage: msg=" + msg + " always=" + always
+ + " mAllowBootMessages=" + mAllowBootMessages
+ + " mShowingBootMessages=" + mShowingBootMessages
+ + " mSystemBooted=" + mSystemBooted, here);
+ }
if (!mAllowBootMessages) {
return;
}
@@ -3385,11 +3392,14 @@ public class WindowManagerService extends IWindowManager.Stub
}
public void hideBootMessagesLocked() {
- ProtoLog.i(WM_DEBUG_BOOT, "hideBootMessagesLocked: mDisplayEnabled=%b"
- + " mForceDisplayEnabled=%b mShowingBootMessages=%b"
- + " mSystemBooted=%b. %s", mDisplayEnabled, mForceDisplayEnabled,
- mShowingBootMessages, mSystemBooted,
- new RuntimeException("here").fillInStackTrace());
+ if (DEBUG_BOOT) {
+ RuntimeException here = new RuntimeException("here");
+ here.fillInStackTrace();
+ Slog.i(TAG_WM, "hideBootMessagesLocked: mDisplayEnabled=" + mDisplayEnabled
+ + " mForceDisplayEnabled=" + mForceDisplayEnabled
+ + " mShowingBootMessages=" + mShowingBootMessages
+ + " mSystemBooted=" + mSystemBooted, here);
+ }
if (mShowingBootMessages) {
mShowingBootMessages = false;
mPolicy.hideBootMessages();
@@ -3681,7 +3691,8 @@ public class WindowManagerService extends IWindowManager.Stub
throw new SecurityException("Requires SET_ORIENTATION permission");
}
- ProtoLog.v(WM_DEBUG_ORIENTATION, "thawRotation: mRotation=%d", getDefaultDisplayRotation());
+ if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "thawRotation: mRotation="
+ + getDefaultDisplayRotation());
long origId = Binder.clearCallingIdentity();
try {
@@ -3730,9 +3741,9 @@ public class WindowManagerService extends IWindowManager.Stub
}
private void updateRotationUnchecked(boolean alwaysSendConfiguration, boolean forceRelayout) {
- ProtoLog.v(WM_DEBUG_ORIENTATION, "updateRotationUnchecked:"
- + " alwaysSendConfiguration=%b forceRelayout=%b",
- alwaysSendConfiguration, forceRelayout);
+ if(DEBUG_ORIENTATION) Slog.v(TAG_WM, "updateRotationUnchecked:"
+ + " alwaysSendConfiguration=" + alwaysSendConfiguration
+ + " forceRelayout=" + forceRelayout);
Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "updateRotation");
@@ -3981,7 +3992,7 @@ public class WindowManagerService extends IWindowManager.Stub
try {
return mViewServer.start();
} catch (IOException e) {
- ProtoLog.w(WM_ERROR, "View server did not start");
+ Slog.w(TAG_WM, "View server did not start");
}
}
return false;
@@ -3991,7 +4002,7 @@ public class WindowManagerService extends IWindowManager.Stub
mViewServer = new ViewServer(this, port);
return mViewServer.start();
} catch (IOException e) {
- ProtoLog.w(WM_ERROR, "View server did not start");
+ Slog.w(TAG_WM, "View server did not start");
}
return false;
}
@@ -4221,8 +4232,7 @@ public class WindowManagerService extends IWindowManager.Stub
}
} catch (Exception e) {
- ProtoLog.w(WM_ERROR, "Could not send command %s with parameters %s. %s", command,
- parameters, e);
+ Slog.w(TAG_WM, "Could not send command " + command + " with parameters " + parameters, e);
success = false;
} finally {
if (data != null) {
@@ -4371,9 +4381,9 @@ public class WindowManagerService extends IWindowManager.Stub
public boolean detectSafeMode() {
if (!mInputManagerCallback.waitForInputDevicesReady(
INPUT_DEVICES_READY_FOR_SAFE_MODE_DETECTION_TIMEOUT_MILLIS)) {
- ProtoLog.w(WM_ERROR, "Devices still not ready after waiting %d"
- + " milliseconds before attempting to detect safe mode.",
- INPUT_DEVICES_READY_FOR_SAFE_MODE_DETECTION_TIMEOUT_MILLIS);
+ Slog.w(TAG_WM, "Devices still not ready after waiting "
+ + INPUT_DEVICES_READY_FOR_SAFE_MODE_DETECTION_TIMEOUT_MILLIS
+ + " milliseconds before attempting to detect safe mode.");
}
if (Settings.Global.getInt(
@@ -4401,14 +4411,14 @@ public class WindowManagerService extends IWindowManager.Stub
} catch (IllegalArgumentException e) {
}
if (mSafeMode) {
- ProtoLog.i(WM_ERROR, "SAFE MODE ENABLED (menu=%d s=%d dpad=%d"
- + " trackball=%d)", menuState, sState, dpadState, trackballState);
+ Log.i(TAG_WM, "SAFE MODE ENABLED (menu=" + menuState + " s=" + sState
+ + " dpad=" + dpadState + " trackball=" + trackballState + ")");
// May already be set if (for instance) this process has crashed
if (SystemProperties.getInt(ShutdownThread.RO_SAFEMODE_PROPERTY, 0) == 0) {
SystemProperties.set(ShutdownThread.RO_SAFEMODE_PROPERTY, "1");
}
} else {
- ProtoLog.i(WM_ERROR, "SAFE MODE not enabled");
+ Log.i(TAG_WM, "SAFE MODE not enabled");
}
mPolicy.setSafeMode(mSafeMode);
return mSafeMode;
@@ -4567,11 +4577,10 @@ public class WindowManagerService extends IWindowManager.Stub
return;
}
displayContent.mLastFocus = newFocus;
- ProtoLog.i(WM_DEBUG_FOCUS_LIGHT, "Focus moving from %s"
- + " to %s displayId=%d", lastFocus, newFocus,
- displayContent.getDisplayId());
+ if (DEBUG_FOCUS_LIGHT) Slog.i(TAG_WM, "Focus moving from " + lastFocus +
+ " to " + newFocus + " displayId=" + displayContent.getDisplayId());
if (newFocus != null && lastFocus != null && !newFocus.isDisplayedLw()) {
- ProtoLog.i(WM_DEBUG_FOCUS_LIGHT, "Delaying loss of focus...");
+ if (DEBUG_FOCUS_LIGHT) Slog.i(TAG_WM, "Delaying loss of focus...");
displayContent.mLosingFocus.add(lastFocus);
lastFocus = null;
}
@@ -4585,13 +4594,13 @@ public class WindowManagerService extends IWindowManager.Stub
}
if (newFocus != null) {
- ProtoLog.i(WM_DEBUG_FOCUS_LIGHT, "Gaining focus: %s", newFocus);
+ if (DEBUG_FOCUS_LIGHT) Slog.i(TAG_WM, "Gaining focus: " + newFocus);
newFocus.reportFocusChangedSerialized(true, mInTouchMode);
notifyFocusChanged();
}
if (lastFocus != null) {
- ProtoLog.i(WM_DEBUG_FOCUS_LIGHT, "Losing focus: %s", lastFocus);
+ if (DEBUG_FOCUS_LIGHT) Slog.i(TAG_WM, "Losing focus: " + lastFocus);
lastFocus.reportFocusChangedSerialized(false, mInTouchMode);
}
break;
@@ -4608,7 +4617,7 @@ public class WindowManagerService extends IWindowManager.Stub
final int N = losers.size();
for (int i = 0; i < N; i++) {
- ProtoLog.i(WM_DEBUG_FOCUS_LIGHT, "Losing delayed focus: %s",
+ if (DEBUG_FOCUS_LIGHT) Slog.i(TAG_WM, "Losing delayed focus: " +
losers.get(i));
losers.get(i).reportFocusChangedSerialized(false, mInTouchMode);
}
@@ -4691,9 +4700,9 @@ public class WindowManagerService extends IWindowManager.Stub
case APP_FREEZE_TIMEOUT: {
synchronized (mGlobalLock) {
- ProtoLog.w(WM_ERROR, "App freeze timeout expired.");
+ Slog.w(TAG_WM, "App freeze timeout expired.");
mWindowsFreezingScreen = WINDOWS_FREEZING_SCREENS_TIMEOUT;
- for (int i = mAppFreezeListeners.size() - 1; i >= 0; --i) {
+ for (int i = mAppFreezeListeners.size() - 1; i >=0 ; --i) {
mAppFreezeListeners.get(i).onAppFreezeTimeout();
}
}
@@ -4734,8 +4743,7 @@ public class WindowManagerService extends IWindowManager.Stub
case WAITING_FOR_DRAWN_TIMEOUT: {
Runnable callback = null;
synchronized (mGlobalLock) {
- ProtoLog.w(WM_ERROR, "Timeout waiting for drawn: undrawn=%s",
- mWaitingForDrawn);
+ Slog.w(TAG_WM, "Timeout waiting for drawn: undrawn=" + mWaitingForDrawn);
mWaitingForDrawn.clear();
callback = mWaitingForDrawnCallback;
mWaitingForDrawnCallback = null;
@@ -4809,7 +4817,7 @@ public class WindowManagerService extends IWindowManager.Stub
case CHECK_IF_BOOT_ANIMATION_FINISHED: {
final boolean bootAnimationComplete;
synchronized (mGlobalLock) {
- ProtoLog.i(WM_DEBUG_BOOT, "CHECK_IF_BOOT_ANIMATION_FINISHED:");
+ if (DEBUG_BOOT) Slog.i(TAG_WM, "CHECK_IF_BOOT_ANIMATION_FINISHED:");
bootAnimationComplete = checkBootAnimationCompleteLocked();
}
if (bootAnimationComplete) {
@@ -5023,10 +5031,10 @@ public class WindowManagerService extends IWindowManager.Stub
int width, height;
try {
width = Integer.parseInt(sizeStr.substring(0, pos));
- height = Integer.parseInt(sizeStr.substring(pos + 1));
+ height = Integer.parseInt(sizeStr.substring(pos+1));
if (displayContent.mBaseDisplayWidth != width
|| displayContent.mBaseDisplayHeight != height) {
- ProtoLog.i(WM_ERROR, "FORCED DISPLAY SIZE: %dx%d", width, height);
+ Slog.i(TAG_WM, "FORCED DISPLAY SIZE: " + width + "x" + height);
displayContent.updateBaseDisplayMetrics(width, height,
displayContent.mBaseDisplayDensity);
changed = true;
@@ -5047,7 +5055,7 @@ public class WindowManagerService extends IWindowManager.Stub
int mode = Settings.Global.getInt(mContext.getContentResolver(),
Settings.Global.DISPLAY_SCALING_FORCE, 0);
if (displayContent.mDisplayScalingDisabled != (mode != 0)) {
- ProtoLog.i(WM_ERROR, "FORCED DISPLAY SCALING DISABLED");
+ Slog.i(TAG_WM, "FORCED DISPLAY SCALING DISABLED");
displayContent.mDisplayScalingDisabled = true;
changed = true;
}
@@ -5227,7 +5235,7 @@ public class WindowManagerService extends IWindowManager.Stub
throw new IllegalArgumentException(
"Requested window " + client + " does not exist");
}
- ProtoLog.w(WM_ERROR, "Failed looking up window callers=%s", Debug.getCallers(3));
+ Slog.w(TAG_WM, "Failed looking up window callers=" + Debug.getCallers(3));
return null;
}
if (session != null && win.mSession != session) {
@@ -5235,7 +5243,7 @@ public class WindowManagerService extends IWindowManager.Stub
throw new IllegalArgumentException("Requested window " + client + " is in session "
+ win.mSession + ", not " + session);
}
- ProtoLog.w(WM_ERROR, "Failed looking up window callers=%s", Debug.getCallers(3));
+ Slog.w(TAG_WM, "Failed looking up window callers=" + Debug.getCallers(3));
return null;
}
@@ -5247,7 +5255,7 @@ public class WindowManagerService extends IWindowManager.Stub
// it frozen/off until this window draws at its new
// orientation.
if (!w.mToken.okToDisplay() && mWindowsFreezingScreen != WINDOWS_FREEZING_SCREENS_TIMEOUT) {
- ProtoLog.v(WM_DEBUG_ORIENTATION, "Changing surface while display frozen: %s", w);
+ if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Changing surface while display frozen: " + w);
w.setOrientationChanging(true);
w.mLastFreezeDuration = 0;
mRoot.mOrientationChangeComplete = false;
@@ -5267,22 +5275,22 @@ public class WindowManagerService extends IWindowManager.Stub
}
for (int j = mWaitingForDrawn.size() - 1; j >= 0; j--) {
WindowState win = mWaitingForDrawn.get(j);
- ProtoLog.i(WM_DEBUG_SCREEN_ON,
- "Waiting for drawn %s: removed=%b visible=%b mHasSurface=%b drawState=%d",
- win, win.mRemoved, win.isVisibleLw(), win.mHasSurface,
- win.mWinAnimator.mDrawState);
+ if (DEBUG_SCREEN_ON) Slog.i(TAG_WM, "Waiting for drawn " + win +
+ ": removed=" + win.mRemoved + " visible=" + win.isVisibleLw() +
+ " mHasSurface=" + win.mHasSurface +
+ " drawState=" + win.mWinAnimator.mDrawState);
if (win.mRemoved || !win.mHasSurface || !win.isVisibleByPolicy()) {
// Window has been removed or hidden; no draw will now happen, so stop waiting.
- ProtoLog.w(WM_DEBUG_SCREEN_ON, "Aborted waiting for drawn: %s", win);
+ if (DEBUG_SCREEN_ON) Slog.w(TAG_WM, "Aborted waiting for drawn: " + win);
mWaitingForDrawn.remove(win);
} else if (win.hasDrawnLw()) {
// Window is now drawn (and shown).
- ProtoLog.d(WM_DEBUG_SCREEN_ON, "Window drawn win=%s", win);
+ if (DEBUG_SCREEN_ON) Slog.d(TAG_WM, "Window drawn win=" + win);
mWaitingForDrawn.remove(win);
}
}
if (mWaitingForDrawn.isEmpty()) {
- ProtoLog.d(WM_DEBUG_SCREEN_ON, "All windows drawn!");
+ if (DEBUG_SCREEN_ON) Slog.d(TAG_WM, "All windows drawn!");
mH.removeMessages(H.WAITING_FOR_DRAWN_TIMEOUT);
mH.sendEmptyMessage(H.ALL_WINDOWS_DRAWN);
}
@@ -5299,15 +5307,19 @@ public class WindowManagerService extends IWindowManager.Stub
final boolean state = mHoldingScreenWakeLock.isHeld();
if (hold != state) {
if (hold) {
- ProtoLog.d(WM_DEBUG_KEEP_SCREEN_ON, "Acquiring screen wakelock due to %s",
- mRoot.mHoldScreenWindow);
+ if (DEBUG_KEEP_SCREEN_ON) {
+ Slog.d(TAG_KEEP_SCREEN_ON, "Acquiring screen wakelock due to "
+ + mRoot.mHoldScreenWindow);
+ }
mLastWakeLockHoldingWindow = mRoot.mHoldScreenWindow;
mLastWakeLockObscuringWindow = null;
mHoldingScreenWakeLock.acquire();
mPolicy.keepScreenOnStartedLw();
} else {
- ProtoLog.d(WM_DEBUG_KEEP_SCREEN_ON, "Releasing screen wakelock, obscured by %s",
- mRoot.mObscuringWindow);
+ if (DEBUG_KEEP_SCREEN_ON) {
+ Slog.d(TAG_KEEP_SCREEN_ON, "Releasing screen wakelock, obscured by "
+ + mRoot.mObscuringWindow);
+ }
mLastWakeLockHoldingWindow = null;
mLastWakeLockObscuringWindow = mRoot.mObscuringWindow;
mPolicy.keepScreenOnStoppedLw();
@@ -5351,9 +5363,10 @@ public class WindowManagerService extends IWindowManager.Stub
return;
}
- ProtoLog.d(WM_DEBUG_ORIENTATION,
- "startFreezingDisplayLocked: exitAnim=%d enterAnim=%d called by %s",
- exitAnim, enterAnim, Debug.getCallers(8));
+ if (DEBUG_ORIENTATION) Slog.d(TAG_WM,
+ "startFreezingDisplayLocked: exitAnim="
+ + exitAnim + " enterAnim=" + enterAnim
+ + " called by " + Debug.getCallers(8));
mScreenFrozenLock.acquire();
mDisplayFrozen = true;
@@ -5406,17 +5419,17 @@ public class WindowManagerService extends IWindowManager.Stub
if (waitingForConfig || mAppsFreezingScreen > 0
|| mWindowsFreezingScreen == WINDOWS_FREEZING_SCREENS_ACTIVE
|| mClientFreezingScreen || numOpeningApps > 0) {
- ProtoLog.d(WM_DEBUG_ORIENTATION,
- "stopFreezingDisplayLocked: Returning mWaitingForConfig=%b, "
- + "mAppsFreezingScreen=%d, mWindowsFreezingScreen=%d, "
- + "mClientFreezingScreen=%b, mOpeningApps.size()=%d",
- waitingForConfig, mAppsFreezingScreen, mWindowsFreezingScreen,
- mClientFreezingScreen, numOpeningApps);
+ if (DEBUG_ORIENTATION) Slog.d(TAG_WM,
+ "stopFreezingDisplayLocked: Returning mWaitingForConfig=" + waitingForConfig
+ + ", mAppsFreezingScreen=" + mAppsFreezingScreen
+ + ", mWindowsFreezingScreen=" + mWindowsFreezingScreen
+ + ", mClientFreezingScreen=" + mClientFreezingScreen
+ + ", mOpeningApps.size()=" + numOpeningApps);
return;
}
- ProtoLog.d(WM_DEBUG_ORIENTATION,
- "stopFreezingDisplayLocked: Unfreezing now");
+ if (DEBUG_ORIENTATION) Slog.d(TAG_WM,
+ "stopFreezingDisplayLocked: Unfreezing now");
// We must make a local copy of the displayId as it can be potentially overwritten later on
@@ -5434,7 +5447,7 @@ public class WindowManagerService extends IWindowManager.Stub
sb.append(" due to ");
sb.append(mLastFinishedFreezeSource);
}
- ProtoLog.i(WM_ERROR, "%s", sb.toString());
+ Slog.i(TAG_WM, sb.toString());
mH.removeMessages(H.APP_FREEZE_TIMEOUT);
mH.removeMessages(H.CLIENT_FREEZE_TIMEOUT);
if (PROFILE_ORIENTATION) {
@@ -5446,7 +5459,7 @@ public class WindowManagerService extends IWindowManager.Stub
ScreenRotationAnimation screenRotationAnimation =
mAnimator.getScreenRotationAnimationLocked(displayId);
if (screenRotationAnimation != null && screenRotationAnimation.hasScreenshot()) {
- ProtoLog.i(WM_DEBUG_ORIENTATION, "**** Dismissing screen rotation animation");
+ if (DEBUG_ORIENTATION) Slog.i(TAG_WM, "**** Dismissing screen rotation animation");
DisplayInfo displayInfo = displayContent.getDisplayInfo();
// Get rotation animation again, with new top window
if (!displayContent.getDisplayRotation().validateRotationAnimation(
@@ -5490,7 +5503,7 @@ public class WindowManagerService extends IWindowManager.Stub
mScreenFrozenLock.release();
if (updateRotation && displayContent != null) {
- ProtoLog.d(WM_DEBUG_ORIENTATION, "Performing post-rotate rotation");
+ if (DEBUG_ORIENTATION) Slog.d(TAG_WM, "Performing post-rotate rotation");
configChanged |= displayContent.updateRotationUnchecked();
}
@@ -6303,20 +6316,17 @@ public class WindowManagerService extends IWindowManager.Stub
/**
* Hint to a token that its activity will relaunch, which will trigger removal and addition of
* a window.
- *
* @param token Application token for which the activity will be relaunched.
*/
void setWillReplaceWindow(IBinder token, boolean animate) {
final AppWindowToken appWindowToken = mRoot.getAppWindowToken(token);
if (appWindowToken == null) {
- ProtoLog.w(WM_ERROR, "Attempted to set replacing window on non-existing app token %s",
- token);
+ Slog.w(TAG_WM, "Attempted to set replacing window on non-existing app token " + token);
return;
}
if (!appWindowToken.hasContentToDisplay()) {
- ProtoLog.w(WM_ERROR,
- "Attempted to set replacing window on app token with no content %s",
- token);
+ Slog.w(TAG_WM, "Attempted to set replacing window on app token with no content"
+ + token);
return;
}
appWindowToken.setWillReplaceWindows(animate);
@@ -6338,15 +6348,13 @@ public class WindowManagerService extends IWindowManager.Stub
synchronized (mGlobalLock) {
final AppWindowToken appWindowToken = mRoot.getAppWindowToken(token);
if (appWindowToken == null) {
- ProtoLog.w(WM_ERROR,
- "Attempted to set replacing window on non-existing app token %s",
- token);
+ Slog.w(TAG_WM, "Attempted to set replacing window on non-existing app token "
+ + token);
return;
}
if (!appWindowToken.hasContentToDisplay()) {
- ProtoLog.w(WM_ERROR,
- "Attempted to set replacing window on app token with no content %s",
- token);
+ Slog.w(TAG_WM, "Attempted to set replacing window on app token with no content"
+ + token);
return;
}
@@ -6366,14 +6374,14 @@ public class WindowManagerService extends IWindowManager.Stub
*
* If we're not replacing the window, clear the replace window settings of the app.
*
- * @param token Application token for the activity whose window might be replaced.
+ * @param token Application token for the activity whose window might be replaced.
* @param replacing Whether the window is being replaced or not.
*/
void scheduleClearWillReplaceWindows(IBinder token, boolean replacing) {
final AppWindowToken appWindowToken = mRoot.getAppWindowToken(token);
if (appWindowToken == null) {
- ProtoLog.w(WM_ERROR, "Attempted to reset replacing window on non-existing app token %s",
- token);
+ Slog.w(TAG_WM, "Attempted to reset replacing window on non-existing app token "
+ + token);
return;
}
if (replacing) {
@@ -6562,7 +6570,7 @@ public class WindowManagerService extends IWindowManager.Stub
}
WindowState callingWin = windowForClientLocked(null, client, false);
if (callingWin == null) {
- ProtoLog.w(WM_ERROR, "Bad requesting window %s", client);
+ Slog.w(TAG_WM, "Bad requesting window " + client);
return;
}
final DisplayContent displayContent = callingWin.getDisplayContent();
@@ -6579,7 +6587,7 @@ public class WindowManagerService extends IWindowManager.Stub
windowUnderPointer.translateToWindowX(mouseX),
windowUnderPointer.translateToWindowY(mouseY));
} catch (RemoteException e) {
- ProtoLog.w(WM_ERROR, "unable to update pointer icon");
+ Slog.w(TAG_WM, "unable to update pointer icon");
}
}
}
@@ -6596,7 +6604,7 @@ public class WindowManagerService extends IWindowManager.Stub
windowUnderPointer.translateToWindowX(latestX),
windowUnderPointer.translateToWindowY(latestY));
} catch (RemoteException e) {
- ProtoLog.w(WM_ERROR, "unable to restore pointer icon");
+ Slog.w(TAG_WM, "unable to restore pointer icon");
}
} else {
InputManager.getInstance().setPointerIconType(PointerIcon.TYPE_DEFAULT);
@@ -6626,7 +6634,7 @@ public class WindowManagerService extends IWindowManager.Stub
try {
final WindowState win = windowForClientLocked(null, client, false);
if (win == null) {
- ProtoLog.w(WM_ERROR, "Bad requesting window %s", client);
+ Slog.w(TAG_WM, "Bad requesting window " + client);
return;
}
getDisplayContentOrCreate(displayId, null).reparentDisplayContent(win, sc);
@@ -6651,7 +6659,7 @@ public class WindowManagerService extends IWindowManager.Stub
try {
final WindowState win = windowForClientLocked(null, client, false);
if (win == null) {
- ProtoLog.w(WM_ERROR, "Bad requesting window %s", client);
+ Slog.w(TAG_WM, "Bad requesting window " + client);
return;
}
final DisplayContent displayContent = mRoot.getDisplayContent(displayId);
@@ -6678,7 +6686,7 @@ public class WindowManagerService extends IWindowManager.Stub
synchronized (mGlobalLock) {
final WindowState callingWin = windowForClientLocked(null, client, false);
if (callingWin == null) {
- ProtoLog.w(WM_ERROR, "Bad requesting window %s", client);
+ Slog.w(TAG_WM, "Bad requesting window " + client);
return;
}
callingWin.updateTapExcludeRegion(regionId, region);
@@ -6717,9 +6725,8 @@ public class WindowManagerService extends IWindowManager.Stub
synchronized (mGlobalLock) {
final DisplayContent displayContent = mRoot.getDisplayContent(displayId);
if (displayContent == null) {
- ProtoLog.w(WM_ERROR,
- "Attempted to get windowing mode of a display that does not exist: %d",
- displayId);
+ Slog.w(TAG_WM, "Attempted to get windowing mode of a display that does not exist: "
+ + displayId);
return WindowConfiguration.WINDOWING_MODE_UNDEFINED;
}
return mDisplayWindowSettings.getWindowingModeLocked(displayContent);
@@ -6735,9 +6742,8 @@ public class WindowManagerService extends IWindowManager.Stub
synchronized (mGlobalLock) {
final DisplayContent displayContent = getDisplayContentOrCreate(displayId, null);
if (displayContent == null) {
- ProtoLog.w(WM_ERROR,
- "Attempted to set windowing mode to a display that does not exist: %d",
- displayId);
+ Slog.w(TAG_WM, "Attempted to set windowing mode to a display that does not exist: "
+ + displayId);
return;
}
@@ -6772,9 +6778,8 @@ public class WindowManagerService extends IWindowManager.Stub
synchronized (mGlobalLock) {
final DisplayContent displayContent = mRoot.getDisplayContent(displayId);
if (displayContent == null) {
- ProtoLog.w(WM_ERROR,
- "Attempted to get remove mode of a display that does not exist: %d",
- displayId);
+ Slog.w(TAG_WM, "Attempted to get remove mode of a display that does not exist: "
+ + displayId);
return REMOVE_CONTENT_MODE_UNDEFINED;
}
return mDisplayWindowSettings.getRemoveContentModeLocked(displayContent);
@@ -6790,9 +6795,8 @@ public class WindowManagerService extends IWindowManager.Stub
synchronized (mGlobalLock) {
final DisplayContent displayContent = getDisplayContentOrCreate(displayId, null);
if (displayContent == null) {
- ProtoLog.w(WM_ERROR,
- "Attempted to set remove mode to a display that does not exist: %d",
- displayId);
+ Slog.w(TAG_WM, "Attempted to set remove mode to a display that does not exist: "
+ + displayId);
return;
}
@@ -6811,8 +6815,8 @@ public class WindowManagerService extends IWindowManager.Stub
synchronized (mGlobalLock) {
final DisplayContent displayContent = mRoot.getDisplayContent(displayId);
if (displayContent == null) {
- ProtoLog.w(WM_ERROR, "Attempted to get flag of a display that does not exist: %d",
- displayId);
+ Slog.w(TAG_WM, "Attempted to get flag of a display that does not exist: "
+ + displayId);
return false;
}
return mDisplayWindowSettings.shouldShowWithInsecureKeyguardLocked(displayContent);
@@ -6829,8 +6833,8 @@ public class WindowManagerService extends IWindowManager.Stub
synchronized (mGlobalLock) {
final DisplayContent displayContent = getDisplayContentOrCreate(displayId, null);
if (displayContent == null) {
- ProtoLog.w(WM_ERROR, "Attempted to set flag to a display that does not exist: %d",
- displayId);
+ Slog.w(TAG_WM, "Attempted to set flag to a display that does not exist: "
+ + displayId);
return;
}
@@ -6850,8 +6854,8 @@ public class WindowManagerService extends IWindowManager.Stub
synchronized (mGlobalLock) {
final DisplayContent displayContent = mRoot.getDisplayContent(displayId);
if (displayContent == null) {
- ProtoLog.w(WM_ERROR, "Attempted to get system decors flag of a display that does "
- + "not exist: %d", displayId);
+ Slog.w(TAG_WM, "Attempted to get system decors flag of a display that does "
+ + "not exist: " + displayId);
return false;
}
if (displayContent.isUntrustedVirtualDisplay()) {
@@ -6870,8 +6874,8 @@ public class WindowManagerService extends IWindowManager.Stub
synchronized (mGlobalLock) {
final DisplayContent displayContent = getDisplayContentOrCreate(displayId, null);
if (displayContent == null) {
- ProtoLog.w(WM_ERROR, "Attempted to set system decors flag to a display that does "
- + "not exist: %d", displayId);
+ Slog.w(TAG_WM, "Attempted to set system decors flag to a display that does "
+ + "not exist: " + displayId);
return;
}
if (displayContent.isUntrustedVirtualDisplay()) {
@@ -6894,9 +6898,8 @@ public class WindowManagerService extends IWindowManager.Stub
synchronized (mGlobalLock) {
final DisplayContent displayContent = mRoot.getDisplayContent(displayId);
if (displayContent == null) {
- ProtoLog.w(WM_ERROR,
- "Attempted to get IME flag of a display that does not exist: %d",
- displayId);
+ Slog.w(TAG_WM, "Attempted to get IME flag of a display that does not exist: "
+ + displayId);
return false;
}
if (displayContent.isUntrustedVirtualDisplay()) {
@@ -6916,9 +6919,8 @@ public class WindowManagerService extends IWindowManager.Stub
synchronized (mGlobalLock) {
final DisplayContent displayContent = getDisplayContentOrCreate(displayId, null);
if (displayContent == null) {
- ProtoLog.w(WM_ERROR,
- "Attempted to set IME flag to a display that does not exist: %d",
- displayId);
+ Slog.w(TAG_WM, "Attempted to set IME flag to a display that does not exist: "
+ + displayId);
return;
}
if (displayContent.isUntrustedVirtualDisplay()) {
@@ -7135,16 +7137,15 @@ public class WindowManagerService extends IWindowManager.Stub
if (removeWindows) {
final DisplayContent dc = mRoot.getDisplayContent(displayId);
if (dc == null) {
- ProtoLog.w(WM_ERROR, "removeWindowToken: Attempted to remove token: %s"
- + " for non-exiting displayId=%d", binder, displayId);
+ Slog.w(TAG_WM, "removeWindowToken: Attempted to remove token: " + binder
+ + " for non-exiting displayId=" + displayId);
return;
}
final WindowToken token = dc.removeWindowToken(binder);
if (token == null) {
- ProtoLog.w(WM_ERROR,
- "removeWindowToken: Attempted to remove non-existing token: %s",
- binder);
+ Slog.w(TAG_WM, "removeWindowToken: Attempted to remove non-existing token: "
+ + binder);
return;
}
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java
index 2974bbb1aacf..0a65e3240885 100644
--- a/services/core/java/com/android/server/wm/WindowState.java
+++ b/services/core/java/com/android/server/wm/WindowState.java
@@ -90,20 +90,20 @@ import static com.android.server.wm.IdentifierProto.USER_ID;
import static com.android.server.wm.MoveAnimationSpecProto.DURATION_MS;
import static com.android.server.wm.MoveAnimationSpecProto.FROM;
import static com.android.server.wm.MoveAnimationSpecProto.TO;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_ADD_REMOVE;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_APP_TRANSITIONS;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_FOCUS;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_FOCUS_LIGHT;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_ORIENTATION;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_RESIZE;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_STARTING_WINDOW;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG;
+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_APP_TRANSITIONS;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_CONFIGURATION;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_FOCUS;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_FOCUS_LIGHT;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_INPUT_METHOD;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_LAYOUT;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_LAYOUT_REPEATS;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ORIENTATION;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_POWER;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_RESIZE;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_STARTING_WINDOW;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_STARTING_WINDOW_VERBOSE;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_VISIBILITY;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WALLPAPER_LIGHT;
@@ -206,7 +206,6 @@ import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.policy.KeyInterceptionInfo;
import com.android.internal.util.ToBooleanFunction;
import com.android.server.policy.WindowManagerPolicy;
-import com.android.server.protolog.common.ProtoLog;
import com.android.server.wm.LocalAnimationAdapter.AnimationSpec;
import com.android.server.wm.utils.InsetUtils;
import com.android.server.wm.utils.WmDisplayCutout;
@@ -782,7 +781,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
mSubLayer = mPolicy.getSubWindowLayerFromTypeLw(a.type);
mIsChildWindow = true;
- ProtoLog.v(WM_DEBUG_ADD_REMOVE, "Adding %s to %s", this, parentWindow);
+ if (DEBUG_ADD_REMOVE) Slog.v(TAG, "Adding " + this + " to " + parentWindow);
parentWindow.addChild(this, sWindowSubLayerComparator);
mLayoutAttached = mAttrs.type !=
@@ -1295,11 +1294,14 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
|| configChanged
|| dragResizingChanged
|| mReportOrientationChanged) {
- ProtoLog.v(WM_DEBUG_RESIZE,
- "Resize reasons for w=%s: %s surfaceResized=%b configChanged=%b "
- + "dragResizingChanged=%b reportOrientationChanged=%b",
- this, mWindowFrames.getInsetsChangedInfo(), winAnimator.mSurfaceResized,
- configChanged, dragResizingChanged, mReportOrientationChanged);
+ if (DEBUG_RESIZE || DEBUG_ORIENTATION) {
+ Slog.v(TAG_WM, "Resize reasons for w=" + this + ": "
+ + " " + mWindowFrames.getInsetsChangedInfo()
+ + " surfaceResized=" + winAnimator.mSurfaceResized
+ + " configChanged=" + configChanged
+ + " dragResizingChanged=" + dragResizingChanged
+ + " reportOrientationChanged=" + mReportOrientationChanged);
+ }
// If it's a dead window left on screen, and the configuration changed, there is nothing
// we can do about it. Remove the window now.
@@ -1316,31 +1318,24 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
// redrawn; to do that, we need to go through the process of getting informed by the
// application when it has finished drawing.
if (getOrientationChanging() || dragResizingChanged) {
- if (getOrientationChanging()) {
- Slog.v(TAG_WM, "Orientation start waiting for draw"
+ if (DEBUG_ANIM || DEBUG_ORIENTATION || DEBUG_RESIZE) {
+ Slog.v(TAG_WM, "Orientation or resize start waiting for draw"
+ ", mDrawState=DRAW_PENDING in " + this
+ ", surfaceController " + winAnimator.mSurfaceController);
}
- if (dragResizingChanged) {
- ProtoLog.v(WM_DEBUG_RESIZE,
- "Resize start waiting for draw, "
- + "mDrawState=DRAW_PENDING in %s, surfaceController %s",
- this, winAnimator.mSurfaceController);
- }
winAnimator.mDrawState = DRAW_PENDING;
if (mAppToken != null) {
mAppToken.clearAllDrawn();
}
}
if (!mWmService.mResizingWindows.contains(this)) {
- ProtoLog.v(WM_DEBUG_RESIZE, "Resizing window %s", this);
+ if (DEBUG_RESIZE || DEBUG_ORIENTATION) Slog.v(TAG_WM, "Resizing window " + this);
mWmService.mResizingWindows.add(this);
}
} else if (getOrientationChanging()) {
if (isDrawnLw()) {
- ProtoLog.v(WM_DEBUG_ORIENTATION,
- "Orientation not waiting for draw in %s, surfaceController %s", this,
- winAnimator.mSurfaceController);
+ if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Orientation not waiting for draw in "
+ + this + ", surfaceController " + winAnimator.mSurfaceController);
setOrientationChanging(false);
mLastFreezeDuration = (int)(SystemClock.elapsedRealtime()
- mWmService.mDisplayFreezeTime);
@@ -1710,7 +1705,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
@Override
void onMovedByResize() {
- ProtoLog.d(WM_DEBUG_RESIZE, "onMovedByResize: Moving %s", this);
+ if (DEBUG_RESIZE) Slog.d(TAG, "onMovedByResize: Moving " + this);
mMovedByResize = true;
super.onMovedByResize();
}
@@ -1784,7 +1779,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
void onResize() {
final ArrayList<WindowState> resizingWindows = mWmService.mResizingWindows;
if (mHasSurface && !isGoneForLayoutLw() && !resizingWindows.contains(this)) {
- ProtoLog.d(WM_DEBUG_RESIZE, "onResize: Resizing %s", this);
+ if (DEBUG_RESIZE) Slog.d(TAG, "onResize: Resizing " + this);
resizingWindows.add(this);
}
if (isGoneForLayoutLw()) {
@@ -1927,8 +1922,8 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
if (mRemoved) {
// Nothing to do.
- ProtoLog.v(WM_DEBUG_ADD_REMOVE,
- "WS.removeImmediately: %s Already removed...", this);
+ if (DEBUG_ADD_REMOVE) Slog.v(TAG_WM,
+ "WS.removeImmediately: " + this + " Already removed...");
return;
}
@@ -1978,35 +1973,39 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
private void removeIfPossible(boolean keepVisibleDeadWindow) {
mWindowRemovalAllowed = true;
- ProtoLog.v(WM_DEBUG_ADD_REMOVE,
- "removeIfPossible: %s callers=%s", this, Debug.getCallers(5));
+ if (DEBUG_ADD_REMOVE) Slog.v(TAG,
+ "removeIfPossible: " + this + " callers=" + Debug.getCallers(5));
final boolean startingWindow = mAttrs.type == TYPE_APPLICATION_STARTING;
- if (startingWindow) {
- ProtoLog.d(WM_DEBUG_STARTING_WINDOW, "Starting window removed %s", this);
- }
-
- ProtoLog.v(WM_DEBUG_FOCUS, "Remove client=%x, surfaceController=%s Callers=%s",
- System.identityHashCode(mClient.asBinder()),
- mWinAnimator.mSurfaceController,
- Debug.getCallers(5));
+ if (startingWindow && DEBUG_STARTING_WINDOW) Slog.d(TAG_WM,
+ "Starting window removed " + this);
+ if (DEBUG || DEBUG_FOCUS || DEBUG_FOCUS_LIGHT && isFocused()) {
+ Slog.v(TAG_WM, "Remove " + this + " client="
+ + Integer.toHexString(System.identityHashCode(mClient.asBinder()))
+ + ", surfaceController=" + mWinAnimator.mSurfaceController + " Callers="
+ + Debug.getCallers(5));
+ }
final long origId = Binder.clearCallingIdentity();
try {
disposeInputChannel();
- ProtoLog.v(WM_DEBUG_APP_TRANSITIONS,
- "Remove %s: mSurfaceController=%s mAnimatingExit=%b mRemoveOnExit=%b "
- + "mHasSurface=%b surfaceShowing=%b animating=%b app-animation=%b "
- + "mWillReplaceWindow=%b inPendingTransaction=%b mDisplayFrozen=%b "
- + "callers=%s",
- this, mWinAnimator.mSurfaceController, mAnimatingExit, mRemoveOnExit,
- mHasSurface, mWinAnimator.getShown(), isAnimating(),
- mAppToken != null && mAppToken.isSelfAnimating(), mWillReplaceWindow,
- mAppToken != null && mAppToken.inPendingTransaction,
- mWmService.mDisplayFrozen, Debug.getCallers(6));
+ if (DEBUG_APP_TRANSITIONS) Slog.v(TAG_WM, "Remove " + this
+ + ": mSurfaceController=" + mWinAnimator.mSurfaceController
+ + " mAnimatingExit=" + mAnimatingExit
+ + " mRemoveOnExit=" + mRemoveOnExit
+ + " mHasSurface=" + mHasSurface
+ + " surfaceShowing=" + mWinAnimator.getShown()
+ + " animating=" + isAnimating()
+ + " app-animation="
+ + (mAppToken != null ? mAppToken.isSelfAnimating() : "false")
+ + " mWillReplaceWindow=" + mWillReplaceWindow
+ + " inPendingTransaction="
+ + (mAppToken != null ? mAppToken.inPendingTransaction : false)
+ + " mDisplayFrozen=" + mWmService.mDisplayFrozen
+ + " callers=" + Debug.getCallers(6));
// Visibility of the removed window. Will be used later to update orientation later on.
boolean wasVisible = false;
@@ -2018,8 +2017,8 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
if (mWillReplaceWindow) {
// This window is going to be replaced. We need to keep it around until the new one
// gets added, then we will get rid of this one.
- ProtoLog.v(WM_DEBUG_ADD_REMOVE,
- "Preserving %s until the new one is added", this);
+ if (DEBUG_ADD_REMOVE) Slog.v(TAG_WM,
+ "Preserving " + this + " until the new one is " + "added");
// TODO: We are overloading mAnimatingExit flag to prevent the window state from
// been removed. We probably need another flag to indicate that window removal
// should be deffered vs. overloading the flag that says we are playing an exit
@@ -2033,8 +2032,8 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
wasVisible = isWinVisibleLw();
if (keepVisibleDeadWindow) {
- ProtoLog.v(WM_DEBUG_ADD_REMOVE,
- "Not removing %s because app died while it's visible", this);
+ if (DEBUG_ADD_REMOVE) Slog.v(TAG_WM,
+ "Not removing " + this + " because app died while it's visible");
mAppDied = true;
setDisplayLayoutNeeded();
@@ -2075,8 +2074,8 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
if (mWinAnimator.getShown() && mAnimatingExit
&& (!lastWindowIsStartingWindow || isAnimating)) {
// The exit animation is running or should run... wait for it!
- ProtoLog.v(WM_DEBUG_ADD_REMOVE,
- "Not removing %s due to exit animation", this);
+ if (DEBUG_ADD_REMOVE) Slog.v(TAG_WM,
+ "Not removing " + this + " due to exit animation ");
setupWindowForRemoveOnExit();
if (mAppToken != null) {
mAppToken.updateReportedVisibilityLocked();
@@ -2243,7 +2242,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
}
private void removeReplacedWindow() {
- ProtoLog.d(WM_DEBUG_ADD_REMOVE, "Removing replaced window: %s", this);
+ if (DEBUG_ADD_REMOVE) Slog.d(TAG, "Removing replaced window: " + this);
mWillReplaceWindow = false;
mAnimateReplacingWindow = false;
mReplacingRemoveRequested = false;
@@ -2399,7 +2398,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
if (!isVisibleByPolicy()) {
mWinAnimator.hide("checkPolicyVisibilityChange");
if (isFocused()) {
- ProtoLog.i(WM_DEBUG_FOCUS_LIGHT,
+ if (DEBUG_FOCUS_LIGHT) Slog.i(TAG,
"setAnimationLocked: setting mFocusMayChange true");
mWmService.mFocusMayChange = true;
}
@@ -2722,7 +2721,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
// we allow the display to be enabled now.
mWmService.enableScreenIfNeededLocked();
if (isFocused) {
- ProtoLog.i(WM_DEBUG_FOCUS_LIGHT,
+ if (DEBUG_FOCUS_LIGHT) Slog.i(TAG,
"WindowState.hideLw: setting mFocusMayChange true");
mWmService.mFocusMayChange = true;
}
@@ -2928,8 +2927,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
if (mHasSurface && !getOrientationChanging()
&& mWmService.mWindowsFreezingScreen != WINDOWS_FREEZING_SCREENS_TIMEOUT) {
- ProtoLog.v(WM_DEBUG_ORIENTATION,
- "set mOrientationChanging of %s", this);
+ if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "set mOrientationChanging of " + this);
setOrientationChanging(true);
mWmService.mRoot.mOrientationChangeComplete = false;
}
@@ -2957,11 +2955,10 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
}
if (mDestroying) {
- ProtoLog.e(WM_DEBUG_ADD_REMOVE, "win=%s"
- + " destroySurfaces: appStopped=%b"
- + " win.mWindowRemovalAllowed=%b"
- + " win.mRemoveOnExit=%b", this, appStopped,
- mWindowRemovalAllowed, mRemoveOnExit);
+ if (DEBUG_ADD_REMOVE) Slog.e(TAG_WM, "win=" + this
+ + " destroySurfaces: appStopped=" + appStopped
+ + " win.mWindowRemovalAllowed=" + mWindowRemovalAllowed
+ + " win.mRemoveOnExit=" + mRemoveOnExit);
if (!cleanupOnResume || mRemoveOnExit) {
destroySurfaceUnchecked();
}
@@ -3229,19 +3226,16 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
void reportResized() {
Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "wm.reportResized_" + getWindowTag());
try {
- ProtoLog.v(WM_DEBUG_RESIZE,
- "Reporting new frame to %s: %s", this,
- mWindowFrames.mCompatFrame);
+ if (DEBUG_RESIZE || DEBUG_ORIENTATION) Slog.v(TAG, "Reporting new frame to " + this
+ + ": " + mWindowFrames.mCompatFrame);
final MergedConfiguration mergedConfiguration =
new MergedConfiguration(mWmService.mRoot.getConfiguration(),
getMergedOverrideConfiguration());
setLastReportedMergedConfiguration(mergedConfiguration);
- if (mWinAnimator.mDrawState == DRAW_PENDING) {
- ProtoLog.i(WM_DEBUG_ORIENTATION,
- "Resizing %s WITH DRAW PENDING", this);
- }
+ if (DEBUG_ORIENTATION && mWinAnimator.mDrawState == DRAW_PENDING)
+ Slog.i(TAG, "Resizing " + this + " WITH DRAW PENDING");
final Rect frame = mWindowFrames.mCompatFrame;
final Rect overscanInsets = mWindowFrames.mLastOverscanInsets;
@@ -4384,8 +4378,9 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
return;
}
- ProtoLog.v(WM_DEBUG_ADD_REMOVE, "Exit animation finished in %s: remove=%b",
- this, mRemoveOnExit);
+ if (DEBUG || DEBUG_ADD_REMOVE) {
+ Slog.v(TAG, "Exit animation finished in " + this + ": remove=" + mRemoveOnExit);
+ }
mDestroying = true;
diff --git a/services/core/java/com/android/server/wm/WindowStateAnimator.java b/services/core/java/com/android/server/wm/WindowStateAnimator.java
index a4a5d9054ad4..c676e723de71 100644
--- a/services/core/java/com/android/server/wm/WindowStateAnimator.java
+++ b/services/core/java/com/android/server/wm/WindowStateAnimator.java
@@ -27,18 +27,17 @@ import static android.view.WindowManager.TRANSIT_NONE;
import static com.android.server.policy.WindowManagerPolicy.FINISH_LAYOUT_REDO_ANIM;
import static com.android.server.policy.WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_DRAW;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_ORIENTATION;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_STARTING_WINDOW;
-import static com.android.server.wm.ProtoLogGroup.WM_SHOW_SURFACE_ALLOC;
-import static com.android.server.wm.ProtoLogGroup.WM_SHOW_TRANSACTIONS;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ANIM;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_LAYOUT_REPEATS;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ORIENTATION;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_STARTING_WINDOW;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_STARTING_WINDOW_VERBOSE;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_VISIBILITY;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WINDOW_CROP;
import static com.android.server.wm.WindowManagerDebugConfig.SHOW_LIGHT_TRANSACTIONS;
+import static com.android.server.wm.WindowManagerDebugConfig.SHOW_SURFACE_ALLOC;
+import static com.android.server.wm.WindowManagerDebugConfig.SHOW_TRANSACTIONS;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
import static com.android.server.wm.WindowManagerService.TYPE_LAYER_MULTIPLIER;
@@ -68,7 +67,6 @@ import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import com.android.server.policy.WindowManagerPolicy;
-import com.android.server.protolog.common.ProtoLog;
import java.io.PrintWriter;
@@ -314,19 +312,19 @@ class WindowStateAnimator {
boolean finishDrawingLocked(SurfaceControl.Transaction postDrawTransaction) {
final boolean startingWindow =
mWin.mAttrs.type == WindowManager.LayoutParams.TYPE_APPLICATION_STARTING;
- if (startingWindow) {
- ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Finishing drawing window %s: mDrawState=%s",
- mWin, drawStateToString());
+ if (DEBUG_STARTING_WINDOW && startingWindow) {
+ Slog.v(TAG, "Finishing drawing window " + mWin + ": mDrawState="
+ + drawStateToString());
}
boolean layoutNeeded = false;
if (mDrawState == DRAW_PENDING) {
- ProtoLog.v(WM_DEBUG_DRAW,
- "finishDrawingLocked: mDrawState=COMMIT_DRAW_PENDING %s in %s", mWin,
- mSurfaceController);
- if (startingWindow) {
- ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Draw state now committed in %s", mWin);
+ if (DEBUG_ANIM || SHOW_TRANSACTIONS || DEBUG_ORIENTATION)
+ Slog.v(TAG, "finishDrawingLocked: mDrawState=COMMIT_DRAW_PENDING " + mWin + " in "
+ + mSurfaceController);
+ if (DEBUG_STARTING_WINDOW && startingWindow) {
+ Slog.v(TAG, "Draw state now committed in " + mWin);
}
mDrawState = COMMIT_DRAW_PENDING;
layoutNeeded = true;
@@ -387,7 +385,7 @@ class WindowStateAnimator {
mSurfaceDestroyDeferred = true;
return;
}
- ProtoLog.i(WM_SHOW_TRANSACTIONS, "SURFACE SET FREEZE LAYER: %s", mWin);
+ if (SHOW_TRANSACTIONS) WindowManagerService.logSurface(mWin, "SET FREEZE LAYER", false);
if (mSurfaceController != null) {
// Our SurfaceControl is always at layer 0 within the parent Surface managed by
// window-state. We want this old Surface to stay on top of the new one
@@ -458,9 +456,8 @@ class WindowStateAnimator {
w.setHasSurface(false);
- if (DEBUG_ANIM) {
- Slog.i(TAG, "createSurface " + this + ": mDrawState=DRAW_PENDING");
- }
+ if (DEBUG_ANIM || DEBUG_ORIENTATION) Slog.i(TAG,
+ "createSurface " + this + ": mDrawState=DRAW_PENDING");
resetDrawState();
@@ -517,10 +514,15 @@ class WindowStateAnimator {
w.setHasSurface(true);
- ProtoLog.i(WM_SHOW_SURFACE_ALLOC,
- " CREATE SURFACE %s IN SESSION %s: pid=%d format=%d flags=0x%x / %s",
- mSurfaceController, mSession.mSurfaceSession, mSession.mPid, attrs.format,
- flags, this);
+ if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) {
+ Slog.i(TAG, " CREATE SURFACE "
+ + mSurfaceController + " IN SESSION "
+ + mSession.mSurfaceSession
+ + ": pid=" + mSession.mPid + " format="
+ + attrs.format + " flags=0x"
+ + Integer.toHexString(flags)
+ + " / " + this);
+ }
} catch (OutOfResourcesException e) {
Slog.w(TAG, "OutOfResourcesException creating surface");
mService.mRoot.reclaimSomeSurfaceMemory(this, "create", true);
@@ -614,15 +616,17 @@ class WindowStateAnimator {
if (mSurfaceDestroyDeferred) {
if (mSurfaceController != null && mPendingDestroySurface != mSurfaceController) {
if (mPendingDestroySurface != null) {
- ProtoLog.i(WM_SHOW_SURFACE_ALLOC, "SURFACE DESTROY PENDING: %s. %s",
- mWin, new RuntimeException().fillInStackTrace());
+ if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) {
+ WindowManagerService.logSurface(mWin, "DESTROY PENDING", true);
+ }
mPendingDestroySurface.destroyNotInTransaction();
}
mPendingDestroySurface = mSurfaceController;
}
} else {
- ProtoLog.i(WM_SHOW_SURFACE_ALLOC, "SURFACE DESTROY: %s. %s",
- mWin, new RuntimeException().fillInStackTrace());
+ if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) {
+ WindowManagerService.logSurface(mWin, "DESTROY", true);
+ }
destroySurface();
}
// Don't hide wallpaper if we're deferring the surface destroy
@@ -649,8 +653,9 @@ class WindowStateAnimator {
void destroyDeferredSurfaceLocked() {
try {
if (mPendingDestroySurface != null) {
- ProtoLog.i(WM_SHOW_SURFACE_ALLOC, "SURFACE DESTROY PENDING: %s. %s",
- mWin, new RuntimeException().fillInStackTrace());
+ if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) {
+ WindowManagerService.logSurface(mWin, "DESTROY PENDING", true);
+ }
mPendingDestroySurface.destroyNotInTransaction();
// Don't hide wallpaper if we're destroying a deferred surface
// after a surface mode change.
@@ -1084,7 +1089,9 @@ class WindowStateAnimator {
// There is no need to wait for an animation change if our window is gone for layout
// already as we'll never be visible.
if (w.getOrientationChanging() && w.isGoneForLayoutLw()) {
- ProtoLog.v(WM_DEBUG_ORIENTATION, "Orientation change skips hidden %s", w);
+ if (DEBUG_ORIENTATION) {
+ Slog.v(TAG, "Orientation change skips hidden " + w);
+ }
w.setOrientationChanging(false);
}
return;
@@ -1109,8 +1116,8 @@ class WindowStateAnimator {
// before it has drawn for the new orientation.
if (w.getOrientationChanging() && w.isGoneForLayoutLw()) {
w.setOrientationChanging(false);
- ProtoLog.v(WM_DEBUG_ORIENTATION,
- "Orientation change skips hidden %s", w);
+ if (DEBUG_ORIENTATION) Slog.v(TAG,
+ "Orientation change skips hidden " + w);
}
} else if (mLastAlpha != mShownAlpha
|| mLastDsDx != mDsDx
@@ -1128,10 +1135,13 @@ class WindowStateAnimator {
mLastDtDy = mDtDy;
w.mLastHScale = w.mHScale;
w.mLastVScale = w.mVScale;
- ProtoLog.i(WM_SHOW_TRANSACTIONS,
- "SURFACE controller=%s alpha=%f matrix=[%f*%f,%f*%f][%f*%f,%f*%f]: %s",
- mSurfaceController, mShownAlpha, mDsDx, w.mHScale, mDtDx, w.mVScale,
- mDtDy, w.mHScale, mDsDy, w.mVScale, w);
+ if (SHOW_TRANSACTIONS) WindowManagerService.logSurface(w,
+ "controller=" + mSurfaceController +
+ "alpha=" + mShownAlpha
+ + " matrix=[" + mDsDx + "*" + w.mHScale
+ + "," + mDtDx + "*" + w.mVScale
+ + "][" + mDtDy + "*" + w.mHScale
+ + "," + mDsDy + "*" + w.mVScale + "]", false);
boolean prepared =
mSurfaceController.prepareToShowInTransaction(mShownAlpha,
@@ -1181,11 +1191,11 @@ class WindowStateAnimator {
if (!w.isDrawnLw()) {
mAnimator.mBulkUpdateParams &= ~SET_ORIENTATION_CHANGE_COMPLETE;
mAnimator.mLastWindowFreezeSource = w;
- ProtoLog.v(WM_DEBUG_ORIENTATION,
- "Orientation continue waiting for draw in %s", w);
+ if (DEBUG_ORIENTATION) Slog.v(TAG,
+ "Orientation continue waiting for draw in " + w);
} else {
w.setOrientationChanging(false);
- ProtoLog.v(WM_DEBUG_ORIENTATION, "Orientation change complete in %s", w);
+ if (DEBUG_ORIENTATION) Slog.v(TAG, "Orientation change complete in " + w);
}
}
diff --git a/services/core/java/com/android/server/wm/WindowSurfaceController.java b/services/core/java/com/android/server/wm/WindowSurfaceController.java
index 49f27a1b495d..6d813d106345 100644
--- a/services/core/java/com/android/server/wm/WindowSurfaceController.java
+++ b/services/core/java/com/android/server/wm/WindowSurfaceController.java
@@ -21,10 +21,10 @@ import static android.view.Surface.SCALING_MODE_SCALE_TO_WINDOW;
import static android.view.SurfaceControl.METADATA_OWNER_UID;
import static android.view.SurfaceControl.METADATA_WINDOW_TYPE;
-import static com.android.server.wm.ProtoLogGroup.WM_SHOW_SURFACE_ALLOC;
-import static com.android.server.wm.ProtoLogGroup.WM_SHOW_TRANSACTIONS;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_VISIBILITY;
import static com.android.server.wm.WindowManagerDebugConfig.SHOW_LIGHT_TRANSACTIONS;
+import static com.android.server.wm.WindowManagerDebugConfig.SHOW_SURFACE_ALLOC;
+import static com.android.server.wm.WindowManagerDebugConfig.SHOW_TRANSACTIONS;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
import static com.android.server.wm.WindowSurfaceControllerProto.LAYER;
@@ -40,8 +40,6 @@ import android.view.SurfaceControl;
import android.view.SurfaceSession;
import android.view.WindowContentFrameStats;
-import com.android.server.protolog.common.ProtoLog;
-
import java.io.PrintWriter;
class WindowSurfaceController {
@@ -113,22 +111,31 @@ class WindowSurfaceController {
Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER);
}
+ private void logSurface(String msg, RuntimeException where) {
+ String str = " SURFACE " + msg + ": " + title;
+ if (where != null) {
+ Slog.i(TAG, str, where);
+ } else {
+ Slog.i(TAG, str);
+ }
+ }
+
void reparentChildrenInTransaction(WindowSurfaceController other) {
- ProtoLog.i(WM_SHOW_TRANSACTIONS, "REPARENT from: %s to: %s", this, other);
+ if (SHOW_TRANSACTIONS) Slog.i(TAG, "REPARENT from: " + this + " to: " + other);
if ((mSurfaceControl != null) && (other.mSurfaceControl != null)) {
mSurfaceControl.reparentChildren(other.mSurfaceControl);
}
}
void detachChildren() {
- ProtoLog.i(WM_SHOW_TRANSACTIONS, "SEVER CHILDREN");
+ if (SHOW_TRANSACTIONS) Slog.i(TAG, "SEVER CHILDREN");
if (mSurfaceControl != null) {
mSurfaceControl.detachChildren();
}
}
void hide(SurfaceControl.Transaction transaction, String reason) {
- ProtoLog.i(WM_SHOW_TRANSACTIONS, "SURFACE HIDE ( %s ): %s", reason, title);
+ if (SHOW_TRANSACTIONS) logSurface("HIDE ( " + reason + " )", null);
mHiddenForOtherReasons = true;
mAnimator.destroyPreservedSurfaceLocked();
@@ -150,8 +157,9 @@ class WindowSurfaceController {
}
void destroyNotInTransaction() {
- ProtoLog.i(WM_SHOW_SURFACE_ALLOC,
- "Destroying surface %s called by %s", this, Debug.getCallers(8));
+ if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) {
+ Slog.i(TAG, "Destroying surface " + this + " called by " + Debug.getCallers(8));
+ }
try {
if (mSurfaceControl != null) {
mTmpTransaction.remove(mSurfaceControl).apply();
@@ -165,7 +173,8 @@ class WindowSurfaceController {
}
void setCropInTransaction(Rect clipRect, boolean recoveringMemory) {
- ProtoLog.i(WM_SHOW_TRANSACTIONS, "SURFACE CROP %s: %s", clipRect.toShortString(), title);
+ if (SHOW_TRANSACTIONS) logSurface(
+ "CROP " + clipRect.toShortString(), null);
try {
if (clipRect.width() > 0 && clipRect.height() > 0) {
if (!clipRect.equals(mSurfaceCrop)) {
@@ -189,7 +198,8 @@ class WindowSurfaceController {
}
void clearCropInTransaction(boolean recoveringMemory) {
- ProtoLog.i(WM_SHOW_TRANSACTIONS, "SURFACE CLEAR CROP: %s", title);
+ if (SHOW_TRANSACTIONS) logSurface(
+ "CLEAR CROP", null);
try {
Rect clipRect = new Rect(0, 0, -1, -1);
if (mSurfaceCrop.equals(clipRect)) {
@@ -217,8 +227,8 @@ class WindowSurfaceController {
mSurfaceY = top;
try {
- ProtoLog.i(WM_SHOW_TRANSACTIONS,
- "SURFACE POS (setPositionInTransaction) @ (%f,%f): %s", left, top, title);
+ if (SHOW_TRANSACTIONS) logSurface(
+ "POS (setPositionInTransaction) @ (" + left + "," + top + ")", null);
if (t == null) {
mSurfaceControl.setPosition(left, top);
@@ -254,8 +264,8 @@ class WindowSurfaceController {
mLastDsdy = dsdy;
try {
- ProtoLog.i(WM_SHOW_TRANSACTIONS, "SURFACE MATRIX [%f,%f,%f,%f]: %s",
- dsdx, dtdx, dtdy, dsdy, title);
+ if (SHOW_TRANSACTIONS) logSurface(
+ "MATRIX [" + dsdx + "," + dtdx + "," + dtdy + "," + dsdy + "]", null);
if (t == null) {
mSurfaceControl.setMatrix(dsdx, dtdx, dtdy, dsdy);
} else {
@@ -280,7 +290,8 @@ class WindowSurfaceController {
mSurfaceH = height;
try {
- ProtoLog.i(WM_SHOW_TRANSACTIONS, "SURFACE SIZE %dx%d: %s", width, height, title);
+ if (SHOW_TRANSACTIONS) logSurface(
+ "SIZE " + width + "x" + height, null);
mSurfaceControl.setBufferSize(width, height);
} catch (RuntimeException e) {
// If something goes wrong with the surface (such
@@ -339,7 +350,8 @@ class WindowSurfaceController {
}
void setOpaque(boolean isOpaque) {
- ProtoLog.i(WM_SHOW_TRANSACTIONS, "SURFACE isOpaque=%b: %s", isOpaque, title);
+ if (SHOW_TRANSACTIONS) logSurface("isOpaque=" + isOpaque,
+ null);
if (mSurfaceControl == null) {
return;
@@ -355,7 +367,8 @@ class WindowSurfaceController {
}
void setSecure(boolean isSecure) {
- ProtoLog.i(WM_SHOW_TRANSACTIONS, "SURFACE isSecure=%b: %s", isSecure, title);
+ if (SHOW_TRANSACTIONS) logSurface("isSecure=" + isSecure,
+ null);
if (mSurfaceControl == null) {
return;
@@ -371,7 +384,9 @@ class WindowSurfaceController {
}
void setColorSpaceAgnostic(boolean agnostic) {
- ProtoLog.i(WM_SHOW_TRANSACTIONS, "SURFACE isColorSpaceAgnostic=%b: %s", agnostic, title);
+ if (SHOW_TRANSACTIONS) {
+ logSurface("isColorSpaceAgnostic=" + agnostic, null);
+ }
if (mSurfaceControl == null) {
return;
@@ -395,7 +410,8 @@ class WindowSurfaceController {
}
boolean showRobustlyInTransaction() {
- ProtoLog.i(WM_SHOW_TRANSACTIONS, "SURFACE SHOW (performLayout): %s", title);
+ if (SHOW_TRANSACTIONS) logSurface(
+ "SHOW (performLayout)", null);
if (DEBUG_VISIBILITY) Slog.v(TAG, "Showing " + this
+ " during relayout");
mHiddenForOtherReasons = false;
diff --git a/services/core/java/com/android/server/wm/WindowToken.java b/services/core/java/com/android/server/wm/WindowToken.java
index fbfb0286db1e..8aee0f2a8308 100644
--- a/services/core/java/com/android/server/wm/WindowToken.java
+++ b/services/core/java/com/android/server/wm/WindowToken.java
@@ -19,9 +19,9 @@ package com.android.server.wm;
import static android.view.WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_ADD_REMOVE;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_FOCUS;
-import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_WINDOW_MOVEMENT;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ADD_REMOVE;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_FOCUS;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WINDOW_MOVEMENT;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_NORMAL;
@@ -35,10 +35,9 @@ import static com.android.server.wm.WindowTokenProto.WINDOW_CONTAINER;
import android.annotation.CallSuper;
import android.os.Debug;
import android.os.IBinder;
+import android.util.Slog;
import android.util.proto.ProtoOutputStream;
-import com.android.server.protolog.common.ProtoLog;
-
import java.io.PrintWriter;
import java.util.Comparator;
@@ -136,8 +135,8 @@ class WindowToken extends WindowContainer<WindowState> {
void removeAllWindowsIfPossible() {
for (int i = mChildren.size() - 1; i >= 0; --i) {
final WindowState win = mChildren.get(i);
- ProtoLog.w(WM_DEBUG_WINDOW_MOVEMENT,
- "removeAllWindowsIfPossible: removing win=%s", win);
+ if (DEBUG_WINDOW_MOVEMENT) Slog.w(TAG_WM,
+ "removeAllWindowsIfPossible: removing win=" + win);
win.removeIfPossible();
}
}
@@ -198,15 +197,15 @@ class WindowToken extends WindowContainer<WindowState> {
}
void addWindow(final WindowState win) {
- ProtoLog.d(WM_DEBUG_FOCUS,
- "addWindow: win=%s Callers=%s", win, Debug.getCallers(5));
+ if (DEBUG_FOCUS) Slog.d(TAG_WM,
+ "addWindow: win=" + win + " Callers=" + Debug.getCallers(5));
if (win.isChildWindow()) {
// Child windows are added to their parent windows.
return;
}
if (!mChildren.contains(win)) {
- ProtoLog.v(WM_DEBUG_ADD_REMOVE, "Adding %s to %s", win, this);
+ if (DEBUG_ADD_REMOVE) Slog.v(TAG_WM, "Adding " + win + " to " + this);
addChild(win, mWindowComparator);
mWmService.mWindowsChanged = true;
// TODO: Should we also be setting layout needed here and other places?