diff --git a/data/etc/services.core.protolog.json b/data/etc/services.core.protolog.json index 2dfb777592fdb243da8ace42798732b8f00f2379..a2402e25c55685cde09272bf9b1db56009d2d692 100644 --- a/data/etc/services.core.protolog.json +++ b/data/etc/services.core.protolog.json @@ -1,16 +1,2170 @@ { "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 e488cc91f9bac5f05826c1111ec9795ef9272edb..41d179db825e1339ea24f8f0d74d147ecdc994b6 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,6 +76,7 @@ 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; @@ -1304,8 +1305,8 @@ class ActivityDisplay extends ConfigurationContainer final AppWindowToken newFocus; final IBinder token = r.appToken; if (token == null) { - if (DEBUG_FOCUS_LIGHT) Slog.v(TAG_WM, "Clearing focused app, displayId=" - + mDisplayId); + ProtoLog.v(WM_DEBUG_FOCUS_LIGHT, "Clearing focused app, displayId=%d", + mDisplayId); newFocus = null; } else { newFocus = mService.mWindowManager.mRoot.getAppWindowToken(token); @@ -1313,8 +1314,9 @@ class ActivityDisplay extends ConfigurationContainer Slog.w(TAG_WM, "Attempted to set focus to non-existing app token: " + token + ", displayId=" + mDisplayId); } - if (DEBUG_FOCUS_LIGHT) Slog.v(TAG_WM, "Set focused app to: " + newFocus - + " moveFocusNow=" + moveFocusNow + " displayId=" + mDisplayId); + ProtoLog.v(WM_DEBUG_FOCUS_LIGHT, + "Set focused app to: %s moveFocusNow=%b displayId=%d", newFocus, + moveFocusNow, 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 c54ccd4d68447d1d0f694b5d4a72ef525a042c51..c9e84ec2c69b8271808ba13e489e5979b3b7d11f 100644 --- a/services/core/java/com/android/server/wm/ActivityRecord.java +++ b/services/core/java/com/android/server/wm/ActivityRecord.java @@ -154,12 +154,11 @@ 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; @@ -239,6 +238,7 @@ 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,11 +1183,10 @@ final class ActivityRecord extends ConfigurationContainer { info.applicationInfo.targetSdkVersion, info.screenOrientation, mRotationAnimationHint, mLaunchTaskBehind, isAlwaysFocusable()); - if (DEBUG_TOKEN_MOVEMENT || DEBUG_ADD_REMOVE) { - Slog.v(TAG, "addAppToken: " - + mAppWindowToken + " task=" + container + " at " - + Integer.MAX_VALUE); - } + ProtoLog.v(WM_DEBUG_ADD_REMOVE, "addAppToken: %s" + + " task=%s at %d", mAppWindowToken, container, + Integer.MAX_VALUE); + container.addChild(mAppWindowToken, Integer.MAX_VALUE /* add on top */); } @@ -1204,12 +1203,11 @@ 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) { - if (DEBUG_STARTING_WINDOW) { - Slog.v(TAG, "setAppStartingWindow: token=" + appToken - + " pkg=" + pkg + " transferFrom=" + transferFrom + " newTask=" + newTask - + " taskSwitch=" + taskSwitch + " processRunning=" + processRunning - + " allowTaskSnapshot=" + allowTaskSnapshot); - } + 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 (mAppWindowToken == null) { Slog.w(TAG_WM, "Attempted to set icon of non-existing app token: " + appToken); return false; @@ -3215,7 +3213,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()) { - if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Skipping set freeze of " + appToken); + ProtoLog.v(WM_DEBUG_ORIENTATION, "Skipping set freeze of %s", appToken); return; } @@ -3229,11 +3227,9 @@ final class ActivityRecord extends ConfigurationContainer { if (mAppWindowToken == null) { return; } - if (DEBUG_ORIENTATION) { - Slog.v(TAG_WM, "Clear freezing of " + appToken + ": hidden=" - + mAppWindowToken.isHidden() + " freezing=" - + mAppWindowToken.isFreezingScreen()); - } + ProtoLog.v(WM_DEBUG_ORIENTATION, + "Clear freezing of %s: hidden=%b freezing=%b", appToken, + mAppWindowToken.isHidden(), 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 66d52cc9bf5adb8480fe56611613f1eb9f457c14..93c461f3add90403d712d61cee5aee6ae8662530 100644 --- a/services/core/java/com/android/server/wm/AppTransition.java +++ b/services/core/java/com/android/server/wm/AppTransition.java @@ -70,8 +70,9 @@ 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; @@ -131,6 +132,7 @@ 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; @@ -1630,70 +1632,61 @@ 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); - if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG, - "applyAnimation voice:" - + " anim=" + a + " transit=" + appTransitionToString(transit) - + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3)); + ProtoLog.v(WM_DEBUG_APP_TRANSITIONS_ANIM, + "applyAnimation voice: anim=%s transit=%s isEntrance=%b Callers=%s", a, + appTransitionToString(transit), enter, 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); - if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG, - "applyAnimation voice:" - + " anim=" + a + " transit=" + appTransitionToString(transit) - + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3)); + ProtoLog.v(WM_DEBUG_APP_TRANSITIONS_ANIM, + "applyAnimation voice: anim=%s transit=%s isEntrance=%b Callers=%s", a, + appTransitionToString(transit), enter, Debug.getCallers(3)); } else if (transit == TRANSIT_ACTIVITY_RELAUNCH) { a = createRelaunchAnimation(frame, insets); - if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG, - "applyAnimation:" - + " anim=" + a + " nextAppTransition=" + mNextAppTransition - + " transit=" + appTransitionToString(transit) - + " Callers=" + Debug.getCallers(3)); + ProtoLog.v(WM_DEBUG_APP_TRANSITIONS_ANIM, + "applyAnimation: anim=%s nextAppTransition=%d transit=%s Callers=%s", a, + mNextAppTransition, appTransitionToString(transit), + Debug.getCallers(3)); } else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_CUSTOM) { a = loadAnimationRes(mNextAppTransitionPackage, enter ? mNextAppTransitionEnter : mNextAppTransitionExit); - if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG, - "applyAnimation:" - + " anim=" + a + " nextAppTransition=ANIM_CUSTOM" - + " transit=" + appTransitionToString(transit) + " isEntrance=" + enter - + " Callers=" + Debug.getCallers(3)); + 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)); } else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_CUSTOM_IN_PLACE) { a = loadAnimationRes(mNextAppTransitionPackage, mNextAppTransitionInPlace); - if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG, - "applyAnimation:" - + " anim=" + a + " nextAppTransition=ANIM_CUSTOM_IN_PLACE" - + " transit=" + appTransitionToString(transit) - + " Callers=" + Debug.getCallers(3)); + 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)); } else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_CLIP_REVEAL) { a = createClipRevealAnimationLocked(transit, enter, frame, displayFrame); - if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG, - "applyAnimation:" - + " anim=" + a + " nextAppTransition=ANIM_CLIP_REVEAL" - + " transit=" + appTransitionToString(transit) - + " Callers=" + Debug.getCallers(3)); + ProtoLog.v(WM_DEBUG_APP_TRANSITIONS_ANIM, + "applyAnimation: anim=%s nextAppTransition=ANIM_CLIP_REVEAL " + + "transit=%s Callers=%s", + a, appTransitionToString(transit), Debug.getCallers(3)); } else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_SCALE_UP) { a = createScaleUpAnimationLocked(transit, enter, frame); - 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)); + 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)); } 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); - 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)); - } + 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)); } else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_THUMBNAIL_ASPECT_SCALE_UP || mNextAppTransitionType == NEXT_TRANSIT_TYPE_THUMBNAIL_ASPECT_SCALE_DOWN) { mNextAppTransitionScaleUp = @@ -1701,30 +1694,27 @@ public class AppTransition implements Dump { a = createAspectScaledThumbnailEnterExitAnimationLocked( getThumbnailTransitionState(enter), uiMode, orientation, transit, frame, insets, surfaceInsets, stableInsets, freeform, taskId); - 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)); - } + 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)); } 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); - Slog.v(TAG, - "applyAnimation NEXT_TRANSIT_TYPE_OPEN_CROSS_PROFILE_APPS:" - + " anim=" + a + " transit=" + appTransitionToString(transit) - + " isEntrance=true" + " Callers=" + Debug.getCallers(3)); + 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)); } 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); - if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) { - Slog.v(TAG, "applyAnimation:" - + " anim=" + a + " transit=" + appTransitionToString(transit) - + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3)); - } + ProtoLog.v(WM_DEBUG_APP_TRANSITIONS_ANIM, + "applyAnimation: anim=%s transit=%s isEntrance=%b Callers=%s", + a, appTransitionToString(transit), enter, Debug.getCallers(3)); } else { int animAttr = 0; switch (transit) { @@ -1787,12 +1777,11 @@ public class AppTransition implements Dump { : WindowAnimation_launchTaskBehindTargetAnimation; } a = animAttr != 0 ? loadAnimationAttr(lp, animAttr, transit) : null; - 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)); + 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)); } return a; } @@ -1941,8 +1930,8 @@ public class AppTransition implements Dump { } void overridePendingAppTransitionRemote(RemoteAnimationAdapter remoteAnimationAdapter) { - if (DEBUG_APP_TRANSITIONS) Slog.i(TAG, "Override pending remote transitionSet=" - + isTransitionSet() + " adapter=" + remoteAnimationAdapter); + ProtoLog.i(WM_DEBUG_APP_TRANSITIONS, "Override pending remote transitionSet=%b adapter=%s", + isTransitionSet(), remoteAnimationAdapter); if (isTransitionSet()) { clear(); mNextAppTransitionType = NEXT_TRANSIT_TYPE_REMOTE; @@ -2214,12 +2203,11 @@ public class AppTransition implements Dump { */ boolean prepareAppTransitionLocked(@TransitionType int transit, boolean alwaysKeepCurrent, @TransitionFlags int flags, boolean forceOverride) { - if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "Prepare app transition:" - + " transit=" + appTransitionToString(transit) - + " " + this - + " alwaysKeepCurrent=" + alwaysKeepCurrent - + " displayId=" + mDisplayContent.getDisplayId() - + " Callers=" + Debug.getCallers(5)); + 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)); final boolean allowSetCrashing = !isKeyguardTransit(mNextAppTransition) && transit == TRANSIT_CRASHING_ACTIVITY_CLOSE; if (forceOverride || isKeyguardTransit(transit) || !isTransitionSet() @@ -2305,15 +2293,14 @@ public class AppTransition implements Dump { } if (isTransitionSet() || !dc.mOpeningApps.isEmpty() || !dc.mClosingApps.isEmpty() || !dc.mChangingApps.isEmpty()) { - 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()); - } + 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()); + 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 59f086efbc5b384bbeb7d1ca800b3d17c9389ae2..20a871baada4a60c0d5a08b23d4a880690e62b8f 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.WindowManagerDebugConfig.DEBUG_APP_TRANSITIONS; +import static com.android.server.wm.ProtoLogGroup.WM_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,6 +66,7 @@ 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; @@ -104,7 +105,7 @@ public class AppTransitionController { } Trace.traceBegin(Trace.TRACE_TAG_WINDOW_MANAGER, "AppTransitionReady"); - if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "**** GOOD TO GO"); + ProtoLog.v(WM_DEBUG_APP_TRANSITIONS, "**** GOOD TO GO"); final AppTransition appTransition = mDisplayContent.mAppTransition; int transit = appTransition.getAppTransition(); if (mDisplayContent.mSkipAppTransitionAnimation && !isKeyguardGoingAwayTransit(transit)) { @@ -348,7 +349,7 @@ public class AppTransitionController { final int appsCount = openingApps.size(); for (int i = 0; i < appsCount; i++) { AppWindowToken wtoken = openingApps.valueAt(i); - if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "Now opening app" + wtoken); + ProtoLog.v(WM_DEBUG_APP_TRANSITIONS, "Now opening app %s", 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 @@ -383,7 +384,7 @@ public class AppTransitionController { for (int i = 0; i < appsCount; i++) { AppWindowToken wtoken = closingApps.valueAt(i); - if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "Now closing app " + wtoken); + ProtoLog.v(WM_DEBUG_APP_TRANSITIONS, "Now closing app %s", wtoken); // TODO: Do we need to add to mNoAnimationNotifyOnTransitionFinished like above if not // animating? wtoken.commitVisibility(animLp, false, transit, false, voiceInteraction); @@ -410,7 +411,7 @@ public class AppTransitionController { final int appsCount = apps.size(); for (int i = 0; i < appsCount; i++) { AppWindowToken wtoken = apps.valueAt(i); - if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "Now changing app" + wtoken); + ProtoLog.v(WM_DEBUG_APP_TRANSITIONS, "Now changing app %s", wtoken); wtoken.cancelAnimationOnly(); wtoken.applyAnimationLocked(null, transit, true, false); wtoken.updateReportedVisibilityLocked(); @@ -445,10 +446,9 @@ public class AppTransitionController { } private boolean transitionGoodToGo(ArraySet apps, SparseIntArray outReasons) { - if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, - "Checking " + apps.size() + " opening apps (frozen=" - + mService.mDisplayFrozen + " timeout=" - + mDisplayContent.mAppTransition.isTimeout() + ")..."); + ProtoLog.v(WM_DEBUG_APP_TRANSITIONS, + "Checking %d opening apps (frozen=%b timeout=%b)...", apps.size(), + mService.mDisplayFrozen, mDisplayContent.mAppTransition.isTimeout()); final ScreenRotationAnimation screenRotationAnimation = mService.mRoot.getDisplayContent( Display.DEFAULT_DISPLAY).getRotationAnimation(); @@ -463,20 +463,18 @@ public class AppTransitionController { // app transition. if (screenRotationAnimation != null && screenRotationAnimation.isAnimating() && mDisplayContent.getDisplayRotation().needsUpdate()) { - if (DEBUG_APP_TRANSITIONS) { - Slog.v(TAG, "Delaying app transition for screen rotation animation to finish"); - } + ProtoLog.v(WM_DEBUG_APP_TRANSITIONS, + "Delaying app transition for screen rotation animation to finish"); return false; } for (int i = 0; i < apps.size(); i++) { AppWindowToken wtoken = apps.valueAt(i); - 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); + 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); final boolean allDrawn = wtoken.allDrawn && !wtoken.isRelaunching(); @@ -496,15 +494,13 @@ public class AppTransitionController { // We also need to wait for the specs to be fetched, if needed. if (mDisplayContent.mAppTransition.isFetchingAppTransitionsSpecs()) { - if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "isFetchingAppTransitionSpecs=true"); + ProtoLog.v(WM_DEBUG_APP_TRANSITIONS, "isFetchingAppTransitionSpecs=true"); return false; } if (!mDisplayContent.mUnknownAppVisibilityController.allResolved()) { - if (DEBUG_APP_TRANSITIONS) { - Slog.v(TAG, "unknownApps is not empty: " - + mDisplayContent.mUnknownAppVisibilityController.getDebugMessage()); - } + ProtoLog.v(WM_DEBUG_APP_TRANSITIONS, "unknownApps is not empty: %s", + mDisplayContent.mUnknownAppVisibilityController.getDebugMessage()); return false; } @@ -549,22 +545,20 @@ public class AppTransitionController { true /* ignoreHidden */); boolean openingCanBeWallpaperTarget = canBeWallpaperTarget(openingApps); - if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, - "New wallpaper target=" + wallpaperTarget - + ", oldWallpaper=" + oldWallpaper - + ", openingApps=" + openingApps - + ", closingApps=" + closingApps); + ProtoLog.v(WM_DEBUG_APP_TRANSITIONS, + "New wallpaper target=%s, oldWallpaper=%s, openingApps=%s, closingApps=%s", + wallpaperTarget, oldWallpaper, openingApps, closingApps); if (openingCanBeWallpaperTarget && transit == TRANSIT_KEYGUARD_GOING_AWAY) { transit = TRANSIT_KEYGUARD_GOING_AWAY_ON_WALLPAPER; - if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, - "New transit: " + AppTransition.appTransitionToString(transit)); + ProtoLog.v(WM_DEBUG_APP_TRANSITIONS, + "New transit: %s", 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) { - if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "Wallpaper animation!"); + ProtoLog.v(WM_DEBUG_APP_TRANSITIONS, "Wallpaper animation!"); switch (transit) { case TRANSIT_ACTIVITY_OPEN: case TRANSIT_TASK_OPEN: @@ -577,16 +571,17 @@ public class AppTransitionController { transit = TRANSIT_WALLPAPER_INTRA_CLOSE; break; } - if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, - "New transit: " + AppTransition.appTransitionToString(transit)); + ProtoLog.v(WM_DEBUG_APP_TRANSITIONS, + "New transit: %s", 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; - if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "New transit away from wallpaper: " - + AppTransition.appTransitionToString(transit)); + ProtoLog.v(WM_DEBUG_APP_TRANSITIONS, + "New transit away from wallpaper: %s", + AppTransition.appTransitionToString(transit)); } else if (wallpaperTarget != null && wallpaperTarget.isVisibleLw() && openingApps.contains(wallpaperTarget.mAppToken) && topOpeningApp == wallpaperTarget.mAppToken @@ -594,8 +589,8 @@ public class AppTransitionController { // We are transitioning from an activity without // a wallpaper to now showing the wallpaper transit = TRANSIT_WALLPAPER_OPEN; - if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "New transit into wallpaper: " - + AppTransition.appTransitionToString(transit)); + ProtoLog.v(WM_DEBUG_APP_TRANSITIONS, "New transit into wallpaper: %s", + AppTransition.appTransitionToString(transit)); } } return transit; @@ -722,8 +717,7 @@ public class AppTransitionController { final WindowState win = mDisplayContent.findFocusedWindow(); if (win != null) { final AppWindowToken wtoken = win.mAppToken; - if (DEBUG_APP_TRANSITIONS) - Slog.v(TAG, "Now animating app in place " + wtoken); + ProtoLog.v(WM_DEBUG_APP_TRANSITIONS, "Now animating app in place %s", 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 b52ade415bd471dc8d76dad4620c9120eee44050..2b05024415b95766e65782fe90e547bea69210c2 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.WindowManagerDebugConfig.SHOW_TRANSACTIONS; +import static com.android.server.wm.ProtoLogGroup.WM_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,7 +31,6 @@ 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; @@ -39,6 +38,7 @@ 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,9 +104,7 @@ class AppWindowThumbnail implements Animatable { window != null ? window.mOwnerUid : Binder.getCallingUid()) .build(); - if (SHOW_TRANSACTIONS) { - Slog.i(TAG, " THUMBNAIL " + mSurfaceControl + ": CREATE"); - } + ProtoLog.i(WM_SHOW_TRANSACTIONS, " THUMBNAIL %s: CREATE", mSurfaceControl); // 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 fc350cd900c11e9481a495f6c597445d5a13ba4b..266862820017e791ae209e29eb43b88073ae308a 100644 --- a/services/core/java/com/android/server/wm/AppWindowToken.java +++ b/services/core/java/com/android/server/wm/AppWindowToken.java @@ -62,17 +62,16 @@ 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.WindowManagerDebugConfig.DEBUG_ADD_REMOVE; +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_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; @@ -124,6 +123,7 @@ 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) { - if (DEBUG_STARTING_WINDOW || DEBUG_ANIM) Slog.v(TAG, "Finish starting " - + win.mToken + ": first real window is shown, no animation"); + ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Finish starting %s" + + ": first real window is shown, no animation", win.mToken); // 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,8 +480,9 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree if (mClientHidden == hideClient || (hideClient && mDeferHidingClient)) { return; } - if (DEBUG_APP_TRANSITIONS) Slog.v(TAG_WM, "setClientHidden: " + this - + " clientHidden=" + hideClient + " Callers=" + Debug.getCallers(5)); + ProtoLog.v(WM_DEBUG_APP_TRANSITIONS, + "setClientHidden: %s clientHidden=%b Callers=%s", this, hideClient, + Debug.getCallers(5)); mClientHidden = hideClient; sendAppVisibilityToClients(); } @@ -507,12 +508,10 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree return; } - if (DEBUG_APP_TRANSITIONS || DEBUG_ORIENTATION) { - Slog.v(TAG_WM, "setAppVisibility(" - + appToken + ", visible=" + visible + "): " + appTransition - + " hidden=" + isHidden() + " hiddenRequested=" - + hiddenRequested + " Callers=" + Debug.getCallers(6)); - } + 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)); final DisplayContent displayContent = getDisplayContent(); displayContent.mOpeningApps.remove(this); @@ -573,7 +572,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree requestUpdateWallpaperIfNeeded(); - if (DEBUG_ADD_REMOVE) Slog.v(TAG_WM, "No longer Stopped: " + this); + ProtoLog.v(WM_DEBUG_ADD_REMOVE, "No longer Stopped: %s", this); mAppStopped = false; transferStartingWindowFromHiddenAboveTokenIfNeeded(); @@ -596,10 +595,10 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree if (win != null) { final AppWindowToken focusedToken = win.mAppToken; if (focusedToken != null) { - if (DEBUG_APP_TRANSITIONS) { - Slog.d(TAG_WM, "TRANSIT_TASK_OPEN_BEHIND, " - + " adding " + focusedToken + " to mOpeningApps"); - } + ProtoLog.d(WM_DEBUG_APP_TRANSITIONS, + "TRANSIT_TASK_OPEN_BEHIND, adding %s to mOpeningApps", + focusedToken); + // Force animation to be loaded. displayContent.mOpeningApps.add(focusedToken); } @@ -638,8 +637,9 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree final AccessibilityController accessibilityController = mWmService.mAccessibilityController; boolean changed = false; - if (DEBUG_APP_TRANSITIONS) Slog.v(TAG_WM, - "Changing app " + this + " hidden=" + isHidden() + " performLayout=" + performLayout); + ProtoLog.v(WM_DEBUG_APP_TRANSITIONS, + "Changing app %s hidden=%b performLayout=%b", this, isHidden(), + performLayout); boolean runningAppAnimation = false; @@ -681,10 +681,9 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree forAllWindows(mWmService::makeWindowFreezingScreenIfNeededLocked, true); } - if (DEBUG_APP_TRANSITIONS) { - Slog.v(TAG_WM, "commitVisibility: " + this - + ": hidden=" + isHidden() + " hiddenRequested=" + hiddenRequested); - } + ProtoLog.v(WM_DEBUG_APP_TRANSITIONS, + "commitVisibility: %s: hidden=%b hiddenRequested=%b", this, + isHidden(), hiddenRequested); if (changed) { displayContent.getInputMonitor().setUpdateInputWindowsNeededLw(); @@ -887,7 +886,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree } mRemovingFromDisplay = true; - if (DEBUG_APP_TRANSITIONS) Slog.v(TAG_WM, "Removing app token: " + this); + ProtoLog.v(WM_DEBUG_APP_TRANSITIONS, "Removing app token: %s", this); boolean delayed = commitVisibility(null, false, TRANSIT_UNSET, true, mVoiceInteraction); @@ -903,11 +902,12 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree delayed = true; } - if (DEBUG_APP_TRANSITIONS) Slog.v(TAG_WM, "Removing app " + this + " delayed=" + delayed - + " animation=" + getAnimation() + " animating=" + isSelfAnimating()); + ProtoLog.v(WM_DEBUG_APP_TRANSITIONS, + "Removing app %s delayed=%b animation=%s animating=%b", this, delayed, + getAnimation(), isSelfAnimating()); - if (DEBUG_ADD_REMOVE || DEBUG_TOKEN_MOVEMENT) Slog.v(TAG_WM, "removeAppToken: " - + this + " delayed=" + delayed + " Callers=" + Debug.getCallers(4)); + ProtoLog.v(WM_DEBUG_ADD_REMOVE, "removeAppToken: %s" + + " delayed=%b Callers=%s", this, delayed, Debug.getCallers(4)); if (mStartingData != null) { removeStartingWindow(); @@ -923,8 +923,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 - if (DEBUG_ADD_REMOVE || DEBUG_TOKEN_MOVEMENT) Slog.v(TAG_WM, - "removeAppToken make exiting: " + this); + ProtoLog.v(WM_DEBUG_ADD_REMOVE, + "removeAppToken make exiting: %s", this); if (stack != null) { stack.mExitingAppTokens.add(this); } @@ -944,8 +944,9 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree final DisplayContent dc = getDisplayContent(); if (dc.mFocusedApp == this) { - if (DEBUG_FOCUS_LIGHT) Slog.v(TAG_WM, "Removing focused app token:" + this - + " displayId=" + dc.getDisplayId()); + ProtoLog.v(WM_DEBUG_FOCUS_LIGHT, + "Removing focused app token:%s displayId=%d", this, + dc.getDisplayId()); dc.setFocusedApp(null); mWmService.updateFocusedWindowLocked(UPDATE_FOCUS_NORMAL, true /*updateInputWindows*/); } @@ -1009,8 +1010,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree * up of the surfaces */ void notifyAppResumed(boolean wasStopped) { - if (DEBUG_ADD_REMOVE) Slog.v(TAG, "notifyAppResumed: wasStopped=" + wasStopped - + " " + this); + ProtoLog.v(WM_DEBUG_ADD_REMOVE, "notifyAppResumed: wasStopped=%b %s", + wasStopped, this); mAppStopped = false; // Allow the window to turn the screen on once the app is resumed again. setCurrentLaunchCanTurnScreenOn(true); @@ -1024,7 +1025,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree * keeping alive in case they were still being used. */ void notifyAppStopped() { - if (DEBUG_ADD_REMOVE) Slog.v(TAG, "notifyAppStopped: " + this); + ProtoLog.v(WM_DEBUG_ADD_REMOVE, "notifyAppStopped: %s", this); mAppStopped = true; // Reset the last saved PiP snap fraction on app stop. mDisplayContent.mPinnedStackControllerLocked.resetReentrySnapFraction(mActivityComponent); @@ -1087,12 +1088,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) { - if (DEBUG_STARTING_WINDOW) Slog.v(TAG_WM, "Notify removed startingWindow " + win); + ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Notify removed startingWindow %s", 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. - if (DEBUG_STARTING_WINDOW) Slog.v(TAG_WM, "Nulling last startingData"); + ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Nulling last startingData"); mStartingData = null; if (mHiddenSetFromTransferredStartingWindow) { // We set the hidden state to false for the token from a transferred starting window. @@ -1103,8 +1104,7 @@ 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. - if (DEBUG_STARTING_WINDOW) Slog.v(TAG_WM, "Last window, removing starting window " - + win); + ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Last window, removing starting window %s", win); removeStartingWindow(); } } @@ -1113,8 +1113,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) { - if (DEBUG_WINDOW_MOVEMENT || DEBUG_ADD_REMOVE) Slog.w(TAG, - "removeDeadWindows: " + win); + ProtoLog.w(WM_DEBUG_ADD_REMOVE, + "removeDeadWindows: %s", win); // Set mDestroying, we don't want any animation or delayed removal here. win.mDestroying = true; // Also removes child windows. @@ -1135,8 +1135,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree } void setWillReplaceWindows(boolean animate) { - if (DEBUG_ADD_REMOVE) Slog.d(TAG_WM, - "Marking app token " + this + " with replacing windows."); + ProtoLog.d(WM_DEBUG_ADD_REMOVE, + "Marking app token %s with replacing windows.", this); for (int i = mChildren.size() - 1; i >= 0; i--) { final WindowState w = mChildren.get(i); @@ -1145,8 +1145,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree } void setWillReplaceChildWindows() { - if (DEBUG_ADD_REMOVE) Slog.d(TAG_WM, "Marking app token " + this - + " with replacing child windows."); + ProtoLog.d(WM_DEBUG_ADD_REMOVE, "Marking app token %s" + + " with replacing child windows.", this); for (int i = mChildren.size() - 1; i >= 0; i--) { final WindowState w = mChildren.get(i); w.setWillReplaceChildWindows(); @@ -1154,8 +1154,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree } void clearWillReplaceWindows() { - if (DEBUG_ADD_REMOVE) Slog.d(TAG_WM, - "Resetting app token " + this + " of replacing window marks."); + ProtoLog.d(WM_DEBUG_ADD_REMOVE, + "Resetting app token %s of replacing window marks.", this); for (int i = mChildren.size() - 1; i >= 0; i--) { final WindowState w = mChildren.get(i); @@ -1320,10 +1320,9 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree } void reparent(Task task, int position) { - if (DEBUG_ADD_REMOVE) { - Slog.i(TAG_WM, "reparent: moving app token=" + this - + " to task=" + task.mTaskId + " at " + position); - } + ProtoLog.i(WM_DEBUG_ADD_REMOVE, "reparent: moving app token=%s" + + " to task=%d at %d", this, task.mTaskId, position); + if (task == null) { throw new IllegalArgumentException("reparent: could not find task"); } @@ -1339,8 +1338,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree + " belongs to a different stack than " + task); } - if (DEBUG_ADD_REMOVE) Slog.i(TAG, "reParentWindowToken: removing window token=" + this - + " from task=" + currentTask); + ProtoLog.i(WM_DEBUG_ADD_REMOVE, "reParentWindowToken: removing window token=%s" + + " from task=%s" , this, currentTask); final DisplayContent prevDisplayContent = getDisplayContent(); mReparenting = true; @@ -1460,9 +1459,10 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree } void startFreezingScreen() { - if (DEBUG_ORIENTATION) logWithStack(TAG, "Set freezing of " + appToken + ": hidden=" - + isHidden() + " freezing=" + mFreezingScreen + " hiddenRequested=" - + hiddenRequested); + ProtoLog.i(WM_DEBUG_ORIENTATION, + "Set freezing of %s: hidden=%b freezing=%b hiddenRequested=%b. %s", + appToken, isHidden(), mFreezingScreen, hiddenRequested, + new RuntimeException().fillInStackTrace()); if (!hiddenRequested) { if (!mFreezingScreen) { mFreezingScreen = true; @@ -1486,7 +1486,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree if (!mFreezingScreen) { return; } - if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Clear freezing of " + this + " force=" + force); + ProtoLog.v(WM_DEBUG_ORIENTATION, + "Clear freezing of %s force=%b", this, force); final int count = mChildren.size(); boolean unfrozeWindows = false; for (int i = 0; i < count; i++) { @@ -1494,7 +1495,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree unfrozeWindows |= w.onStopFreezingScreen(); } if (force || unfrozeWindows) { - if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "No longer freezing: " + this); + ProtoLog.v(WM_DEBUG_ORIENTATION, "No longer freezing: %s", this); mFreezingScreen = false; mWmService.unregisterAppFreezeListener(this); mWmService.mAppsFreezingScreen--; @@ -1545,8 +1546,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree // letting windows get shown immediately without any more transitions. getDisplayContent().mSkipAppTransitionAnimation = true; - if (DEBUG_STARTING_WINDOW) Slog.v(TAG_WM, "Moving existing starting " + tStartingWindow - + " from " + fromToken + " to " + this); + ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Moving existing starting %s" + + " from %s to %s", tStartingWindow, fromToken, this); final long origId = Binder.clearCallingIdentity(); try { @@ -1564,8 +1565,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree tStartingWindow.mToken = this; tStartingWindow.mAppToken = this; - if (DEBUG_ADD_REMOVE || DEBUG_STARTING_WINDOW) Slog.v(TAG_WM, - "Removing starting " + tStartingWindow + " from " + fromToken); + ProtoLog.v(WM_DEBUG_ADD_REMOVE, + "Removing starting %s from %s", tStartingWindow, fromToken); fromToken.removeChild(tStartingWindow); fromToken.postWindowRemoveStartingWindowCleanup(tStartingWindow); fromToken.mHiddenSetFromTransferredStartingWindow = false; @@ -1606,8 +1607,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! - if (DEBUG_STARTING_WINDOW) Slog.v(TAG_WM, - "Moving pending starting from " + fromToken + " to " + this); + ProtoLog.v(WM_DEBUG_STARTING_WINDOW, + "Moving pending starting from %s to %s", fromToken, this); mStartingData = fromToken.mStartingData; fromToken.mStartingData = null; fromToken.startingMoved = true; @@ -1879,9 +1880,10 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree if (mFreezingScreen) { showAllWindowsLocked(); stopFreezingScreen(false, true); - if (DEBUG_ORIENTATION) Slog.i(TAG, - "Setting mOrientationChangeComplete=true because wtoken " + this - + " numInteresting=" + mNumInterestingWindows + " numDrawn=" + mNumDrawnWindows); + ProtoLog.i(WM_DEBUG_ORIENTATION, + "Setting mOrientationChangeComplete=true because wtoken %s " + + "numInteresting=%d numDrawn=%d", + this, mNumInterestingWindows, mNumDrawnWindows); // This will set mOrientationChangeComplete and cause a pass through layout. setAppLayoutChanges(FINISH_LAYOUT_REDO_WALLPAPER, "checkAppWindowsReadyToShow: freezingScreen"); @@ -1985,7 +1987,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree boolean isInterestingAndDrawn = false; if (!allDrawn && w.mightAffectAllDrawn()) { - if (DEBUG_VISIBILITY || DEBUG_ORIENTATION) { + if (DEBUG_VISIBILITY || WM_DEBUG_ORIENTATION.isLogToLogcat()) { Slog.v(TAG, "Eval win " + w + ": isDrawn=" + w.isDrawnLw() + ", isAnimationSet=" + isSelfAnimating()); if (!w.isDrawnLw()) { @@ -2006,10 +2008,12 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree if (w.isDrawnLw()) { mNumDrawnWindows++; - if (DEBUG_VISIBILITY || DEBUG_ORIENTATION) Slog.v(TAG, "tokenMayBeDrawn: " - + this + " w=" + w + " numInteresting=" + mNumInterestingWindows - + " freezingScreen=" + mFreezingScreen - + " mAppFreezing=" + w.mAppFreezing); + if (DEBUG_VISIBILITY || WM_DEBUG_ORIENTATION.isLogToLogcat()) { + Slog.v(TAG, "tokenMayBeDrawn: " + + this + " w=" + w + " numInteresting=" + mNumInterestingWindows + + " freezingScreen=" + mFreezingScreen + + " mAppFreezing=" + w.mAppFreezing); + } isInterestingAndDrawn = true; } @@ -2125,9 +2129,7 @@ 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. - if (DEBUG_STARTING_WINDOW) { - Slog.v(TAG, "Checking theme of starting window: 0x" + Integer.toHexString(theme)); - } + ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Checking theme of starting window: 0x%x", theme); if (theme != 0) { AttributeCache.Entry ent = AttributeCache.instance().get(pkg, theme, com.android.internal.R.styleable.Window, @@ -2145,11 +2147,8 @@ 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); - if (DEBUG_STARTING_WINDOW) { - Slog.v(TAG, "Translucent=" + windowIsTranslucent - + " Floating=" + windowIsFloating - + " ShowWallpaper=" + windowShowWallpaper); - } + ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Translucent=%s Floating=%s ShowWallpaper=%s", + windowIsTranslucent, windowIsFloating, windowShowWallpaper); if (windowIsTranslucent) { return false; } @@ -2181,7 +2180,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree return false; } - if (DEBUG_STARTING_WINDOW) Slog.v(TAG_WM, "Creating SplashScreenStartingData"); + ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Creating SplashScreenStartingData"); mStartingData = new SplashScreenStartingData(mWmService, pkg, theme, compatInfo, nonLocalizedLabel, labelRes, icon, logo, windowFlags, getMergedOverrideConfiguration()); @@ -2195,7 +2194,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree return false; } - if (DEBUG_STARTING_WINDOW) Slog.v(TAG_WM, "Creating SnapshotStartingData"); + ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Creating SnapshotStartingData"); mStartingData = new SnapshotStartingData(mWmService, snapshot); scheduleAddStartingWindow(); return true; @@ -2206,7 +2205,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree // want to process the message ASAP, before any other queued // messages. if (!mWmService.mAnimationHandler.hasCallbacks(mAddStartingWindow)) { - if (DEBUG_STARTING_WINDOW) Slog.v(TAG, "Enqueueing ADD_STARTING"); + ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Enqueueing ADD_STARTING"); mWmService.mAnimationHandler.postAtFrontOfQueue(mAddStartingWindow); } } @@ -2223,18 +2222,17 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree if (mStartingData == null) { // Animation has been canceled... do nothing. - if (DEBUG_STARTING_WINDOW) { - Slog.v(TAG, "startingData was nulled out before handling" - + " mAddStartingWindow: " + AppWindowToken.this); - } + ProtoLog.v(WM_DEBUG_STARTING_WINDOW, + "startingData was nulled out before handling" + + " mAddStartingWindow: %s", AppWindowToken.this); return; } startingData = mStartingData; } - if (DEBUG_STARTING_WINDOW) { - Slog.v(TAG, "Add starting " + this + ": startingData=" + startingData); - } + ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Add starting %s: startingData=%s", + this, startingData); + WindowManagerPolicy.StartingSurface surface = null; try { @@ -2248,27 +2246,28 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree // If the window was successfully added, then // we need to remove it. if (removed || mStartingData == null) { - if (DEBUG_STARTING_WINDOW) { - Slog.v(TAG, "Aborted starting " + AppWindowToken.this - + ": removed=" + removed + " startingData=" + mStartingData); - } + ProtoLog.v(WM_DEBUG_STARTING_WINDOW, + "Aborted starting %s: removed=%b startingData=%s", + AppWindowToken.this, removed, mStartingData); + startingWindow = null; mStartingData = null; abort = true; } else { startingSurface = surface; } - if (DEBUG_STARTING_WINDOW && !abort) { - Slog.v(TAG, - "Added starting " + AppWindowToken.this + ": startingWindow=" - + startingWindow + " startingView=" + startingSurface); + if (!abort) { + ProtoLog.v(WM_DEBUG_STARTING_WINDOW, + "Added starting %s: startingWindow=%s startingView=%s", + AppWindowToken.this, startingWindow, startingSurface); } } if (abort) { surface.remove(); } - } else if (DEBUG_STARTING_WINDOW) { - Slog.v(TAG, "Surface returned was null: " + AppWindowToken.this); + } else { + ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Surface returned was null: %s", + AppWindowToken.this); } } }; @@ -2311,9 +2310,7 @@ 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. - if (DEBUG_STARTING_WINDOW) { - Slog.v(TAG_WM, "Clearing startingData for token=" + this); - } + ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Clearing startingData for token=%s", this); mStartingData = null; } return; @@ -2327,31 +2324,28 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree startingWindow = null; startingDisplayed = false; if (surface == null) { - if (DEBUG_STARTING_WINDOW) { - Slog.v(TAG_WM, "startingWindow was set but startingSurface==null, couldn't " + ProtoLog.v(WM_DEBUG_STARTING_WINDOW, + "startingWindow was set but startingSurface==null, couldn't " + "remove"); - } + return; } } else { - if (DEBUG_STARTING_WINDOW) { - Slog.v(TAG_WM, "Tried to remove starting window but startingWindow was null:" - + this); - } + ProtoLog.v(WM_DEBUG_STARTING_WINDOW, + "Tried to remove starting window but startingWindow was null: %s", + this); return; } - if (DEBUG_STARTING_WINDOW) { - Slog.v(TAG_WM, "Schedule remove starting " + this - + " startingWindow=" + startingWindow - + " startingView=" + startingSurface - + " Callers=" + Debug.getCallers(5)); - } + ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Schedule remove starting %s startingWindow=%s" + + " startingView=%s Callers=%s", + this, startingWindow, startingSurface, 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(() -> { - if (DEBUG_STARTING_WINDOW) Slog.v(TAG_WM, "Removing startingView=" + surface); + ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Removing startingView=%s", surface); try { surface.remove(); } catch (Exception e) { @@ -2547,7 +2541,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree * Creates a layer to apply crop to an animation. */ private SurfaceControl createAnimationBoundsLayer(Transaction t) { - if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.i(TAG, "Creating animation bounds layer"); + ProtoLog.i(WM_DEBUG_APP_TRANSITIONS_ANIM, "Creating animation bounds layer"); final SurfaceControl.Builder builder = makeAnimationLeash() .setParent(getAnimationLeashParent()) .setName(getSurfaceControl() + " - animation-bounds"); @@ -2583,10 +2577,9 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree boolean isVoiceInteraction) { if (mWmService.mDisableTransitionAnimation || !shouldAnimate(transit)) { - if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) { - Slog.v(TAG_WM, "applyAnimation: transition animation is disabled or skipped." - + " atoken=" + this); - } + ProtoLog.v(WM_DEBUG_APP_TRANSITIONS_ANIM, + "applyAnimation: transition animation is disabled or skipped. " + + "atoken=%s", this); cancelAnimation(); return false; } @@ -2686,8 +2679,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree final DisplayInfo displayInfo = displayContent.getDisplayInfo(); final int width = displayInfo.appWidth; final int height = displayInfo.appHeight; - if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG_WM, - "applyAnimation: atoken=" + this); + ProtoLog.v(WM_DEBUG_APP_TRANSITIONS_ANIM, + "applyAnimation: atoken=%s", this); // Determine the visible rect to calculate the thumbnail clip final WindowState win = findMainWindow(); @@ -2727,9 +2720,10 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree // screen gets the enter animation. Both appear in the mOpeningApps set. enter = false; } - 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); + 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); final Configuration displayConfig = displayContent.getConfiguration(); final Animation a = getDisplayContent().mAppTransition.loadAnimation(lp, transit, enter, displayConfig.uiMode, displayConfig.orientation, frame, displayFrame, insets, @@ -2985,7 +2979,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree final GraphicBuffer thumbnailHeader = getDisplayContent().mAppTransition.getAppTransitionThumbnailHeader(taskId); if (thumbnailHeader == null) { - if (DEBUG_APP_TRANSITIONS) Slog.d(TAG, "No thumbnail header bitmap for: " + taskId); + ProtoLog.d(WM_DEBUG_APP_TRANSITIONS, "No thumbnail header bitmap for: %d", 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 a25aab2d69a877e226ee8e66817cb298e2fc0fc9..b4cecff728fd13442a6081962d532ed45bb68722 100644 --- a/services/core/java/com/android/server/wm/BlackFrame.java +++ b/services/core/java/com/android/server/wm/BlackFrame.java @@ -16,15 +16,14 @@ package com.android.server.wm; -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 static com.android.server.wm.ProtoLogGroup.WM_SHOW_SURFACE_ALLOC; import android.graphics.Rect; -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; @@ -58,8 +57,8 @@ public class BlackFrame { transaction.setLayer(surface, layer); transaction.setPosition(surface, left, top); transaction.show(surface); - if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) Slog.i(TAG_WM, - " BLACK " + surface + ": CREATE layer=" + layer); + ProtoLog.i(WM_SHOW_SURFACE_ALLOC, + " BLACK %s: CREATE layer=%d", surface, layer); } } @@ -124,10 +123,7 @@ public class BlackFrame { SurfaceControl.Transaction t = mTransactionFactory.get(); for (int i = 0; i < mBlackSurfaces.length; i++) { if (mBlackSurfaces[i] != null) { - if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) { - Slog.i(TAG_WM, - " BLACK " + mBlackSurfaces[i].surface + ": DESTROY"); - } + ProtoLog.i(WM_SHOW_SURFACE_ALLOC, " BLACK %s: DESTROY", mBlackSurfaces[i].surface); 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 755180eb8d37c75d906503f4160d5faf7df1c0cc..cad2d07d89d94b2c8e819dca434180cbcb8b88dd 100644 --- a/services/core/java/com/android/server/wm/DisplayContent.java +++ b/services/core/java/com/android/server/wm/DisplayContent.java @@ -100,24 +100,21 @@ 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.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.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_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; @@ -133,7 +130,6 @@ 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; @@ -202,6 +198,7 @@ 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; @@ -599,8 +596,8 @@ class DisplayContent extends WindowContainer mFindFocusedWindow = w -> { final AppWindowToken focusedApp = mFocusedApp; - if (DEBUG_FOCUS) Slog.v(TAG_WM, "Looking for focus: " + w - + ", flags=" + w.mAttrs.flags + ", canReceive=" + w.canReceiveKeys()); + ProtoLog.v(WM_DEBUG_FOCUS, "Looking for focus: %s, flags=%d, canReceive=%b", + w, w.mAttrs.flags, w.canReceiveKeys()); if (!w.canReceiveKeys()) { return false; @@ -610,22 +607,22 @@ class DisplayContent extends WindowContainer 0) { // App stack below focused app stack. No focus for you!!! - if (DEBUG_FOCUS_LIGHT) Slog.v(TAG_WM, - "findFocusedWindow: Reached focused app=" + focusedApp); + ProtoLog.v(WM_DEBUG_FOCUS_LIGHT, + "findFocusedWindow: Reached focused app=%s", focusedApp); mTmpWindow = null; return true; } } - if (DEBUG_FOCUS_LIGHT) Slog.v(TAG_WM, "findFocusedWindow: Found new focus @ " + w); + ProtoLog.v(WM_DEBUG_FOCUS_LIGHT, "findFocusedWindow: Found new focus @ %s", w); mTmpWindow = w; return true; }; @@ -1333,7 +1330,7 @@ class DisplayContent extends WindowContainer { if (w.mHasSurface && !rotateSeamlessly) { - if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Set mOrientationChanging of " + w); + ProtoLog.v(WM_DEBUG_ORIENTATION, "Set mOrientationChanging of %s", w); w.setOrientationChanging(true); mWmService.mRoot.mOrientationChangeComplete = false; w.mLastFreezeDuration = 0; @@ -1997,8 +1994,9 @@ class DisplayContent extends WindowContainer 0) { // Rotation updates have been paused temporarily. Defer the update until updates // have been resumed. - if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Deferring rotation, rotation is paused."); + ProtoLog.v(WM_DEBUG_ORIENTATION, "Deferring rotation, rotation is paused."); return false; } @@ -409,14 +410,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. - if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Deferring rotation, animation in progress."); + ProtoLog.v(WM_DEBUG_ORIENTATION, "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. - if (DEBUG_ORIENTATION) Slog.v(TAG_WM, + ProtoLog.v(WM_DEBUG_ORIENTATION, "Deferring rotation, still finishing previous rotation"); return false; } @@ -424,30 +425,30 @@ public class DisplayRotation { if (!mService.mDisplayEnabled) { // No point choosing a rotation if the display is not enabled. - if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Deferring rotation, display is not enabled."); + ProtoLog.v(WM_DEBUG_ORIENTATION, "Deferring rotation, display is not enabled."); return false; } final int oldRotation = mRotation; final int lastOrientation = mLastOrientation; final int rotation = rotationForOrientation(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, + "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, "Display id=" + displayId - + " selected orientation " + lastOrientation - + ", got rotation " + rotation); + ProtoLog.v(WM_DEBUG_ORIENTATION, + "Display id=%d selected orientation %d, got rotation %d", displayId, + lastOrientation, rotation); if (oldRotation == rotation) { // No change. return false; } - if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Display id=" + displayId - + " rotation changed to " + rotation - + " from " + oldRotation - + ", lastOrientation=" + lastOrientation); + ProtoLog.v(WM_DEBUG_ORIENTATION, + "Display id=%d rotation changed to %d from %d, lastOrientation=%d", + displayId, rotation, oldRotation, lastOrientation); if (DisplayContent.deltaRotation(rotation, oldRotation) != 2) { mDisplayContent.mWaitingForConfig = true; @@ -551,9 +552,8 @@ public class DisplayRotation { mSeamlessRotationCount--; } if (mSeamlessRotationCount == 0) { - if (DEBUG_ORIENTATION) { - Slog.i(TAG, "Performing post-rotate rotation after seamless rotation"); - } + ProtoLog.i(WM_DEBUG_ORIENTATION, + "Performing post-rotate rotation after seamless rotation"); // Finish seamless rotation. mRotatingSeamlessly = false; @@ -844,11 +844,12 @@ public class DisplayRotation { // Could have been invoked due to screen turning on or off or // change of the currently visible window's orientation. - if (DEBUG_ORIENTATION) Slog.v(TAG, "screenOnEarly=" + screenOnEarly - + ", awake=" + awake + ", currentAppOrientation=" + mCurrentAppOrientation - + ", orientationSensorEnabled=" + mOrientationListener.mEnabled - + ", keyguardDrawComplete=" + keyguardDrawComplete - + ", windowManagerDrawComplete=" + windowManagerDrawComplete); + ProtoLog.v(WM_DEBUG_ORIENTATION, + "screenOnEarly=%b, awake=%b, currentAppOrientation=%d, " + + "orientationSensorEnabled=%b, keyguardDrawComplete=%b, " + + "windowManagerDrawComplete=%b", + screenOnEarly, awake, mCurrentAppOrientation, mOrientationListener.mEnabled, + keyguardDrawComplete, windowManagerDrawComplete); boolean disable = true; // Note: We postpone the rotating of the screen until the keyguard as well as the @@ -952,14 +953,11 @@ public class DisplayRotation { */ @VisibleForTesting int rotationForOrientation(int orientation, int lastRotation) { - if (DEBUG_ORIENTATION) { - Slog.v(TAG, "rotationForOrientation(orient=" - + orientation + ", last=" + lastRotation - + "); user=" + mUserRotation + " " - + (mUserRotationMode == WindowManagerPolicy.USER_ROTATION_LOCKED - ? "USER_ROTATION_LOCKED" : "") + 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 (isFixedToUserRotation()) { return mUserRotation; @@ -1372,7 +1370,7 @@ public class DisplayRotation { @Override public void onProposedRotationChanged(int rotation) { - if (DEBUG_ORIENTATION) Slog.v(TAG, "onProposedRotationChanged, rotation=" + rotation); + ProtoLog.v(WM_DEBUG_ORIENTATION, "onProposedRotationChanged, rotation=%d", rotation); Runnable r = mRunnableCache.get(rotation, null); if (r == null) { r = new UpdateRunnable(rotation); @@ -1385,14 +1383,14 @@ public class DisplayRotation { public void enable(boolean clearCurrentRotation) { super.enable(clearCurrentRotation); mEnabled = true; - if (DEBUG_ORIENTATION) Slog.v(TAG, "Enabling listeners"); + ProtoLog.v(WM_DEBUG_ORIENTATION, "Enabling listeners"); } @Override public void disable() { super.disable(); mEnabled = false; - if (DEBUG_ORIENTATION) Slog.v(TAG, "Disabling listeners"); + ProtoLog.v(WM_DEBUG_ORIENTATION, "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 3c616945f7629e14553c3ce7b5ccbe7ce99aca64..34820acfecccac75e2e64d0c52f297ea144edc54 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,6 +58,7 @@ 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; @@ -300,9 +301,7 @@ class DragState { mDragWindowHandle.frameBottom = mDisplaySize.y; // Pause rotations before a drag. - if (DEBUG_ORIENTATION) { - Slog.d(TAG_WM, "Pausing rotation during drag"); - } + ProtoLog.d(WM_DEBUG_ORIENTATION, "Pausing rotation during drag"); mDisplayContent.getDisplayRotation().pause(); } @@ -319,9 +318,7 @@ class DragState { mDragApplicationHandle = null; // Resume rotations after a drag. - if (DEBUG_ORIENTATION) { - Slog.d(TAG_WM, "Resuming rotation after drag"); - } + ProtoLog.d(WM_DEBUG_ORIENTATION, "Resuming rotation after drag"); mDisplayContent.getDisplayRotation().resume(); } } @@ -499,10 +496,9 @@ class DragState { Slog.i(TAG_WM, ">>> OPEN TRANSACTION notifyMoveLocked"); } mTransaction.setPosition(mSurfaceControl, x - mThumbOffsetX, y - mThumbOffsetY).apply(); - if (SHOW_TRANSACTIONS) { - Slog.i(TAG_WM, " DRAG " + mSurfaceControl + ": pos=(" + (int) (x - mThumbOffsetX) + "," - + (int) (y - mThumbOffsetY) + ")"); - } + ProtoLog.i(WM_SHOW_TRANSACTIONS, "DRAG %s: pos=(%d,%d)", mSurfaceControl, + (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 8e0531ce3652d6736038de2a5d243e64c4c70085..932b4fac4592f6f51e6cef54a9d6f67f983d6b8b 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.WindowManagerDebugConfig.DEBUG_FOCUS_LIGHT; +import static com.android.server.wm.ProtoLogGroup.WM_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,6 +49,7 @@ 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; @@ -331,9 +332,7 @@ final class InputMonitor { * Layer assignment is assumed to be complete by the time this is called. */ public void setInputFocusLw(WindowState newWindow, boolean updateInputWindows) { - if (DEBUG_FOCUS_LIGHT || DEBUG_INPUT) { - Slog.d(TAG_WM, "Input focus has changed to " + newWindow); - } + ProtoLog.d(WM_DEBUG_FOCUS_LIGHT, "Input focus has changed to %s", 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 313ccebc778de12cd3abbc18a8c2efcf022706f2..2e0ef14e430300a82899363d6ce6d34a3b10e211 100644 --- a/services/core/java/com/android/server/wm/ProtoLogGroup.java +++ b/services/core/java/com/android/server/wm/ProtoLogGroup.java @@ -27,8 +27,38 @@ import com.android.server.protolog.common.ProtoLog; * must be included in services.core.wm.protologgroups build target. */ public enum ProtoLogGroup implements IProtoLogGroup { - GENERIC_WM(true, true, false, "WindowManager"), - + 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), TEST_GROUP(true, true, false, "WindowManagetProtoLogTest"); private final boolean mEnabled; @@ -95,4 +125,11 @@ 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 5cabbd97b1f7f37ba175a955ea8abff418c54e0f..31f4584cded9ee44fdbbea0ee0a04a462b3404a3 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,6 +42,7 @@ 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; /** @@ -51,7 +52,6 @@ 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,7 +101,8 @@ class RecentsAnimation implements RecentsAnimationCallbacks, * is updated to the current one. */ void preloadRecentsActivity() { - if (DEBUG) Slog.d(TAG, "Preload recents with " + mTargetIntent); + ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, "Preload recents with %s", + mTargetIntent); ActivityStack targetStack = mDefaultDisplay.getStack(WINDOWING_MODE_UNDEFINED, mTargetActivityType); ActivityRecord targetActivity = getTargetActivity(targetStack); @@ -116,7 +117,8 @@ class RecentsAnimation implements RecentsAnimationCallbacks, // keeps the original stopped state. targetActivity.ensureActivityConfiguration(0 /* globalChanges */, false /* preserveWindow */, true /* ignoreVisibility */); - if (DEBUG) Slog.d(TAG, "Updated config=" + targetActivity.getConfiguration()); + ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, "Updated config=%s", + targetActivity.getConfiguration()); } } else { // Create the activity record. Because the activity is invisible, this doesn't really @@ -131,7 +133,7 @@ class RecentsAnimation implements RecentsAnimationCallbacks, } if (!targetActivity.attachedToProcess()) { - if (DEBUG) Slog.d(TAG, "Real start recents"); + ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, "Real start recents"); mStackSupervisor.startSpecificActivityLocked(targetActivity, false /* andResume */, false /* checkConfig */); // Make sure the activity won't be involved in transition. @@ -155,7 +157,7 @@ class RecentsAnimation implements RecentsAnimationCallbacks, } void startRecentsActivity(IRecentsAnimationRunner recentsAnimationRunner) { - if (DEBUG) Slog.d(TAG, "startRecentsActivity(): intent=" + mTargetIntent); + ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, "startRecentsActivity(): intent=%s", mTargetIntent); Trace.traceBegin(TRACE_TAG_ACTIVITY_MANAGER, "RecentsAnimation#startRecentsActivity"); // TODO(multi-display) currently only support recents animation in default display. @@ -163,8 +165,9 @@ class RecentsAnimation implements RecentsAnimationCallbacks, mService.mRootActivityContainer.getDefaultDisplay().mDisplayContent; if (!mWindowManager.canStartRecentsAnimation()) { notifyAnimationCancelBeforeStart(recentsAnimationRunner); - if (DEBUG) Slog.d(TAG, "Can't start recents animation, nextAppTransition=" - + dc.mAppTransition.getAppTransition()); + ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, + "Can't start recents animation, nextAppTransition=%s", + dc.mAppTransition.getAppTransition()); return; } @@ -178,7 +181,8 @@ class RecentsAnimation implements RecentsAnimationCallbacks, mRestoreTargetBehindStack = display.getStackAbove(targetStack); if (mRestoreTargetBehindStack == null) { notifyAnimationCancelBeforeStart(recentsAnimationRunner); - if (DEBUG) Slog.d(TAG, "No stack above target stack=" + targetStack); + ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, + "No stack above target stack=%s", targetStack); return; } } @@ -201,8 +205,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); - if (DEBUG) Slog.d(TAG, "Moved stack=" + targetStack + " behind stack=" - + mDefaultDisplay.getStackAbove(targetStack)); + ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, "Moved stack=%s behind stack=%s", + targetStack, 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 @@ -220,17 +224,15 @@ class RecentsAnimation implements RecentsAnimationCallbacks, mTargetActivityType); targetActivity = getTargetActivity(targetStack); mDefaultDisplay.moveStackBehindBottomMostVisibleStack(targetStack); - if (DEBUG) { - Slog.d(TAG, "Moved stack=" + targetStack + " behind stack=" - + mDefaultDisplay.getStackAbove(targetStack)); - } + ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, "Moved stack=%s behind stack=%s", + targetStack, mDefaultDisplay.getStackAbove(targetStack)); mWindowManager.prepareAppTransition(TRANSIT_NONE, false); mWindowManager.executeAppTransition(); // TODO: Maybe wait for app to draw in this particular case? - if (DEBUG) Slog.d(TAG, "Started intent=" + mTargetIntent); + ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, "Started intent=%s", mTargetIntent); } // Mark the target activity as launch-behind to bump its visibility for the @@ -268,9 +270,9 @@ class RecentsAnimation implements RecentsAnimationCallbacks, private void finishAnimation(@RecentsAnimationController.ReorderMode int reorderMode, boolean sendUserLeaveHint) { synchronized (mService.mGlobalLock) { - if (DEBUG) Slog.d(TAG, "onAnimationFinished(): controller=" - + mWindowManager.getRecentsAnimationController() - + " reorderMode=" + reorderMode); + ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, + "onAnimationFinished(): controller=%s reorderMode=%d", + mWindowManager.getRecentsAnimationController(), reorderMode); // Unregister for stack order changes mDefaultDisplay.unregisterStackOrderChangedListener(this); @@ -308,9 +310,10 @@ class RecentsAnimation implements RecentsAnimationCallbacks, final ActivityRecord targetActivity = targetStack != null ? targetStack.isInStackLocked(mLaunchedTargetActivity) : null; - if (DEBUG) Slog.d(TAG, "onAnimationFinished(): targetStack=" + targetStack - + " targetActivity=" + targetActivity - + " mRestoreTargetBehindStack=" + mRestoreTargetBehindStack); + ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, + "onAnimationFinished(): targetStack=%s targetActivity=%s " + + "mRestoreTargetBehindStack=%s", + targetStack, targetActivity, mRestoreTargetBehindStack); if (targetActivity == null) { return; } @@ -333,25 +336,28 @@ class RecentsAnimation implements RecentsAnimationCallbacks, targetStack.moveToFront("RecentsAnimation.onAnimationFinished()"); } - if (DEBUG) { + if (WM_DEBUG_RECENTS_ANIMATIONS.isLogToAny()) { final ActivityStack topStack = getTopNonAlwaysOnTopStack(); if (topStack != targetStack) { - Slog.w(TAG, "Expected target stack=" + targetStack - + " to be top most but found stack=" + topStack); + ProtoLog.w(WM_DEBUG_RECENTS_ANIMATIONS, + "Expected target stack=%s" + + " to be top most but found stack=%s", + targetStack, 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 (DEBUG) { + if (WM_DEBUG_RECENTS_ANIMATIONS.isLogToAny()) { final ActivityStack aboveTargetStack = mDefaultDisplay.getStackAbove(targetStack); if (mRestoreTargetBehindStack != null && aboveTargetStack != mRestoreTargetBehindStack) { - Slog.w(TAG, "Expected target stack=" + targetStack - + " to restored behind stack=" + mRestoreTargetBehindStack - + " but it is behind stack=" + aboveTargetStack); + ProtoLog.w(WM_DEBUG_RECENTS_ANIMATIONS, + "Expected target stack=%s to restored behind stack=%s but" + + " it is behind stack=%s", + targetStack, mRestoreTargetBehindStack, aboveTargetStack); } } } else { @@ -402,7 +408,7 @@ class RecentsAnimation implements RecentsAnimationCallbacks, @Override public void onStackOrderChanged(ActivityStack stack) { - if (DEBUG) Slog.d(TAG, "onStackOrderChanged(): stack=" + stack); + ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, "onStackOrderChanged(): stack=%s", 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 795a2ca67ac3f184fc7184b3bb17265f449fc6c5..bd27905e1a0fab4fbbfa0eb6543caeaf32cde465 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,6 +57,7 @@ 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; @@ -65,6 +66,7 @@ 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 @@ -178,8 +180,8 @@ public class RecentsAnimationController implements DeathRecipient { @Override public TaskSnapshot screenshotTask(int taskId) { - if (DEBUG_RECENTS_ANIMATIONS) Slog.d(TAG, "screenshotTask(" + taskId + "):" - + " mCanceled=" + mCanceled); + ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, + "screenshotTask(%d): mCanceled=%b", taskId, mCanceled); final long token = Binder.clearCallingIdentity(); try { synchronized (mService.getWindowManagerLock()) { @@ -208,8 +210,8 @@ public class RecentsAnimationController implements DeathRecipient { @Override public void finish(boolean moveHomeToTop, boolean sendUserLeaveHint) { - if (DEBUG_RECENTS_ANIMATIONS) Slog.d(TAG, "finish(" + moveHomeToTop + "):" - + " mCanceled=" + mCanceled); + ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, + "finish(%b): mCanceled=%b", moveHomeToTop, mCanceled); final long token = Binder.clearCallingIdentity(); try { synchronized (mService.getWindowManagerLock()) { @@ -250,8 +252,8 @@ public class RecentsAnimationController implements DeathRecipient { @Override public void setInputConsumerEnabled(boolean enabled) { - if (DEBUG_RECENTS_ANIMATIONS) Slog.d(TAG, "setInputConsumerEnabled(" + enabled + "):" - + " mCanceled=" + mCanceled); + ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, + "setInputConsumerEnabled(%s): mCanceled=%b", enabled, mCanceled); final long token = Binder.clearCallingIdentity(); try { synchronized (mService.getWindowManagerLock()) { @@ -392,8 +394,8 @@ public class RecentsAnimationController implements DeathRecipient { final AppWindowToken recentsComponentAppToken = targetStack.getTopChild().getTopFullscreenAppToken(); if (recentsComponentAppToken != null) { - if (DEBUG_RECENTS_ANIMATIONS) Slog.d(TAG, "setHomeApp(" - + recentsComponentAppToken.getName() + ")"); + ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, + "setHomeApp(%s)", recentsComponentAppToken.getName()); mTargetAppToken = recentsComponentAppToken; if (recentsComponentAppToken.windowsCanBeWallpaperTarget()) { mDisplayContent.pendingLayoutChanges |= FINISH_LAYOUT_REDO_WALLPAPER; @@ -418,7 +420,7 @@ public class RecentsAnimationController implements DeathRecipient { @VisibleForTesting AnimationAdapter addAnimation(Task task, boolean isRecentTaskInvisible) { - if (DEBUG_RECENTS_ANIMATIONS) Slog.d(TAG, "addAnimation(" + task.getName() + ")"); + ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, "addAnimation(%s)", task.getName()); final TaskAnimationAdapter taskAdapter = new TaskAnimationAdapter(task, isRecentTaskInvisible); task.startAnimation(task.getPendingTransaction(), taskAdapter, false /* hidden */); @@ -429,8 +431,8 @@ public class RecentsAnimationController implements DeathRecipient { @VisibleForTesting void removeAnimation(TaskAnimationAdapter taskAdapter) { - if (DEBUG_RECENTS_ANIMATIONS) Slog.d(TAG, "removeAnimation(" - + taskAdapter.mTask.mTaskId + ")"); + ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, + "removeAnimation(%d)", taskAdapter.mTask.mTaskId); taskAdapter.mTask.setCanAffectSystemUiFlags(true); taskAdapter.mCapturedFinishCallback.onAnimationFinished(taskAdapter); mPendingAnimations.remove(taskAdapter); @@ -438,14 +440,14 @@ public class RecentsAnimationController implements DeathRecipient { @VisibleForTesting void removeWallpaperAnimation(WallpaperAnimationAdapter wallpaperAdapter) { - if (DEBUG_RECENTS_ANIMATIONS) Slog.d(TAG, "removeWallpaperAnimation()"); + ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, "removeWallpaperAnimation()"); wallpaperAdapter.getLeashFinishedCallback().onAnimationFinished(wallpaperAdapter); mPendingWallpaperAnimations.remove(wallpaperAdapter); } void startAnimation() { - if (DEBUG_RECENTS_ANIMATIONS) Slog.d(TAG, "startAnimation(): mPendingStart=" + mPendingStart - + " mCanceled=" + mCanceled); + ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, + "startAnimation(): mPendingStart=%b mCanceled=%b", mPendingStart, mCanceled); if (!mPendingStart || mCanceled) { // Skip starting if we've already started or canceled the animation return; @@ -483,13 +485,10 @@ public class RecentsAnimationController implements DeathRecipient { } mRunner.onAnimationStart(mController, appTargets, wallpaperTargets, contentInsets, minimizedHomeBounds); - 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); - } - } + ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, + "startAnimation(): Notify animation start: %s", + mPendingAnimations.stream() + .map(anim->anim.mTask.mTaskId).collect(Collectors.toList())); } catch (RemoteException e) { Slog.e(TAG, "Failed to start recents animation", e); } @@ -513,7 +512,7 @@ public class RecentsAnimationController implements DeathRecipient { } private RemoteAnimationTarget[] createWallpaperAnimations() { - if (DEBUG_RECENTS_ANIMATIONS) Slog.d(TAG, "createWallpaperAnimations()"); + ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, "createWallpaperAnimations()"); return WallpaperAnimationAdapter.startWallpaperAnimations(mService, 0L, 0L, adapter -> { synchronized (mService.mGlobalLock) { @@ -533,7 +532,7 @@ public class RecentsAnimationController implements DeathRecipient { } private void cancelAnimation(@ReorderMode int reorderMode, boolean screenshot, String reason) { - if (DEBUG_RECENTS_ANIMATIONS) Slog.d(TAG, "cancelAnimation(): reason=" + reason); + ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, "cancelAnimation(): reason=%s", reason); synchronized (mService.getWindowManagerLock()) { if (mCanceled) { // We've already canceled the animation @@ -627,9 +626,7 @@ public class RecentsAnimationController implements DeathRecipient { mRecentScreenshotAnimator = new SurfaceAnimator( animatable, () -> { - if (DEBUG_RECENTS_ANIMATIONS) { - Slog.d(TAG, "mRecentScreenshotAnimator finish"); - } + ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, "mRecentScreenshotAnimator finish"); mCallbacks.onAnimationFinished(reorderMode, false /* sendUserLeaveHint */); }, mService); mRecentScreenshotAnimator.transferAnimation(task.mSurfaceAnimator); @@ -637,9 +634,10 @@ public class RecentsAnimationController implements DeathRecipient { } void cleanupAnimation(@ReorderMode int reorderMode) { - if (DEBUG_RECENTS_ANIMATIONS) Slog.d(TAG, - "cleanupAnimation(): Notify animation finished mPendingAnimations=" - + mPendingAnimations.size() + " reorderMode=" + reorderMode); + ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, + "cleanupAnimation(): Notify animation finished mPendingAnimations=%d " + + "reorderMode=%d", + mPendingAnimations.size(), 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 87bda4a545e10a8e9ba443fef318a46e083c10c6..2b2ae927dd96cb5e66de7437c4b3d3a8642c7e4c 100644 --- a/services/core/java/com/android/server/wm/RemoteAnimationController.java +++ b/services/core/java/com/android/server/wm/RemoteAnimationController.java @@ -17,9 +17,8 @@ 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; @@ -39,6 +38,8 @@ 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; @@ -51,7 +52,6 @@ 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) { - if (DEBUG_REMOTE_ANIMATIONS) Slog.d(TAG, "createAnimationAdapter(): token=" - + appWindowToken); + ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "createAnimationAdapter(): token=%s", + 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() { - if (DEBUG_REMOTE_ANIMATIONS) Slog.d(TAG, "goodToGo()"); + ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "goodToGo()"); if (mPendingAnimations.isEmpty() || mCanceled) { - if (DEBUG_REMOTE_ANIMATIONS) Slog.d(TAG, "goodToGo(): Animation finished already," - + " canceled=" + mCanceled - + " mPendingAnimations=" + mPendingAnimations.size()); + ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, + "goodToGo(): Animation finished already, canceled=%s mPendingAnimations=%d", + mCanceled, mPendingAnimations.size()); onAnimationFinished(); return; } @@ -115,7 +115,7 @@ class RemoteAnimationController implements DeathRecipient { // Create the app targets final RemoteAnimationTarget[] appTargets = createAppAnimations(); if (appTargets.length == 0) { - if (DEBUG_REMOTE_ANIMATIONS) Slog.d(TAG, "goodToGo(): No apps to animate"); + ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "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 (DEBUG_REMOTE_ANIMATIONS) { - Slog.d(TAG, "startAnimation(): Notify animation start:"); + if (ProtoLogImpl.isEnabled(WM_DEBUG_REMOTE_ANIMATIONS)) { + ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "startAnimation(): Notify animation start:"); writeStartDebugStatement(); } }); @@ -140,7 +140,7 @@ class RemoteAnimationController implements DeathRecipient { } void cancelAnimation(String reason) { - if (DEBUG_REMOTE_ANIMATIONS) Slog.d(TAG, "cancelAnimation(): reason=" + reason); + ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "cancelAnimation(): reason=%s", reason); synchronized (mService.getWindowManagerLock()) { if (mCanceled) { return; @@ -152,28 +152,28 @@ class RemoteAnimationController implements DeathRecipient { } private void writeStartDebugStatement() { - Slog.i(TAG, "Starting remote animation"); + ProtoLog.i(WM_DEBUG_REMOTE_ANIMATIONS, "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(); - Slog.i(TAG, sw.toString()); + ProtoLog.i(WM_DEBUG_REMOTE_ANIMATIONS, "%s", sw.toString()); } private RemoteAnimationTarget[] createAppAnimations() { - if (DEBUG_REMOTE_ANIMATIONS) Slog.d(TAG, "createAppAnimations()"); + ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "createAppAnimations()"); final ArrayList 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) { - if (DEBUG_REMOTE_ANIMATIONS) Slog.d(TAG, "\tAdd token=" + wrappers.mAppWindowToken); + ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "\tAdd token=%s", wrappers.mAppWindowToken); targets.add(target); } else { - if (DEBUG_REMOTE_ANIMATIONS) Slog.d(TAG, "\tRemove token=" - + wrappers.mAppWindowToken); + ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "\tRemove token=%s", + 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() { - if (DEBUG_REMOTE_ANIMATIONS) Slog.d(TAG, "createWallpaperAnimations()"); + ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "createWallpaperAnimations()"); return WallpaperAnimationAdapter.startWallpaperAnimations(mService, mRemoteAnimationAdapter.getDuration(), mRemoteAnimationAdapter.getStatusBarTransitionDelay(), @@ -207,15 +207,15 @@ class RemoteAnimationController implements DeathRecipient { } private void onAnimationFinished() { - if (DEBUG_REMOTE_ANIMATIONS) Slog.d(TAG, "onAnimationFinished(): mPendingAnimations=" - + mPendingAnimations.size()); + ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "onAnimationFinished(): mPendingAnimations=%d", + mPendingAnimations.size()); mHandler.removeCallbacks(mTimeoutRunnable); synchronized (mService.mGlobalLock) { unlinkToDeathOfRunner(); releaseFinishedCallback(); mService.openSurfaceTransaction(); try { - if (DEBUG_REMOTE_ANIMATIONS) Slog.d(TAG, + ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "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); - if (DEBUG_REMOTE_ANIMATIONS) Slog.d(TAG, "\tapp=" + adapters.mAppWindowToken); + ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "\tapp=%s", adapters.mAppWindowToken); } for (int i = mPendingWallpaperAnimations.size() - 1; i >= 0; i--) { final WallpaperAnimationAdapter adapter = mPendingWallpaperAnimations.get(i); adapter.getLeashFinishedCallback().onAnimationFinished(adapter); mPendingWallpaperAnimations.remove(i); - if (DEBUG_REMOTE_ANIMATIONS) Slog.d(TAG, "\twallpaper=" + adapter.getToken()); + ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "\twallpaper=%s", adapter.getToken()); } } catch (Exception e) { Slog.e(TAG, "Failed to finish remote animation", e); @@ -245,7 +245,7 @@ class RemoteAnimationController implements DeathRecipient { } } setRunningRemoteAnimation(false); - if (DEBUG_REMOTE_ANIMATIONS) Slog.i(TAG, "Finishing remote animation"); + ProtoLog.i(WM_DEBUG_REMOTE_ANIMATIONS, "Finishing remote animation"); } private void invokeAnimationCancelled() { @@ -306,7 +306,7 @@ class RemoteAnimationController implements DeathRecipient { @Override public void onAnimationFinished() throws RemoteException { - if (DEBUG_REMOTE_ANIMATIONS) Slog.d(TAG, "app-onAnimationFinished(): mOuter=" + mOuter); + ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "app-onAnimationFinished(): mOuter=%s", mOuter); final long token = Binder.clearCallingIdentity(); try { if (mOuter != null) { @@ -326,7 +326,7 @@ class RemoteAnimationController implements DeathRecipient { * to prevent memory leak. */ void release() { - if (DEBUG_REMOTE_ANIMATIONS) Slog.d(TAG, "app-release(): mOuter=" + mOuter); + ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "app-release(): mOuter=%s", mOuter); mOuter = null; } }; @@ -420,7 +420,7 @@ class RemoteAnimationController implements DeathRecipient { @Override public void startAnimation(SurfaceControl animationLeash, Transaction t, OnAnimationFinishedCallback finishCallback) { - if (DEBUG_REMOTE_ANIMATIONS) Slog.d(TAG, "startAnimation"); + ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "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 4365d0325545a32ec3361e7f05139b9a2059c546..78fcb37aacd12fcc665c5be0c7689e6c4e39c91d 100644 --- a/services/core/java/com/android/server/wm/RootWindowContainer.java +++ b/services/core/java/com/android/server/wm/RootWindowContainer.java @@ -29,20 +29,19 @@ 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; @@ -50,7 +49,6 @@ 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; @@ -80,6 +78,7 @@ 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; @@ -195,8 +194,8 @@ class RootWindowContainer extends WindowContainer mTopFocusedDisplayId = topFocusedDisplayId; mWmService.mInputManager.setFocusedDisplay(topFocusedDisplayId); mWmService.mPolicy.setTopFocusedDisplay(topFocusedDisplayId); - if (DEBUG_FOCUS_LIGHT) Slog.v(TAG_WM, "New topFocusedDisplayId=" - + topFocusedDisplayId); + ProtoLog.v(WM_DEBUG_FOCUS_LIGHT, "New topFocusedDisplayId=%d", + topFocusedDisplayId); } return changed; } @@ -457,13 +456,13 @@ class RootWindowContainer extends WindowContainer } void removeReplacedWindows() { - if (SHOW_TRANSACTIONS) Slog.i(TAG, ">>> OPEN TRANSACTION removeReplacedWindows"); + ProtoLog.i(WM_SHOW_TRANSACTIONS, ">>> OPEN TRANSACTION removeReplacedWindows"); mWmService.openSurfaceTransaction(); try { forAllWindows(sRemoveReplacedWindowsConsumer, true /* traverseTopToBottom */); } finally { mWmService.closeSurfaceTransaction("removeReplacedWindows"); - if (SHOW_TRANSACTIONS) Slog.i(TAG, "<<< CLOSE TRANSACTION removeReplacedWindows"); + ProtoLog.i(WM_SHOW_TRANSACTIONS, "<<< CLOSE TRANSACTION removeReplacedWindows"); } } @@ -539,8 +538,8 @@ class RootWindowContainer extends WindowContainer Slog.w(TAG_WM, "Looks like we have reclaimed some memory, clearing surface for retry."); if (surfaceController != null) { - if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) logSurface(winAnimator.mWin, - "RECOVER DESTROY", false); + ProtoLog.i(WM_SHOW_SURFACE_ALLOC, + "SURFACE RECOVER DESTROY: %s", winAnimator.mWin); winAnimator.destroySurface(); if (winAnimator.mWin.mAppToken != null) { winAnimator.mWin.mAppToken.removeStartingWindow(); @@ -651,8 +650,11 @@ class RootWindowContainer extends WindowContainer handleResizingWindows(); - if (DEBUG_ORIENTATION && mWmService.mDisplayFrozen) Slog.v(TAG, - "With display frozen, orientationChangeComplete=" + mOrientationChangeComplete); + if (mWmService.mDisplayFrozen) { + ProtoLog.v(WM_DEBUG_ORIENTATION, + "With display frozen, orientationChangeComplete=%b", + mOrientationChangeComplete); + } if (mOrientationChangeComplete) { if (mWmService.mWindowsFreezingScreen != WINDOWS_FREEZING_SCREENS_NONE) { mWmService.mWindowsFreezingScreen = WINDOWS_FREEZING_SCREENS_NONE; @@ -714,7 +716,7 @@ class RootWindowContainer extends WindowContainer } if (mUpdateRotation) { - if (DEBUG_ORIENTATION) Slog.d(TAG, "Performing post-rotate rotation"); + ProtoLog.d(WM_DEBUG_ORIENTATION, "Performing post-rotate rotation"); mUpdateRotation = updateRotationUnchecked(); } @@ -868,29 +870,26 @@ class RootWindowContainer extends WindowContainer final int privateflags = attrs.privateFlags; boolean displayHasContent = false; - 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); - } + 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 (w.mHasSurface && onScreen) { if (!syswin && w.mAttrs.userActivityTimeout >= 0 && mUserActivityTimeout < 0) { mUserActivityTimeout = w.mAttrs.userActivityTimeout; - if (DEBUG_KEEP_SCREEN_ON) { - Slog.d(TAG, "mUserActivityTimeout set to " + mUserActivityTimeout); - } + ProtoLog.d(WM_DEBUG_KEEP_SCREEN_ON, "mUserActivityTimeout set to %d", + mUserActivityTimeout); } } if (w.mHasSurface && canBeSeen) { if ((attrFlags & FLAG_KEEP_SCREEN_ON) != 0) { mHoldScreen = w.mSession; mHoldScreenWindow = w; - } 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)); + } 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)); } 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 c4bfe4b0c6c52e66a382df696604a1831fc99b77..157bd3b0038b872598c12f0288f187c04dd9ef1f 100644 --- a/services/core/java/com/android/server/wm/ScreenRotationAnimation.java +++ b/services/core/java/com/android/server/wm/ScreenRotationAnimation.java @@ -16,10 +16,9 @@ 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; @@ -40,6 +39,8 @@ 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; /** @@ -215,10 +216,8 @@ class ScreenRotationAnimation { Slog.w(TAG, "Unable to allocate freeze surface", e); } - if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) { - Slog.i(TAG_WM, - " FREEZE " + mSurfaceControl + ": CREATE"); - } + ProtoLog.i(WM_SHOW_SURFACE_ALLOC, + " FREEZE %s: CREATE", mSurfaceControl); setRotation(t, originalRotation); t.apply(); } @@ -481,11 +480,7 @@ class ScreenRotationAnimation { mSurfaceRotationAnimationController = null; } if (mSurfaceControl != null) { - if (SHOW_TRANSACTIONS || - SHOW_SURFACE_ALLOC) { - Slog.i(TAG_WM, - " FREEZE " + mSurfaceControl + ": DESTROY"); - } + ProtoLog.i(WM_SHOW_SURFACE_ALLOC, " FREEZE %s: DESTROY", mSurfaceControl); mSurfaceControl = null; SurfaceControl.Transaction t = mService.mTransactionFactory.get(); if (mRotationLayer != null) { diff --git a/services/core/java/com/android/server/wm/Session.java b/services/core/java/com/android/server/wm/Session.java index 72bb355146d18b1eaeecd9146dd1566e6c494f6a..b047d8f8a7b9277f6c4bd870af067a502c70cd9f 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,6 +56,7 @@ 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; @@ -478,8 +479,7 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient { Slog.v(TAG_WM, "First window added to " + this + ", creating SurfaceSession"); } mSurfaceSession = new SurfaceSession(); - if (SHOW_TRANSACTIONS) Slog.i( - TAG_WM, " NEW SURFACE SESSION " + mSurfaceSession); + ProtoLog.i(WM_SHOW_TRANSACTIONS, " NEW SURFACE SESSION %s", 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); } - if (SHOW_TRANSACTIONS) Slog.i(TAG_WM, " KILL SURFACE SESSION " + mSurfaceSession); + ProtoLog.i(WM_SHOW_TRANSACTIONS, " KILL SURFACE SESSION %s", 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 fc8a27d64fce897a7ed48ef86d6a08a3a64edee9..b680fa45f00f9584225f35ddfcc14c270468e3f5 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.WindowManagerDebugConfig.DEBUG_ORIENTATION; +import static com.android.server.wm.ProtoLogGroup.WM_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,6 +54,7 @@ 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; @@ -297,9 +298,7 @@ class TaskPositioner implements IBinder.DeathRecipient { mDragWindowHandle.frameBottom = p.y; // Pause rotations before a drag. - if (DEBUG_ORIENTATION) { - Slog.d(TAG, "Pausing rotation during re-position"); - } + ProtoLog.d(WM_DEBUG_ORIENTATION, "Pausing rotation during re-position"); mDisplayContent.getDisplayRotation().pause(); // Notify InputMonitor to take mDragWindowHandle. @@ -340,9 +339,7 @@ class TaskPositioner implements IBinder.DeathRecipient { mDisplayContent.getInputMonitor().updateInputWindowsLw(true /*force*/); // Resume rotations after a drag. - if (DEBUG_ORIENTATION) { - Slog.d(TAG, "Resuming rotation after re-position"); - } + ProtoLog.d(WM_DEBUG_ORIENTATION, "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 f291573f854aef1b9d2c66daa6056c41fcab9f59..adecc36671c92c9631dc5edc0d52116aa8bc2872 100644 --- a/services/core/java/com/android/server/wm/TaskScreenshotAnimatable.java +++ b/services/core/java/com/android/server/wm/TaskScreenshotAnimatable.java @@ -15,14 +15,15 @@ */ package com.android.server.wm; -import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_RECENTS_ANIMATIONS; +import static com.android.server.wm.ProtoLogGroup.WM_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; /** @@ -45,10 +46,9 @@ class TaskScreenshotAnimatable implements SurfaceAnimator.Animatable { mTask = task; mWidth = (buffer != null) ? buffer.getWidth() : 1; mHeight = (buffer != null) ? buffer.getHeight() : 1; - if (DEBUG_RECENTS_ANIMATIONS) { - Slog.d(TAG, "Creating TaskScreenshotAnimatable: task: " + task - + "width: " + mWidth + "height: " + mHeight); - } + ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, + "Creating TaskScreenshotAnimatable: task: %s width: %d height: %d", + task, mWidth, 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 7456f0d7813767e586cf8c114c76e540e557aa69..d070850a895f84f2322100cc3e3709b39480fa48 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.WindowManagerDebugConfig.DEBUG_STARTING_WINDOW; +import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_STARTING_WINDOW; import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME; import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; @@ -79,6 +79,7 @@ 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. @@ -259,14 +260,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); - if (DEBUG_STARTING_WINDOW) { - Slog.v(TAG, "Defer removing snapshot surface in " + (now - mShownTime) + "ms"); - } + ProtoLog.v(WM_DEBUG_STARTING_WINDOW, + "Defer removing snapshot surface in %dms", (now - mShownTime)); + return; } } try { - if (DEBUG_STARTING_WINDOW) Slog.v(TAG, "Removing snapshot surface"); + ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Removing snapshot surface"); mSession.remove(mWindow); } catch (RemoteException e) { // Local call. @@ -286,8 +287,8 @@ class TaskSnapshotSurface implements StartingSurface { private void drawSnapshot() { mSurface.copyFrom(mSurfaceControl); - if (DEBUG_STARTING_WINDOW) Slog.v(TAG, "Drawing snapshot surface sizeMismatch=" - + mSizeMismatch); + ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Drawing snapshot surface sizeMismatch=%b", + 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 895350b43eebbe2d8fbf1e677ec098791c56228c..513008d3c3c3beb5724c3e7717f89921939b44ee 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,15 +68,11 @@ class WallpaperAnimationAdapter implements AnimationAdapter { final ArrayList targets = new ArrayList<>(); service.mRoot.forAllWallpaperWindows(wallpaperWindow -> { if (!wallpaperWindow.getDisplayContent().mWallpaperController.isWallpaperVisible()) { - if (DEBUG_REMOTE_ANIMATIONS || DEBUG_RECENTS_ANIMATIONS) { - Slog.d(TAG, "\tNot visible=" + wallpaperWindow); - } + ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "\tNot visible=%s", wallpaperWindow); return; } - if (DEBUG_REMOTE_ANIMATIONS || DEBUG_RECENTS_ANIMATIONS) { - Slog.d(TAG, "\tvisible=" + wallpaperWindow); - } + ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "\tvisible=%s", wallpaperWindow); final WallpaperAnimationAdapter wallpaperAdapter = new WallpaperAnimationAdapter( wallpaperWindow, durationHint, statusBarTransitionDelay, animationCanceledRunnable); @@ -129,7 +125,7 @@ class WallpaperAnimationAdapter implements AnimationAdapter { @Override public void startAnimation(SurfaceControl animationLeash, SurfaceControl.Transaction t, SurfaceAnimator.OnAnimationFinishedCallback finishCallback) { - if (DEBUG_REMOTE_ANIMATIONS) Slog.d(TAG, "startAnimation"); + ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "startAnimation"); // Restore z-layering until client has a chance to modify it. t.setLayer(animationLeash, mWallpaperToken.getPrefixOrderIndex()); @@ -139,7 +135,7 @@ class WallpaperAnimationAdapter implements AnimationAdapter { @Override public void onAnimationCancelled(SurfaceControl animationLeash) { - if (DEBUG_REMOTE_ANIMATIONS) Slog.d(TAG, "onAnimationCancelled"); + ProtoLog.d(WM_DEBUG_REMOTE_ANIMATIONS, "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 13902eedbfbadb042ca1b68047fa89b13f8736d7..e7b09db9368a005c8979e84afc3d08b6bae6fa07 100644 --- a/services/core/java/com/android/server/wm/WallpaperController.java +++ b/services/core/java/com/android/server/wm/WallpaperController.java @@ -24,7 +24,6 @@ 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; @@ -607,8 +606,9 @@ class WallpaperController { boolean processWallpaperDrawPendingTimeout() { if (mWallpaperDrawState == WALLPAPER_DRAW_PENDING) { mWallpaperDrawState = WALLPAPER_DRAW_TIMEOUT; - if (DEBUG_APP_TRANSITIONS || DEBUG_WALLPAPER) Slog.v(TAG, - "*** WALLPAPER DRAW TIMEOUT"); + if (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,9 +641,11 @@ class WallpaperController { WALLPAPER_DRAW_PENDING_TIMEOUT_DURATION); } - if (DEBUG_APP_TRANSITIONS || DEBUG_WALLPAPER) Slog.v(TAG, - "Wallpaper should be visible but has not been drawn yet. " + - "mWallpaperDrawState=" + mWallpaperDrawState); + if (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 1e206f6be3cc882e9b042c885ff1fcf617f86021..f437b284637b421da6ede7c730808b634a30047b 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; @@ -32,6 +32,7 @@ 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; @@ -138,7 +139,7 @@ public class WindowAnimator { Slog.i(TAG, "!!! animate: entry time=" + mCurrentTime); } - if (SHOW_TRANSACTIONS) Slog.i(TAG, ">>> OPEN TRANSACTION animate"); + ProtoLog.i(WM_SHOW_TRANSACTIONS, ">>> OPEN TRANSACTION animate"); mService.openSurfaceTransaction(); try { final AccessibilityController accessibilityController = @@ -177,7 +178,7 @@ public class WindowAnimator { Slog.wtf(TAG, "Unhandled exception in Window Manager", e); } finally { mService.closeSurfaceTransaction("WindowAnimator"); - if (SHOW_TRANSACTIONS) Slog.i(TAG, "<<< CLOSE TRANSACTION animate"); + ProtoLog.i(WM_SHOW_TRANSACTIONS, "<<< 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 c366e4d6108b7d4de049074bb302f9247b9842f3..93b0fd9b1fe3a6b3d5a1bc7801ed5113f1c4facc 100644 --- a/services/core/java/com/android/server/wm/WindowManagerDebugConfig.java +++ b/services/core/java/com/android/server/wm/WindowManagerDebugConfig.java @@ -33,32 +33,19 @@ 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; @@ -66,17 +53,9 @@ public class WindowManagerDebugConfig { static final boolean DEBUG_STACK = false; static final boolean DEBUG_DISPLAY = false; static final boolean DEBUG_POWER = 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_VERBOSE_TRANSACTIONS = false; + static final boolean SHOW_LIGHT_TRANSACTIONS = false; 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 169e4159346fcce01757fbe9de6f8b2eba4489ee..e3d677c2a2bfd7170eb971248d2ceea78e95ec79 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,6 +267,7 @@ 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; @@ -1293,7 +1294,7 @@ public class WindowManagerService extends IWindowManager.Stub // The window manager only throws security exceptions, so let's // log all others. if (!(e instanceof SecurityException)) { - Slog.wtf(TAG_WM, "Window Manager Crash", e); + ProtoLog.wtf(WM_ERROR, "Window Manager Crash %s", e); } throw e; } @@ -1333,38 +1334,41 @@ public class WindowManagerService extends IWindowManager.Stub final DisplayContent displayContent = getDisplayContentOrCreate(displayId, attrs.token); if (displayContent == null) { - Slog.w(TAG_WM, "Attempted to add window to a display that does not exist: " - + displayId + ". Aborting."); + ProtoLog.w(WM_ERROR, "Attempted to add window to a display that does " + + "not exist: %d. Aborting.", displayId); return WindowManagerGlobal.ADD_INVALID_DISPLAY; } if (!displayContent.hasAccess(session.mUid)) { - Slog.w(TAG_WM, "Attempted to add window to a display for which the application " - + "does not have access: " + displayId + ". Aborting."); + ProtoLog.w(WM_ERROR, + "Attempted to add window to a display for which the application " + + "does not have access: %d. Aborting.", displayId); return WindowManagerGlobal.ADD_INVALID_DISPLAY; } if (mWindowMap.containsKey(client.asBinder())) { - Slog.w(TAG_WM, "Window " + client + " is already added"); + ProtoLog.w(WM_ERROR, "Window %s is already added", client); return WindowManagerGlobal.ADD_DUPLICATE_ADD; } if (type >= FIRST_SUB_WINDOW && type <= LAST_SUB_WINDOW) { parentWindow = windowForClientLocked(null, attrs.token, false); if (parentWindow == null) { - Slog.w(TAG_WM, "Attempted to add window with token that is not a window: " - + attrs.token + ". Aborting."); + ProtoLog.w(WM_ERROR, "Attempted to add window with token that is not a window: " + + "%s. Aborting.", attrs.token); return WindowManagerGlobal.ADD_BAD_SUBWINDOW_TOKEN; } if (parentWindow.mAttrs.type >= FIRST_SUB_WINDOW && parentWindow.mAttrs.type <= LAST_SUB_WINDOW) { - Slog.w(TAG_WM, "Attempted to add window with token that is a sub-window: " - + attrs.token + ". Aborting."); + ProtoLog.w(WM_ERROR, "Attempted to add window with token that is a sub-window: " + + "%s. Aborting.", attrs.token); return WindowManagerGlobal.ADD_BAD_SUBWINDOW_TOKEN; } } if (type == TYPE_PRIVATE_PRESENTATION && !displayContent.isPrivate()) { - Slog.w(TAG_WM, "Attempted to add private presentation window to a non-private display. Aborting."); + ProtoLog.w(WM_ERROR, + "Attempted to add private presentation window to a non-private display. " + + "Aborting."); return WindowManagerGlobal.ADD_PERMISSION_DENIED; } @@ -1382,46 +1386,48 @@ public class WindowManagerService extends IWindowManager.Stub if (token == null) { if (rootType >= FIRST_APPLICATION_WINDOW && rootType <= LAST_APPLICATION_WINDOW) { - Slog.w(TAG_WM, "Attempted to add application window with unknown token " - + attrs.token + ". Aborting."); + ProtoLog.w(WM_ERROR, "Attempted to add application window with unknown token " + + "%s. Aborting.", attrs.token); return WindowManagerGlobal.ADD_BAD_APP_TOKEN; } if (rootType == TYPE_INPUT_METHOD) { - Slog.w(TAG_WM, "Attempted to add input method window with unknown token " - + attrs.token + ". Aborting."); + ProtoLog.w(WM_ERROR, "Attempted to add input method window with unknown token " + + "%s. Aborting.", attrs.token); return WindowManagerGlobal.ADD_BAD_APP_TOKEN; } if (rootType == TYPE_VOICE_INTERACTION) { - Slog.w(TAG_WM, "Attempted to add voice interaction window with unknown token " - + attrs.token + ". Aborting."); + ProtoLog.w(WM_ERROR, + "Attempted to add voice interaction window with unknown token " + + "%s. Aborting.", attrs.token); return WindowManagerGlobal.ADD_BAD_APP_TOKEN; } if (rootType == TYPE_WALLPAPER) { - Slog.w(TAG_WM, "Attempted to add wallpaper window with unknown token " - + attrs.token + ". Aborting."); + ProtoLog.w(WM_ERROR, "Attempted to add wallpaper window with unknown token " + + "%s. Aborting.", attrs.token); return WindowManagerGlobal.ADD_BAD_APP_TOKEN; } if (rootType == TYPE_DREAM) { - Slog.w(TAG_WM, "Attempted to add Dream window with unknown token " - + attrs.token + ". Aborting."); + ProtoLog.w(WM_ERROR, "Attempted to add Dream window with unknown token " + + "%s. Aborting.", attrs.token); return WindowManagerGlobal.ADD_BAD_APP_TOKEN; } if (rootType == TYPE_QS_DIALOG) { - Slog.w(TAG_WM, "Attempted to add QS dialog window with unknown token " - + attrs.token + ". Aborting."); + ProtoLog.w(WM_ERROR, "Attempted to add QS dialog window with unknown token " + + "%s. Aborting.", attrs.token); return WindowManagerGlobal.ADD_BAD_APP_TOKEN; } if (rootType == TYPE_ACCESSIBILITY_OVERLAY) { - Slog.w(TAG_WM, "Attempted to add Accessibility overlay window with unknown token " - + attrs.token + ". Aborting."); + ProtoLog.w(WM_ERROR, + "Attempted to add Accessibility overlay window with unknown token " + + "%s. Aborting.", attrs.token); 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)) { - Slog.w(TAG_WM, "Attempted to add a toast window with unknown token " - + attrs.token + ". Aborting."); + ProtoLog.w(WM_ERROR, "Attempted to add a toast window with unknown token " + + "%s. Aborting.", attrs.token); return WindowManagerGlobal.ADD_BAD_APP_TOKEN; } } @@ -1430,49 +1436,52 @@ 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) { - Slog.w(TAG_WM, "Attempted to add window with non-application token " - + token + ". Aborting."); + ProtoLog.w(WM_ERROR, "Attempted to add window with non-application token " + + ".%s Aborting.", token); return WindowManagerGlobal.ADD_NOT_APP_TOKEN; } else if (atoken.removed) { - Slog.w(TAG_WM, "Attempted to add window with exiting application token " - + token + ". Aborting."); + ProtoLog.w(WM_ERROR, "Attempted to add window with exiting application token " + + ".%s Aborting.", token); return WindowManagerGlobal.ADD_APP_EXITING; } else if (type == TYPE_APPLICATION_STARTING && atoken.startingWindow != null) { - Slog.w(TAG_WM, "Attempted to add starting window to token with already existing" - + " starting window"); + ProtoLog.w(WM_ERROR, + "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) { - Slog.w(TAG_WM, "Attempted to add input method window with bad token " - + attrs.token + ". Aborting."); - return WindowManagerGlobal.ADD_BAD_APP_TOKEN; + ProtoLog.w(WM_ERROR, "Attempted to add input method window with bad token " + + "%s. Aborting.", attrs.token); + return WindowManagerGlobal.ADD_BAD_APP_TOKEN; } } else if (rootType == TYPE_VOICE_INTERACTION) { if (token.windowType != TYPE_VOICE_INTERACTION) { - Slog.w(TAG_WM, "Attempted to add voice interaction window with bad token " - + attrs.token + ". Aborting."); - return WindowManagerGlobal.ADD_BAD_APP_TOKEN; + ProtoLog.w(WM_ERROR, "Attempted to add voice interaction window with bad token " + + "%s. Aborting.", attrs.token); + return WindowManagerGlobal.ADD_BAD_APP_TOKEN; } } else if (rootType == TYPE_WALLPAPER) { if (token.windowType != TYPE_WALLPAPER) { - Slog.w(TAG_WM, "Attempted to add wallpaper window with bad token " - + attrs.token + ". Aborting."); - return WindowManagerGlobal.ADD_BAD_APP_TOKEN; + ProtoLog.w(WM_ERROR, "Attempted to add wallpaper window with bad token " + + "%s. Aborting.", attrs.token); + return WindowManagerGlobal.ADD_BAD_APP_TOKEN; } } else if (rootType == TYPE_DREAM) { if (token.windowType != TYPE_DREAM) { - Slog.w(TAG_WM, "Attempted to add Dream window with bad token " - + attrs.token + ". Aborting."); - return WindowManagerGlobal.ADD_BAD_APP_TOKEN; + ProtoLog.w(WM_ERROR, "Attempted to add Dream window with bad token " + + "%s. Aborting.", attrs.token); + return WindowManagerGlobal.ADD_BAD_APP_TOKEN; } } else if (rootType == TYPE_ACCESSIBILITY_OVERLAY) { if (token.windowType != TYPE_ACCESSIBILITY_OVERLAY) { - Slog.w(TAG_WM, "Attempted to add Accessibility overlay window with bad token " - + attrs.token + ". Aborting."); + ProtoLog.w(WM_ERROR, + "Attempted to add Accessibility overlay window with bad token " + + "%s. Aborting.", attrs.token); return WindowManagerGlobal.ADD_BAD_APP_TOKEN; } } else if (type == TYPE_TOAST) { @@ -1480,18 +1489,19 @@ public class WindowManagerService extends IWindowManager.Stub addToastWindowRequiresToken = doesAddToastWindowRequireToken(attrs.packageName, callingUid, parentWindow); if (addToastWindowRequiresToken && token.windowType != TYPE_TOAST) { - Slog.w(TAG_WM, "Attempted to add a toast window with bad token " - + attrs.token + ". Aborting."); + ProtoLog.w(WM_ERROR, "Attempted to add a toast window with bad token " + + "%s. Aborting.", attrs.token); return WindowManagerGlobal.ADD_BAD_APP_TOKEN; } } else if (type == TYPE_QS_DIALOG) { if (token.windowType != TYPE_QS_DIALOG) { - Slog.w(TAG_WM, "Attempted to add QS dialog window with bad token " - + attrs.token + ". Aborting."); + ProtoLog.w(WM_ERROR, "Attempted to add QS dialog window with bad token " + + "%s. Aborting.", attrs.token); return WindowManagerGlobal.ADD_BAD_APP_TOKEN; } } else if (token.asAppWindowToken() != null) { - Slog.w(TAG_WM, "Non-null appWindowToken for system window of rootType=" + rootType); + ProtoLog.w(WM_ERROR, "Non-null appWindowToken for system window of rootType=%d", + 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; @@ -1505,13 +1515,13 @@ public class WindowManagerService extends IWindowManager.Stub if (win.mDeathRecipient == null) { // Client has apparently died, so there is no reason to // continue. - Slog.w(TAG_WM, "Adding window client " + client.asBinder() - + " that is dead, aborting."); + ProtoLog.w(WM_ERROR, "Adding window client %s" + + " that is dead, aborting.", client.asBinder()); return WindowManagerGlobal.ADD_APP_EXITING; } if (win.getDisplayContent() == null) { - Slog.w(TAG_WM, "Adding window to Display that has been removed."); + ProtoLog.w(WM_ERROR, "Adding window to Display that has been removed."); return WindowManagerGlobal.ADD_INVALID_DISPLAY; } @@ -1543,7 +1553,7 @@ public class WindowManagerService extends IWindowManager.Stub // schedule hiding all of its toast windows. if (type == TYPE_TOAST) { if (!displayContent.canAddToastWindowForUid(callingUid)) { - Slog.w(TAG_WM, "Adding more than one toast window for UID at a time."); + ProtoLog.w(WM_ERROR, "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 @@ -1589,8 +1599,8 @@ public class WindowManagerService extends IWindowManager.Stub final AppWindowToken aToken = token.asAppWindowToken(); if (type == TYPE_APPLICATION_STARTING && aToken != null) { aToken.startingWindow = win; - if (DEBUG_STARTING_WINDOW) Slog.v (TAG_WM, "addWindow: " + aToken - + " startingWindow=" + win); + ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "addWindow: %s startingWindow=%s", + aToken, win); } boolean imMayMove = true; @@ -1607,7 +1617,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 @@ -1692,10 +1702,9 @@ public class WindowManagerService extends IWindowManager.Stub } displayContent.getInputMonitor().updateInputWindowsLw(false /*force*/); - if (DEBUG || DEBUG_ADD_REMOVE) { - Slog.v(TAG_WM, "addWindow: New client " + client.asBinder() - + ": window=" + win + " Callers=" + Debug.getCallers(5)); - } + ProtoLog.v(WM_DEBUG_ADD_REMOVE, "addWindow: New client %s" + + ": window=%s Callers=%s", client.asBinder(), win, Debug.getCallers(5)); + if (win.isVisibleOrAdding() && displayContent.updateOrientation()) { displayContent.sendNewConfiguration(); @@ -1858,7 +1867,7 @@ public class WindowManagerService extends IWindowManager.Stub * forgetting to add the wiring when a new parent of WindowState is added. */ void postWindowRemoveCleanupLocked(WindowState win) { - if (DEBUG_ADD_REMOVE) Slog.v(TAG_WM, "postWindowRemoveCleanupLocked: " + win); + ProtoLog.v(WM_DEBUG_ADD_REMOVE, "postWindowRemoveCleanupLocked: %s", win); mWindowMap.remove(win.mClient.asBinder()); final DisplayContent dc = win.getDisplayContent(); @@ -1873,7 +1882,7 @@ public class WindowManagerService extends IWindowManager.Stub mResizingWindows.remove(win); updateNonSystemOverlayWindowsVisibilityIfNeeded(win, false /* surfaceShown */); mWindowsChanged = true; - if (DEBUG_WINDOW_MOVEMENT) Slog.v(TAG_WM, "Final remove of window: " + win); + ProtoLog.v(WM_DEBUG_WINDOW_MOVEMENT, "Final remove of window: %s", win); final DisplayContent displayContent = win.getDisplayContent(); if (displayContent.mInputMethodWindow == win) { @@ -1882,7 +1891,7 @@ public class WindowManagerService extends IWindowManager.Stub final WindowToken token = win.mToken; final AppWindowToken atoken = win.mAppToken; - if (DEBUG_ADD_REMOVE) Slog.v(TAG_WM, "Removing " + win + " from " + token); + ProtoLog.v(WM_DEBUG_ADD_REMOVE, "Removing %s from %s", win, token); // Window will already be removed from token before this post clean-up method is called. if (token.isEmpty()) { if (!token.mPersistOnEmpty) { @@ -1942,11 +1951,6 @@ 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) { @@ -1961,8 +1965,8 @@ public class WindowManagerService extends IWindowManager.Stub try { synchronized (mGlobalLock) { WindowState w = windowForClientLocked(session, client, false); - if (SHOW_TRANSACTIONS) WindowManagerService.logSurface(w, - "transparentRegionHint=" + region, false); + ProtoLog.i(WM_SHOW_TRANSACTIONS, "SURFACE transparentRegionHint=%s: %s", + region, w); if ((w != null) && w.mHasSurface) { w.mWinAnimator.setTransparentRegionHintLocked(region); @@ -2186,12 +2190,10 @@ public class WindowManagerService extends IWindowManager.Stub win.mInRelayout = true; win.mViewVisibility = viewVisibility; - if (DEBUG_SCREEN_ON) { - RuntimeException stack = new RuntimeException(); - stack.fillInStackTrace(); - Slog.i(TAG_WM, "Relayout " + win + ": oldVis=" + oldVisibility - + " newVis=" + viewVisibility, stack); - } + ProtoLog.i(WM_DEBUG_SCREEN_ON, + "Relayout %s: oldVis=%d newVis=%d. %s", win, oldVisibility, + viewVisibility, new RuntimeException().fillInStackTrace()); + win.setDisplayLayoutNeeded(); win.mGivenInsetsPending = (flags & WindowManagerGlobal.RELAYOUT_INSETS_PENDING) != 0; @@ -2236,9 +2238,9 @@ public class WindowManagerService extends IWindowManager.Stub } catch (Exception e) { displayContent.getInputMonitor().updateInputWindowsLw(true /*force*/); - Slog.w(TAG_WM, "Exception thrown when creating surface for client " - + client + " (" + win.mAttrs.getTitle() + ")", - e); + ProtoLog.w(WM_ERROR, + "Exception thrown when creating surface for client %s (%s). %s", + client, win.mAttrs.getTitle(), e); Binder.restoreCallingIdentity(origId); return 0; } @@ -2362,21 +2364,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); } - if (DEBUG || DEBUG_FOCUS) { - Slog.v(TAG_WM, "Relayout of " + win + ": focusMayChange=" + focusMayChange); - } + ProtoLog.v(WM_DEBUG_FOCUS, "Relayout of %s: focusMayChange=%b", + win, 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; @@ -2454,11 +2456,12 @@ public class WindowManagerService extends IWindowManager.Stub } if (surfaceController != null) { surfaceController.getSurfaceControl(outSurfaceControl); - if (SHOW_TRANSACTIONS) Slog.i(TAG_WM, " OUT SURFACE " + outSurfaceControl + ": copied"); + ProtoLog.i(WM_SHOW_TRANSACTIONS, "OUT SURFACE %s: copied", outSurfaceControl); + } else { // For some reason there isn't a surface. Clear the // caller's object so they see the same state. - Slog.w(TAG_WM, "Failed to create surface control for " + win); + ProtoLog.w(WM_ERROR, "Failed to create surface control for %s", win); outSurfaceControl.release(); } @@ -2487,8 +2490,8 @@ public class WindowManagerService extends IWindowManager.Stub try { synchronized (mGlobalLock) { WindowState win = windowForClientLocked(session, client, false); - if (DEBUG_ADD_REMOVE) Slog.d(TAG_WM, "finishDrawingWindow: " + win + " mDrawState=" - + (win != null ? win.mWinAnimator.drawStateToString() : "null")); + ProtoLog.d(WM_DEBUG_ADD_REMOVE, "finishDrawingWindow: %s mDrawState=%s", + win, (win != null ? win.mWinAnimator.drawStateToString() : "null")); if (win != null && win.mWinAnimator.finishDrawingLocked(postDrawTransaction)) { if ((win.mAttrs.flags & FLAG_SHOW_WALLPAPER) != 0) { win.getDisplayContent().pendingLayoutChanges |= @@ -2513,9 +2516,8 @@ public class WindowManagerService extends IWindowManager.Stub == PackageManager.PERMISSION_GRANTED) { return true; } - final String msg = "Permission Denial: " + func + " from pid=" + Binder.getCallingPid() - + ", uid=" + Binder.getCallingUid() + " requires " + permission; - Slog.w(TAG_WM, msg); + ProtoLog.w(WM_ERROR, "Permission Denial: %s from pid=%d, uid=%d requires %s", + func, Binder.getCallingPid(), Binder.getCallingUid(), permission); return false; } @@ -2528,16 +2530,16 @@ public class WindowManagerService extends IWindowManager.Stub synchronized (mGlobalLock) { final DisplayContent dc = getDisplayContentOrCreate(displayId, null /* token */); if (dc == null) { - Slog.w(TAG_WM, "addWindowToken: Attempted to add token: " + binder - + " for non-exiting displayId=" + displayId); + ProtoLog.w(WM_ERROR, "addWindowToken: Attempted to add token: %s" + + " for non-exiting displayId=%d", binder, displayId); return; } WindowToken token = dc.getWindowToken(binder); if (token != null) { - Slog.w(TAG_WM, "addWindowToken: Attempted to add binder token: " + binder - + " for already created window token: " + token - + " displayId=" + displayId); + ProtoLog.w(WM_ERROR, "addWindowToken: Attempted to add binder token: %s" + + " for already created window token: %s" + + " displayId=%d", binder, token, displayId); return; } if (type == TYPE_WALLPAPER) { @@ -2560,15 +2562,16 @@ public class WindowManagerService extends IWindowManager.Stub synchronized (mGlobalLock) { final DisplayContent dc = mRoot.getDisplayContent(displayId); if (dc == null) { - Slog.w(TAG_WM, "removeWindowToken: Attempted to remove token: " + binder - + " for non-exiting displayId=" + displayId); + ProtoLog.w(WM_ERROR, "removeWindowToken: Attempted to remove token: %s" + + " for non-exiting displayId=%d", binder, displayId); return; } final WindowToken token = dc.removeWindowToken(binder); if (token == null) { - Slog.w(TAG_WM, - "removeWindowToken: Attempted to remove non-existing token: " + binder); + ProtoLog.w(WM_ERROR, + "removeWindowToken: Attempted to remove non-existing token: %s", + binder); return; } @@ -3208,14 +3211,11 @@ public class WindowManagerService extends IWindowManager.Stub public void enableScreenAfterBoot() { synchronized (mGlobalLock) { - if (DEBUG_BOOT) { - RuntimeException here = new RuntimeException("here"); - here.fillInStackTrace(); - Slog.i(TAG_WM, "enableScreenAfterBoot: mDisplayEnabled=" + mDisplayEnabled - + " mForceDisplayEnabled=" + mForceDisplayEnabled - + " mShowingBootMessages=" + mShowingBootMessages - + " mSystemBooted=" + mSystemBooted, here); - } + ProtoLog.i(WM_DEBUG_BOOT, "enableScreenAfterBoot: mDisplayEnabled=%b " + + "mForceDisplayEnabled=%b mShowingBootMessages=%b mSystemBooted=%b. " + + "%s", + mDisplayEnabled, mForceDisplayEnabled, mShowingBootMessages, mSystemBooted, + new RuntimeException("here").fillInStackTrace()); if (mSystemBooted) { return; } @@ -3239,14 +3239,11 @@ public class WindowManagerService extends IWindowManager.Stub } void enableScreenIfNeededLocked() { - if (DEBUG_BOOT) { - RuntimeException here = new RuntimeException("here"); - here.fillInStackTrace(); - Slog.i(TAG_WM, "enableScreenIfNeededLocked: mDisplayEnabled=" + mDisplayEnabled - + " mForceDisplayEnabled=" + mForceDisplayEnabled - + " mShowingBootMessages=" + mShowingBootMessages - + " mSystemBooted=" + mSystemBooted, here); - } + ProtoLog.i(WM_DEBUG_BOOT, "enableScreenIfNeededLocked: mDisplayEnabled=%b " + + "mForceDisplayEnabled=%b mShowingBootMessages=%b mSystemBooted=%b. " + + "%s", + mDisplayEnabled, mForceDisplayEnabled, mShowingBootMessages, mSystemBooted, + new RuntimeException("here").fillInStackTrace()); if (mDisplayEnabled) { return; } @@ -3261,7 +3258,7 @@ public class WindowManagerService extends IWindowManager.Stub if (mDisplayEnabled) { return; } - Slog.w(TAG_WM, "***** BOOT TIMEOUT: forcing display enabled"); + ProtoLog.w(WM_ERROR, "***** BOOT TIMEOUT: forcing display enabled"); mForceDisplayEnabled = true; } performEnableScreen(); @@ -3276,11 +3273,10 @@ public class WindowManagerService extends IWindowManager.Stub private void performEnableScreen() { synchronized (mGlobalLock) { - if (DEBUG_BOOT) Slog.i(TAG_WM, "performEnableScreen: mDisplayEnabled=" + mDisplayEnabled - + " mForceDisplayEnabled=" + mForceDisplayEnabled - + " mShowingBootMessages=" + mShowingBootMessages - + " mSystemBooted=" + mSystemBooted - + " mOnlyCore=" + mOnlyCore, + ProtoLog.i(WM_DEBUG_BOOT, "performEnableScreen: mDisplayEnabled=%b" + + " mForceDisplayEnabled=%b" + " mShowingBootMessages=%b" + + " mSystemBooted=%b mOnlyCore=%b. %s", mDisplayEnabled, + mForceDisplayEnabled, mShowingBootMessages, mSystemBooted, mOnlyCore, new RuntimeException("here").fillInStackTrace()); if (mDisplayEnabled) { return; @@ -3310,14 +3306,14 @@ public class WindowManagerService extends IWindowManager.Stub } if (!mForceDisplayEnabled && !checkBootAnimationCompleteLocked()) { - if (DEBUG_BOOT) Slog.i(TAG_WM, "performEnableScreen: Waiting for anim complete"); + ProtoLog.i(WM_DEBUG_BOOT, "performEnableScreen: Waiting for anim complete"); return; } try { IBinder surfaceFlinger = ServiceManager.getService("SurfaceFlinger"); if (surfaceFlinger != null) { - Slog.i(TAG_WM, "******* TELLING SURFACE FLINGER WE ARE BOOTED!"); + ProtoLog.i(WM_ERROR, "******* TELLING SURFACE FLINGER WE ARE BOOTED!"); Parcel data = Parcel.obtain(); data.writeInterfaceToken("android.ui.ISurfaceComposer"); surfaceFlinger.transact(IBinder.FIRST_CALL_TRANSACTION, // BOOT_FINISHED @@ -3325,13 +3321,13 @@ public class WindowManagerService extends IWindowManager.Stub data.recycle(); } } catch (RemoteException ex) { - Slog.e(TAG_WM, "Boot completed: SurfaceFlinger is dead!"); + ProtoLog.e(WM_ERROR, "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; - if (DEBUG_SCREEN_ON || DEBUG_BOOT) Slog.i(TAG_WM, "******************** ENABLING SCREEN!"); + ProtoLog.i(WM_DEBUG_SCREEN_ON, "******************** ENABLING SCREEN!"); // Enable input dispatch. mInputManagerCallback.setEventDispatchingLw(mEventDispatchingEnabled); @@ -3353,24 +3349,21 @@ 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); - if (DEBUG_BOOT) Slog.i(TAG_WM, "checkBootAnimationComplete: Waiting for anim complete"); + ProtoLog.i(WM_DEBUG_BOOT, "checkBootAnimationComplete: Waiting for anim complete"); return false; } - if (DEBUG_BOOT) Slog.i(TAG_WM, "checkBootAnimationComplete: Animation complete!"); + ProtoLog.i(WM_DEBUG_BOOT, "checkBootAnimationComplete: Animation complete!"); return true; } public void showBootMessage(final CharSequence msg, final boolean always) { boolean first = false; synchronized (mGlobalLock) { - 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); - } + 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 (!mAllowBootMessages) { return; } @@ -3392,14 +3385,11 @@ public class WindowManagerService extends IWindowManager.Stub } public void hideBootMessagesLocked() { - if (DEBUG_BOOT) { - RuntimeException here = new RuntimeException("here"); - here.fillInStackTrace(); - Slog.i(TAG_WM, "hideBootMessagesLocked: mDisplayEnabled=" + mDisplayEnabled - + " mForceDisplayEnabled=" + mForceDisplayEnabled - + " mShowingBootMessages=" + mShowingBootMessages - + " mSystemBooted=" + mSystemBooted, here); - } + ProtoLog.i(WM_DEBUG_BOOT, "hideBootMessagesLocked: mDisplayEnabled=%b" + + " mForceDisplayEnabled=%b mShowingBootMessages=%b" + + " mSystemBooted=%b. %s", mDisplayEnabled, mForceDisplayEnabled, + mShowingBootMessages, mSystemBooted, + new RuntimeException("here").fillInStackTrace()); if (mShowingBootMessages) { mShowingBootMessages = false; mPolicy.hideBootMessages(); @@ -3691,8 +3681,7 @@ public class WindowManagerService extends IWindowManager.Stub throw new SecurityException("Requires SET_ORIENTATION permission"); } - if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "thawRotation: mRotation=" - + getDefaultDisplayRotation()); + ProtoLog.v(WM_DEBUG_ORIENTATION, "thawRotation: mRotation=%d", getDefaultDisplayRotation()); long origId = Binder.clearCallingIdentity(); try { @@ -3741,9 +3730,9 @@ public class WindowManagerService extends IWindowManager.Stub } private void updateRotationUnchecked(boolean alwaysSendConfiguration, boolean forceRelayout) { - if(DEBUG_ORIENTATION) Slog.v(TAG_WM, "updateRotationUnchecked:" - + " alwaysSendConfiguration=" + alwaysSendConfiguration - + " forceRelayout=" + forceRelayout); + ProtoLog.v(WM_DEBUG_ORIENTATION, "updateRotationUnchecked:" + + " alwaysSendConfiguration=%b forceRelayout=%b", + alwaysSendConfiguration, forceRelayout); Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "updateRotation"); @@ -3992,7 +3981,7 @@ public class WindowManagerService extends IWindowManager.Stub try { return mViewServer.start(); } catch (IOException e) { - Slog.w(TAG_WM, "View server did not start"); + ProtoLog.w(WM_ERROR, "View server did not start"); } } return false; @@ -4002,7 +3991,7 @@ public class WindowManagerService extends IWindowManager.Stub mViewServer = new ViewServer(this, port); return mViewServer.start(); } catch (IOException e) { - Slog.w(TAG_WM, "View server did not start"); + ProtoLog.w(WM_ERROR, "View server did not start"); } return false; } @@ -4232,7 +4221,8 @@ public class WindowManagerService extends IWindowManager.Stub } } catch (Exception e) { - Slog.w(TAG_WM, "Could not send command " + command + " with parameters " + parameters, e); + ProtoLog.w(WM_ERROR, "Could not send command %s with parameters %s. %s", command, + parameters, e); success = false; } finally { if (data != null) { @@ -4381,9 +4371,9 @@ public class WindowManagerService extends IWindowManager.Stub public boolean detectSafeMode() { if (!mInputManagerCallback.waitForInputDevicesReady( 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."); + 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); } if (Settings.Global.getInt( @@ -4411,14 +4401,14 @@ public class WindowManagerService extends IWindowManager.Stub } catch (IllegalArgumentException e) { } if (mSafeMode) { - Log.i(TAG_WM, "SAFE MODE ENABLED (menu=" + menuState + " s=" + sState - + " dpad=" + dpadState + " trackball=" + trackballState + ")"); + ProtoLog.i(WM_ERROR, "SAFE MODE ENABLED (menu=%d s=%d dpad=%d" + + " trackball=%d)", menuState, sState, dpadState, 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 { - Log.i(TAG_WM, "SAFE MODE not enabled"); + ProtoLog.i(WM_ERROR, "SAFE MODE not enabled"); } mPolicy.setSafeMode(mSafeMode); return mSafeMode; @@ -4577,10 +4567,11 @@ public class WindowManagerService extends IWindowManager.Stub return; } displayContent.mLastFocus = newFocus; - if (DEBUG_FOCUS_LIGHT) Slog.i(TAG_WM, "Focus moving from " + lastFocus + - " to " + newFocus + " displayId=" + displayContent.getDisplayId()); + ProtoLog.i(WM_DEBUG_FOCUS_LIGHT, "Focus moving from %s" + + " to %s displayId=%d", lastFocus, newFocus, + displayContent.getDisplayId()); if (newFocus != null && lastFocus != null && !newFocus.isDisplayedLw()) { - if (DEBUG_FOCUS_LIGHT) Slog.i(TAG_WM, "Delaying loss of focus..."); + ProtoLog.i(WM_DEBUG_FOCUS_LIGHT, "Delaying loss of focus..."); displayContent.mLosingFocus.add(lastFocus); lastFocus = null; } @@ -4594,13 +4585,13 @@ public class WindowManagerService extends IWindowManager.Stub } if (newFocus != null) { - if (DEBUG_FOCUS_LIGHT) Slog.i(TAG_WM, "Gaining focus: " + newFocus); + ProtoLog.i(WM_DEBUG_FOCUS_LIGHT, "Gaining focus: %s", newFocus); newFocus.reportFocusChangedSerialized(true, mInTouchMode); notifyFocusChanged(); } if (lastFocus != null) { - if (DEBUG_FOCUS_LIGHT) Slog.i(TAG_WM, "Losing focus: " + lastFocus); + ProtoLog.i(WM_DEBUG_FOCUS_LIGHT, "Losing focus: %s", lastFocus); lastFocus.reportFocusChangedSerialized(false, mInTouchMode); } break; @@ -4617,7 +4608,7 @@ public class WindowManagerService extends IWindowManager.Stub final int N = losers.size(); for (int i = 0; i < N; i++) { - if (DEBUG_FOCUS_LIGHT) Slog.i(TAG_WM, "Losing delayed focus: " + + ProtoLog.i(WM_DEBUG_FOCUS_LIGHT, "Losing delayed focus: %s", losers.get(i)); losers.get(i).reportFocusChangedSerialized(false, mInTouchMode); } @@ -4700,9 +4691,9 @@ public class WindowManagerService extends IWindowManager.Stub case APP_FREEZE_TIMEOUT: { synchronized (mGlobalLock) { - Slog.w(TAG_WM, "App freeze timeout expired."); + ProtoLog.w(WM_ERROR, "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(); } } @@ -4743,7 +4734,8 @@ public class WindowManagerService extends IWindowManager.Stub case WAITING_FOR_DRAWN_TIMEOUT: { Runnable callback = null; synchronized (mGlobalLock) { - Slog.w(TAG_WM, "Timeout waiting for drawn: undrawn=" + mWaitingForDrawn); + ProtoLog.w(WM_ERROR, "Timeout waiting for drawn: undrawn=%s", + mWaitingForDrawn); mWaitingForDrawn.clear(); callback = mWaitingForDrawnCallback; mWaitingForDrawnCallback = null; @@ -4817,7 +4809,7 @@ public class WindowManagerService extends IWindowManager.Stub case CHECK_IF_BOOT_ANIMATION_FINISHED: { final boolean bootAnimationComplete; synchronized (mGlobalLock) { - if (DEBUG_BOOT) Slog.i(TAG_WM, "CHECK_IF_BOOT_ANIMATION_FINISHED:"); + ProtoLog.i(WM_DEBUG_BOOT, "CHECK_IF_BOOT_ANIMATION_FINISHED:"); bootAnimationComplete = checkBootAnimationCompleteLocked(); } if (bootAnimationComplete) { @@ -5031,10 +5023,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) { - Slog.i(TAG_WM, "FORCED DISPLAY SIZE: " + width + "x" + height); + ProtoLog.i(WM_ERROR, "FORCED DISPLAY SIZE: %dx%d", width, height); displayContent.updateBaseDisplayMetrics(width, height, displayContent.mBaseDisplayDensity); changed = true; @@ -5055,7 +5047,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)) { - Slog.i(TAG_WM, "FORCED DISPLAY SCALING DISABLED"); + ProtoLog.i(WM_ERROR, "FORCED DISPLAY SCALING DISABLED"); displayContent.mDisplayScalingDisabled = true; changed = true; } @@ -5235,7 +5227,7 @@ public class WindowManagerService extends IWindowManager.Stub throw new IllegalArgumentException( "Requested window " + client + " does not exist"); } - Slog.w(TAG_WM, "Failed looking up window callers=" + Debug.getCallers(3)); + ProtoLog.w(WM_ERROR, "Failed looking up window callers=%s", Debug.getCallers(3)); return null; } if (session != null && win.mSession != session) { @@ -5243,7 +5235,7 @@ public class WindowManagerService extends IWindowManager.Stub throw new IllegalArgumentException("Requested window " + client + " is in session " + win.mSession + ", not " + session); } - Slog.w(TAG_WM, "Failed looking up window callers=" + Debug.getCallers(3)); + ProtoLog.w(WM_ERROR, "Failed looking up window callers=%s", Debug.getCallers(3)); return null; } @@ -5255,7 +5247,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) { - if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Changing surface while display frozen: " + w); + ProtoLog.v(WM_DEBUG_ORIENTATION, "Changing surface while display frozen: %s", w); w.setOrientationChanging(true); w.mLastFreezeDuration = 0; mRoot.mOrientationChangeComplete = false; @@ -5275,22 +5267,22 @@ public class WindowManagerService extends IWindowManager.Stub } for (int j = mWaitingForDrawn.size() - 1; j >= 0; j--) { WindowState win = mWaitingForDrawn.get(j); - 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); + 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 (win.mRemoved || !win.mHasSurface || !win.isVisibleByPolicy()) { // Window has been removed or hidden; no draw will now happen, so stop waiting. - if (DEBUG_SCREEN_ON) Slog.w(TAG_WM, "Aborted waiting for drawn: " + win); + ProtoLog.w(WM_DEBUG_SCREEN_ON, "Aborted waiting for drawn: %s", win); mWaitingForDrawn.remove(win); } else if (win.hasDrawnLw()) { // Window is now drawn (and shown). - if (DEBUG_SCREEN_ON) Slog.d(TAG_WM, "Window drawn win=" + win); + ProtoLog.d(WM_DEBUG_SCREEN_ON, "Window drawn win=%s", win); mWaitingForDrawn.remove(win); } } if (mWaitingForDrawn.isEmpty()) { - if (DEBUG_SCREEN_ON) Slog.d(TAG_WM, "All windows drawn!"); + ProtoLog.d(WM_DEBUG_SCREEN_ON, "All windows drawn!"); mH.removeMessages(H.WAITING_FOR_DRAWN_TIMEOUT); mH.sendEmptyMessage(H.ALL_WINDOWS_DRAWN); } @@ -5307,19 +5299,15 @@ public class WindowManagerService extends IWindowManager.Stub final boolean state = mHoldingScreenWakeLock.isHeld(); if (hold != state) { if (hold) { - if (DEBUG_KEEP_SCREEN_ON) { - Slog.d(TAG_KEEP_SCREEN_ON, "Acquiring screen wakelock due to " - + mRoot.mHoldScreenWindow); - } + ProtoLog.d(WM_DEBUG_KEEP_SCREEN_ON, "Acquiring screen wakelock due to %s", + mRoot.mHoldScreenWindow); mLastWakeLockHoldingWindow = mRoot.mHoldScreenWindow; mLastWakeLockObscuringWindow = null; mHoldingScreenWakeLock.acquire(); mPolicy.keepScreenOnStartedLw(); } else { - if (DEBUG_KEEP_SCREEN_ON) { - Slog.d(TAG_KEEP_SCREEN_ON, "Releasing screen wakelock, obscured by " - + mRoot.mObscuringWindow); - } + ProtoLog.d(WM_DEBUG_KEEP_SCREEN_ON, "Releasing screen wakelock, obscured by %s", + mRoot.mObscuringWindow); mLastWakeLockHoldingWindow = null; mLastWakeLockObscuringWindow = mRoot.mObscuringWindow; mPolicy.keepScreenOnStoppedLw(); @@ -5363,10 +5351,9 @@ public class WindowManagerService extends IWindowManager.Stub return; } - if (DEBUG_ORIENTATION) Slog.d(TAG_WM, - "startFreezingDisplayLocked: exitAnim=" - + exitAnim + " enterAnim=" + enterAnim - + " called by " + Debug.getCallers(8)); + ProtoLog.d(WM_DEBUG_ORIENTATION, + "startFreezingDisplayLocked: exitAnim=%d enterAnim=%d called by %s", + exitAnim, enterAnim, Debug.getCallers(8)); mScreenFrozenLock.acquire(); mDisplayFrozen = true; @@ -5418,17 +5405,17 @@ public class WindowManagerService extends IWindowManager.Stub if (waitingForConfig || mAppsFreezingScreen > 0 || mWindowsFreezingScreen == WINDOWS_FREEZING_SCREENS_ACTIVE || mClientFreezingScreen || numOpeningApps > 0) { - if (DEBUG_ORIENTATION) Slog.d(TAG_WM, - "stopFreezingDisplayLocked: Returning mWaitingForConfig=" + waitingForConfig - + ", mAppsFreezingScreen=" + mAppsFreezingScreen - + ", mWindowsFreezingScreen=" + mWindowsFreezingScreen - + ", mClientFreezingScreen=" + mClientFreezingScreen - + ", mOpeningApps.size()=" + numOpeningApps); + ProtoLog.d(WM_DEBUG_ORIENTATION, + "stopFreezingDisplayLocked: Returning mWaitingForConfig=%b, " + + "mAppsFreezingScreen=%d, mWindowsFreezingScreen=%d, " + + "mClientFreezingScreen=%b, mOpeningApps.size()=%d", + waitingForConfig, mAppsFreezingScreen, mWindowsFreezingScreen, + mClientFreezingScreen, numOpeningApps); return; } - if (DEBUG_ORIENTATION) Slog.d(TAG_WM, - "stopFreezingDisplayLocked: Unfreezing now"); + ProtoLog.d(WM_DEBUG_ORIENTATION, + "stopFreezingDisplayLocked: Unfreezing now"); // We must make a local copy of the displayId as it can be potentially overwritten later on @@ -5446,7 +5433,7 @@ public class WindowManagerService extends IWindowManager.Stub sb.append(" due to "); sb.append(mLastFinishedFreezeSource); } - Slog.i(TAG_WM, sb.toString()); + ProtoLog.i(WM_ERROR, "%s", sb.toString()); mH.removeMessages(H.APP_FREEZE_TIMEOUT); mH.removeMessages(H.CLIENT_FREEZE_TIMEOUT); if (PROFILE_ORIENTATION) { @@ -5458,7 +5445,7 @@ public class WindowManagerService extends IWindowManager.Stub ScreenRotationAnimation screenRotationAnimation = displayContent == null ? null : displayContent.getRotationAnimation(); if (screenRotationAnimation != null && screenRotationAnimation.hasScreenshot()) { - if (DEBUG_ORIENTATION) Slog.i(TAG_WM, "**** Dismissing screen rotation animation"); + ProtoLog.i(WM_DEBUG_ORIENTATION, "**** Dismissing screen rotation animation"); DisplayInfo displayInfo = displayContent.getDisplayInfo(); // Get rotation animation again, with new top window if (!displayContent.getDisplayRotation().validateRotationAnimation( @@ -5501,7 +5488,7 @@ public class WindowManagerService extends IWindowManager.Stub mScreenFrozenLock.release(); if (updateRotation && displayContent != null) { - if (DEBUG_ORIENTATION) Slog.d(TAG_WM, "Performing post-rotate rotation"); + ProtoLog.d(WM_DEBUG_ORIENTATION, "Performing post-rotate rotation"); configChanged |= displayContent.updateRotationUnchecked(); } @@ -6314,17 +6301,20 @@ 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) { - Slog.w(TAG_WM, "Attempted to set replacing window on non-existing app token " + token); + ProtoLog.w(WM_ERROR, "Attempted to set replacing window on non-existing app token %s", + token); return; } if (!appWindowToken.hasContentToDisplay()) { - Slog.w(TAG_WM, "Attempted to set replacing window on app token with no content" - + token); + ProtoLog.w(WM_ERROR, + "Attempted to set replacing window on app token with no content %s", + token); return; } appWindowToken.setWillReplaceWindows(animate); @@ -6346,13 +6336,15 @@ public class WindowManagerService extends IWindowManager.Stub synchronized (mGlobalLock) { final AppWindowToken appWindowToken = mRoot.getAppWindowToken(token); if (appWindowToken == null) { - Slog.w(TAG_WM, "Attempted to set replacing window on non-existing app token " - + token); + ProtoLog.w(WM_ERROR, + "Attempted to set replacing window on non-existing app token %s", + token); return; } if (!appWindowToken.hasContentToDisplay()) { - Slog.w(TAG_WM, "Attempted to set replacing window on app token with no content" - + token); + ProtoLog.w(WM_ERROR, + "Attempted to set replacing window on app token with no content %s", + token); return; } @@ -6372,14 +6364,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) { - Slog.w(TAG_WM, "Attempted to reset replacing window on non-existing app token " - + token); + ProtoLog.w(WM_ERROR, "Attempted to reset replacing window on non-existing app token %s", + token); return; } if (replacing) { @@ -6568,7 +6560,7 @@ public class WindowManagerService extends IWindowManager.Stub } WindowState callingWin = windowForClientLocked(null, client, false); if (callingWin == null) { - Slog.w(TAG_WM, "Bad requesting window " + client); + ProtoLog.w(WM_ERROR, "Bad requesting window %s", client); return; } final DisplayContent displayContent = callingWin.getDisplayContent(); @@ -6585,7 +6577,7 @@ public class WindowManagerService extends IWindowManager.Stub windowUnderPointer.translateToWindowX(mouseX), windowUnderPointer.translateToWindowY(mouseY)); } catch (RemoteException e) { - Slog.w(TAG_WM, "unable to update pointer icon"); + ProtoLog.w(WM_ERROR, "unable to update pointer icon"); } } } @@ -6602,7 +6594,7 @@ public class WindowManagerService extends IWindowManager.Stub windowUnderPointer.translateToWindowX(latestX), windowUnderPointer.translateToWindowY(latestY)); } catch (RemoteException e) { - Slog.w(TAG_WM, "unable to restore pointer icon"); + ProtoLog.w(WM_ERROR, "unable to restore pointer icon"); } } else { InputManager.getInstance().setPointerIconType(PointerIcon.TYPE_DEFAULT); @@ -6632,7 +6624,7 @@ public class WindowManagerService extends IWindowManager.Stub try { final WindowState win = windowForClientLocked(null, client, false); if (win == null) { - Slog.w(TAG_WM, "Bad requesting window " + client); + ProtoLog.w(WM_ERROR, "Bad requesting window %s", client); return; } getDisplayContentOrCreate(displayId, null).reparentDisplayContent(win, sc); @@ -6657,7 +6649,7 @@ public class WindowManagerService extends IWindowManager.Stub try { final WindowState win = windowForClientLocked(null, client, false); if (win == null) { - Slog.w(TAG_WM, "Bad requesting window " + client); + ProtoLog.w(WM_ERROR, "Bad requesting window %s", client); return; } final DisplayContent displayContent = mRoot.getDisplayContent(displayId); @@ -6684,7 +6676,7 @@ public class WindowManagerService extends IWindowManager.Stub synchronized (mGlobalLock) { final WindowState callingWin = windowForClientLocked(null, client, false); if (callingWin == null) { - Slog.w(TAG_WM, "Bad requesting window " + client); + ProtoLog.w(WM_ERROR, "Bad requesting window %s", client); return; } callingWin.updateTapExcludeRegion(regionId, region); @@ -6723,8 +6715,9 @@ public class WindowManagerService extends IWindowManager.Stub synchronized (mGlobalLock) { final DisplayContent displayContent = mRoot.getDisplayContent(displayId); if (displayContent == null) { - Slog.w(TAG_WM, "Attempted to get windowing mode of a display that does not exist: " - + displayId); + ProtoLog.w(WM_ERROR, + "Attempted to get windowing mode of a display that does not exist: %d", + displayId); return WindowConfiguration.WINDOWING_MODE_UNDEFINED; } return mDisplayWindowSettings.getWindowingModeLocked(displayContent); @@ -6740,8 +6733,9 @@ public class WindowManagerService extends IWindowManager.Stub synchronized (mGlobalLock) { final DisplayContent displayContent = getDisplayContentOrCreate(displayId, null); if (displayContent == null) { - Slog.w(TAG_WM, "Attempted to set windowing mode to a display that does not exist: " - + displayId); + ProtoLog.w(WM_ERROR, + "Attempted to set windowing mode to a display that does not exist: %d", + displayId); return; } @@ -6776,8 +6770,9 @@ public class WindowManagerService extends IWindowManager.Stub synchronized (mGlobalLock) { final DisplayContent displayContent = mRoot.getDisplayContent(displayId); if (displayContent == null) { - Slog.w(TAG_WM, "Attempted to get remove mode of a display that does not exist: " - + displayId); + ProtoLog.w(WM_ERROR, + "Attempted to get remove mode of a display that does not exist: %d", + displayId); return REMOVE_CONTENT_MODE_UNDEFINED; } return mDisplayWindowSettings.getRemoveContentModeLocked(displayContent); @@ -6793,8 +6788,9 @@ public class WindowManagerService extends IWindowManager.Stub synchronized (mGlobalLock) { final DisplayContent displayContent = getDisplayContentOrCreate(displayId, null); if (displayContent == null) { - Slog.w(TAG_WM, "Attempted to set remove mode to a display that does not exist: " - + displayId); + ProtoLog.w(WM_ERROR, + "Attempted to set remove mode to a display that does not exist: %d", + displayId); return; } @@ -6813,8 +6809,8 @@ public class WindowManagerService extends IWindowManager.Stub synchronized (mGlobalLock) { final DisplayContent displayContent = mRoot.getDisplayContent(displayId); if (displayContent == null) { - Slog.w(TAG_WM, "Attempted to get flag of a display that does not exist: " - + displayId); + ProtoLog.w(WM_ERROR, "Attempted to get flag of a display that does not exist: %d", + displayId); return false; } return mDisplayWindowSettings.shouldShowWithInsecureKeyguardLocked(displayContent); @@ -6831,8 +6827,8 @@ public class WindowManagerService extends IWindowManager.Stub synchronized (mGlobalLock) { final DisplayContent displayContent = getDisplayContentOrCreate(displayId, null); if (displayContent == null) { - Slog.w(TAG_WM, "Attempted to set flag to a display that does not exist: " - + displayId); + ProtoLog.w(WM_ERROR, "Attempted to set flag to a display that does not exist: %d", + displayId); return; } @@ -6852,8 +6848,8 @@ public class WindowManagerService extends IWindowManager.Stub synchronized (mGlobalLock) { final DisplayContent displayContent = mRoot.getDisplayContent(displayId); if (displayContent == null) { - Slog.w(TAG_WM, "Attempted to get system decors flag of a display that does " - + "not exist: " + displayId); + ProtoLog.w(WM_ERROR, "Attempted to get system decors flag of a display that does " + + "not exist: %d", displayId); return false; } if (displayContent.isUntrustedVirtualDisplay()) { @@ -6872,8 +6868,8 @@ public class WindowManagerService extends IWindowManager.Stub synchronized (mGlobalLock) { final DisplayContent displayContent = getDisplayContentOrCreate(displayId, null); if (displayContent == null) { - Slog.w(TAG_WM, "Attempted to set system decors flag to a display that does " - + "not exist: " + displayId); + ProtoLog.w(WM_ERROR, "Attempted to set system decors flag to a display that does " + + "not exist: %d", displayId); return; } if (displayContent.isUntrustedVirtualDisplay()) { @@ -6896,8 +6892,9 @@ public class WindowManagerService extends IWindowManager.Stub synchronized (mGlobalLock) { final DisplayContent displayContent = mRoot.getDisplayContent(displayId); if (displayContent == null) { - Slog.w(TAG_WM, "Attempted to get IME flag of a display that does not exist: " - + displayId); + ProtoLog.w(WM_ERROR, + "Attempted to get IME flag of a display that does not exist: %d", + displayId); return false; } if (displayContent.isUntrustedVirtualDisplay()) { @@ -6917,8 +6914,9 @@ public class WindowManagerService extends IWindowManager.Stub synchronized (mGlobalLock) { final DisplayContent displayContent = getDisplayContentOrCreate(displayId, null); if (displayContent == null) { - Slog.w(TAG_WM, "Attempted to set IME flag to a display that does not exist: " - + displayId); + ProtoLog.w(WM_ERROR, + "Attempted to set IME flag to a display that does not exist: %d", + displayId); return; } if (displayContent.isUntrustedVirtualDisplay()) { @@ -7135,15 +7133,16 @@ public class WindowManagerService extends IWindowManager.Stub if (removeWindows) { final DisplayContent dc = mRoot.getDisplayContent(displayId); if (dc == null) { - Slog.w(TAG_WM, "removeWindowToken: Attempted to remove token: " + binder - + " for non-exiting displayId=" + displayId); + ProtoLog.w(WM_ERROR, "removeWindowToken: Attempted to remove token: %s" + + " for non-exiting displayId=%d", binder, displayId); return; } final WindowToken token = dc.removeWindowToken(binder); if (token == null) { - Slog.w(TAG_WM, "removeWindowToken: Attempted to remove non-existing token: " - + binder); + ProtoLog.w(WM_ERROR, + "removeWindowToken: Attempted to remove non-existing token: %s", + 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 0a65e324088510f8cb37686a574de16c5a48de07..2974bbb1aacfdc82a7624105b457b004822237cd 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,6 +206,7 @@ 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; @@ -781,7 +782,7 @@ class WindowState extends WindowContainer implements WindowManagerP mSubLayer = mPolicy.getSubWindowLayerFromTypeLw(a.type); mIsChildWindow = true; - if (DEBUG_ADD_REMOVE) Slog.v(TAG, "Adding " + this + " to " + parentWindow); + ProtoLog.v(WM_DEBUG_ADD_REMOVE, "Adding %s to %s", this, parentWindow); parentWindow.addChild(this, sWindowSubLayerComparator); mLayoutAttached = mAttrs.type != @@ -1294,14 +1295,11 @@ class WindowState extends WindowContainer implements WindowManagerP || 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); - } + 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 it's a dead window left on screen, and the configuration changed, there is nothing // we can do about it. Remove the window now. @@ -1318,24 +1316,31 @@ class WindowState extends WindowContainer 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 (DEBUG_ANIM || DEBUG_ORIENTATION || DEBUG_RESIZE) { - Slog.v(TAG_WM, "Orientation or resize start waiting for draw" + if (getOrientationChanging()) { + Slog.v(TAG_WM, "Orientation 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)) { - if (DEBUG_RESIZE || DEBUG_ORIENTATION) Slog.v(TAG_WM, "Resizing window " + this); + ProtoLog.v(WM_DEBUG_RESIZE, "Resizing window %s", this); mWmService.mResizingWindows.add(this); } } else if (getOrientationChanging()) { if (isDrawnLw()) { - if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "Orientation not waiting for draw in " - + this + ", surfaceController " + winAnimator.mSurfaceController); + ProtoLog.v(WM_DEBUG_ORIENTATION, + "Orientation not waiting for draw in %s, surfaceController %s", this, + winAnimator.mSurfaceController); setOrientationChanging(false); mLastFreezeDuration = (int)(SystemClock.elapsedRealtime() - mWmService.mDisplayFreezeTime); @@ -1705,7 +1710,7 @@ class WindowState extends WindowContainer implements WindowManagerP @Override void onMovedByResize() { - if (DEBUG_RESIZE) Slog.d(TAG, "onMovedByResize: Moving " + this); + ProtoLog.d(WM_DEBUG_RESIZE, "onMovedByResize: Moving %s", this); mMovedByResize = true; super.onMovedByResize(); } @@ -1779,7 +1784,7 @@ class WindowState extends WindowContainer implements WindowManagerP void onResize() { final ArrayList resizingWindows = mWmService.mResizingWindows; if (mHasSurface && !isGoneForLayoutLw() && !resizingWindows.contains(this)) { - if (DEBUG_RESIZE) Slog.d(TAG, "onResize: Resizing " + this); + ProtoLog.d(WM_DEBUG_RESIZE, "onResize: Resizing %s", this); resizingWindows.add(this); } if (isGoneForLayoutLw()) { @@ -1922,8 +1927,8 @@ class WindowState extends WindowContainer implements WindowManagerP if (mRemoved) { // Nothing to do. - if (DEBUG_ADD_REMOVE) Slog.v(TAG_WM, - "WS.removeImmediately: " + this + " Already removed..."); + ProtoLog.v(WM_DEBUG_ADD_REMOVE, + "WS.removeImmediately: %s Already removed...", this); return; } @@ -1973,39 +1978,35 @@ class WindowState extends WindowContainer implements WindowManagerP private void removeIfPossible(boolean keepVisibleDeadWindow) { mWindowRemovalAllowed = true; - if (DEBUG_ADD_REMOVE) Slog.v(TAG, - "removeIfPossible: " + this + " callers=" + Debug.getCallers(5)); + ProtoLog.v(WM_DEBUG_ADD_REMOVE, + "removeIfPossible: %s callers=%s", this, Debug.getCallers(5)); final boolean startingWindow = mAttrs.type == TYPE_APPLICATION_STARTING; - 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)); + 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)); + + final long origId = Binder.clearCallingIdentity(); try { disposeInputChannel(); - 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)); + 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)); // Visibility of the removed window. Will be used later to update orientation later on. boolean wasVisible = false; @@ -2017,8 +2018,8 @@ class WindowState extends WindowContainer 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. - if (DEBUG_ADD_REMOVE) Slog.v(TAG_WM, - "Preserving " + this + " until the new one is " + "added"); + ProtoLog.v(WM_DEBUG_ADD_REMOVE, + "Preserving %s until the new one is added", this); // 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 @@ -2032,8 +2033,8 @@ class WindowState extends WindowContainer implements WindowManagerP wasVisible = isWinVisibleLw(); if (keepVisibleDeadWindow) { - if (DEBUG_ADD_REMOVE) Slog.v(TAG_WM, - "Not removing " + this + " because app died while it's visible"); + ProtoLog.v(WM_DEBUG_ADD_REMOVE, + "Not removing %s because app died while it's visible", this); mAppDied = true; setDisplayLayoutNeeded(); @@ -2074,8 +2075,8 @@ class WindowState extends WindowContainer implements WindowManagerP if (mWinAnimator.getShown() && mAnimatingExit && (!lastWindowIsStartingWindow || isAnimating)) { // The exit animation is running or should run... wait for it! - if (DEBUG_ADD_REMOVE) Slog.v(TAG_WM, - "Not removing " + this + " due to exit animation "); + ProtoLog.v(WM_DEBUG_ADD_REMOVE, + "Not removing %s due to exit animation", this); setupWindowForRemoveOnExit(); if (mAppToken != null) { mAppToken.updateReportedVisibilityLocked(); @@ -2242,7 +2243,7 @@ class WindowState extends WindowContainer implements WindowManagerP } private void removeReplacedWindow() { - if (DEBUG_ADD_REMOVE) Slog.d(TAG, "Removing replaced window: " + this); + ProtoLog.d(WM_DEBUG_ADD_REMOVE, "Removing replaced window: %s", this); mWillReplaceWindow = false; mAnimateReplacingWindow = false; mReplacingRemoveRequested = false; @@ -2398,7 +2399,7 @@ class WindowState extends WindowContainer implements WindowManagerP if (!isVisibleByPolicy()) { mWinAnimator.hide("checkPolicyVisibilityChange"); if (isFocused()) { - if (DEBUG_FOCUS_LIGHT) Slog.i(TAG, + ProtoLog.i(WM_DEBUG_FOCUS_LIGHT, "setAnimationLocked: setting mFocusMayChange true"); mWmService.mFocusMayChange = true; } @@ -2721,7 +2722,7 @@ class WindowState extends WindowContainer implements WindowManagerP // we allow the display to be enabled now. mWmService.enableScreenIfNeededLocked(); if (isFocused) { - if (DEBUG_FOCUS_LIGHT) Slog.i(TAG, + ProtoLog.i(WM_DEBUG_FOCUS_LIGHT, "WindowState.hideLw: setting mFocusMayChange true"); mWmService.mFocusMayChange = true; } @@ -2927,7 +2928,8 @@ class WindowState extends WindowContainer implements WindowManagerP if (mHasSurface && !getOrientationChanging() && mWmService.mWindowsFreezingScreen != WINDOWS_FREEZING_SCREENS_TIMEOUT) { - if (DEBUG_ORIENTATION) Slog.v(TAG_WM, "set mOrientationChanging of " + this); + ProtoLog.v(WM_DEBUG_ORIENTATION, + "set mOrientationChanging of %s", this); setOrientationChanging(true); mWmService.mRoot.mOrientationChangeComplete = false; } @@ -2955,10 +2957,11 @@ class WindowState extends WindowContainer implements WindowManagerP } if (mDestroying) { - if (DEBUG_ADD_REMOVE) Slog.e(TAG_WM, "win=" + this - + " destroySurfaces: appStopped=" + appStopped - + " win.mWindowRemovalAllowed=" + mWindowRemovalAllowed - + " win.mRemoveOnExit=" + mRemoveOnExit); + ProtoLog.e(WM_DEBUG_ADD_REMOVE, "win=%s" + + " destroySurfaces: appStopped=%b" + + " win.mWindowRemovalAllowed=%b" + + " win.mRemoveOnExit=%b", this, appStopped, + mWindowRemovalAllowed, mRemoveOnExit); if (!cleanupOnResume || mRemoveOnExit) { destroySurfaceUnchecked(); } @@ -3226,16 +3229,19 @@ class WindowState extends WindowContainer implements WindowManagerP void reportResized() { Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "wm.reportResized_" + getWindowTag()); try { - if (DEBUG_RESIZE || DEBUG_ORIENTATION) Slog.v(TAG, "Reporting new frame to " + this - + ": " + mWindowFrames.mCompatFrame); + ProtoLog.v(WM_DEBUG_RESIZE, + "Reporting new frame to %s: %s", this, + mWindowFrames.mCompatFrame); final MergedConfiguration mergedConfiguration = new MergedConfiguration(mWmService.mRoot.getConfiguration(), getMergedOverrideConfiguration()); setLastReportedMergedConfiguration(mergedConfiguration); - if (DEBUG_ORIENTATION && mWinAnimator.mDrawState == DRAW_PENDING) - Slog.i(TAG, "Resizing " + this + " WITH DRAW PENDING"); + if (mWinAnimator.mDrawState == DRAW_PENDING) { + ProtoLog.i(WM_DEBUG_ORIENTATION, + "Resizing %s WITH DRAW PENDING", this); + } final Rect frame = mWindowFrames.mCompatFrame; final Rect overscanInsets = mWindowFrames.mLastOverscanInsets; @@ -4378,9 +4384,8 @@ class WindowState extends WindowContainer implements WindowManagerP return; } - if (DEBUG || DEBUG_ADD_REMOVE) { - Slog.v(TAG, "Exit animation finished in " + this + ": remove=" + mRemoveOnExit); - } + ProtoLog.v(WM_DEBUG_ADD_REMOVE, "Exit animation finished in %s: remove=%b", + this, 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 8fccc8d02d6fbe567287ef4ea8748f58a20b1f8b..3dcf6ecb5124fa1d99fe5aea8a64e75d66268ee5 100644 --- a/services/core/java/com/android/server/wm/WindowStateAnimator.java +++ b/services/core/java/com/android/server/wm/WindowStateAnimator.java @@ -27,17 +27,18 @@ 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; @@ -67,6 +68,7 @@ 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; @@ -312,19 +314,19 @@ class WindowStateAnimator { boolean finishDrawingLocked(SurfaceControl.Transaction postDrawTransaction) { final boolean startingWindow = mWin.mAttrs.type == WindowManager.LayoutParams.TYPE_APPLICATION_STARTING; - if (DEBUG_STARTING_WINDOW && startingWindow) { - Slog.v(TAG, "Finishing drawing window " + mWin + ": mDrawState=" - + drawStateToString()); + if (startingWindow) { + ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Finishing drawing window %s: mDrawState=%s", + mWin, drawStateToString()); } boolean layoutNeeded = false; if (mDrawState == DRAW_PENDING) { - 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); + 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); } mDrawState = COMMIT_DRAW_PENDING; layoutNeeded = true; @@ -385,7 +387,7 @@ class WindowStateAnimator { mSurfaceDestroyDeferred = true; return; } - if (SHOW_TRANSACTIONS) WindowManagerService.logSurface(mWin, "SET FREEZE LAYER", false); + ProtoLog.i(WM_SHOW_TRANSACTIONS, "SURFACE SET FREEZE LAYER: %s", mWin); 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 @@ -456,8 +458,9 @@ class WindowStateAnimator { w.setHasSurface(false); - if (DEBUG_ANIM || DEBUG_ORIENTATION) Slog.i(TAG, - "createSurface " + this + ": mDrawState=DRAW_PENDING"); + if (DEBUG_ANIM) { + Slog.i(TAG, "createSurface " + this + ": mDrawState=DRAW_PENDING"); + } resetDrawState(); @@ -514,15 +517,10 @@ class WindowStateAnimator { w.setHasSurface(true); - 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); - } + 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); } catch (OutOfResourcesException e) { Slog.w(TAG, "OutOfResourcesException creating surface"); mService.mRoot.reclaimSomeSurfaceMemory(this, "create", true); @@ -616,17 +614,15 @@ class WindowStateAnimator { if (mSurfaceDestroyDeferred) { if (mSurfaceController != null && mPendingDestroySurface != mSurfaceController) { if (mPendingDestroySurface != null) { - if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) { - WindowManagerService.logSurface(mWin, "DESTROY PENDING", true); - } + ProtoLog.i(WM_SHOW_SURFACE_ALLOC, "SURFACE DESTROY PENDING: %s. %s", + mWin, new RuntimeException().fillInStackTrace()); mPendingDestroySurface.destroyNotInTransaction(); } mPendingDestroySurface = mSurfaceController; } } else { - if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) { - WindowManagerService.logSurface(mWin, "DESTROY", true); - } + ProtoLog.i(WM_SHOW_SURFACE_ALLOC, "SURFACE DESTROY: %s. %s", + mWin, new RuntimeException().fillInStackTrace()); destroySurface(); } // Don't hide wallpaper if we're deferring the surface destroy @@ -653,9 +649,8 @@ class WindowStateAnimator { void destroyDeferredSurfaceLocked() { try { if (mPendingDestroySurface != null) { - if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) { - WindowManagerService.logSurface(mWin, "DESTROY PENDING", true); - } + ProtoLog.i(WM_SHOW_SURFACE_ALLOC, "SURFACE DESTROY PENDING: %s. %s", + mWin, new RuntimeException().fillInStackTrace()); mPendingDestroySurface.destroyNotInTransaction(); // Don't hide wallpaper if we're destroying a deferred surface // after a surface mode change. @@ -1088,9 +1083,7 @@ 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()) { - if (DEBUG_ORIENTATION) { - Slog.v(TAG, "Orientation change skips hidden " + w); - } + ProtoLog.v(WM_DEBUG_ORIENTATION, "Orientation change skips hidden %s", w); w.setOrientationChanging(false); } return; @@ -1115,8 +1108,8 @@ class WindowStateAnimator { // before it has drawn for the new orientation. if (w.getOrientationChanging() && w.isGoneForLayoutLw()) { w.setOrientationChanging(false); - if (DEBUG_ORIENTATION) Slog.v(TAG, - "Orientation change skips hidden " + w); + ProtoLog.v(WM_DEBUG_ORIENTATION, + "Orientation change skips hidden %s", w); } } else if (mLastAlpha != mShownAlpha || mLastDsDx != mDsDx @@ -1134,13 +1127,10 @@ class WindowStateAnimator { mLastDtDy = mDtDy; w.mLastHScale = w.mHScale; w.mLastVScale = w.mVScale; - if (SHOW_TRANSACTIONS) WindowManagerService.logSurface(w, - "controller=" + mSurfaceController + - "alpha=" + mShownAlpha - + " matrix=[" + mDsDx + "*" + w.mHScale - + "," + mDtDx + "*" + w.mVScale - + "][" + mDtDy + "*" + w.mHScale - + "," + mDsDy + "*" + w.mVScale + "]", false); + 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); boolean prepared = mSurfaceController.prepareToShowInTransaction(mShownAlpha, @@ -1190,11 +1180,11 @@ class WindowStateAnimator { if (!w.isDrawnLw()) { mAnimator.mBulkUpdateParams &= ~SET_ORIENTATION_CHANGE_COMPLETE; mAnimator.mLastWindowFreezeSource = w; - if (DEBUG_ORIENTATION) Slog.v(TAG, - "Orientation continue waiting for draw in " + w); + ProtoLog.v(WM_DEBUG_ORIENTATION, + "Orientation continue waiting for draw in %s", w); } else { w.setOrientationChanging(false); - if (DEBUG_ORIENTATION) Slog.v(TAG, "Orientation change complete in " + w); + ProtoLog.v(WM_DEBUG_ORIENTATION, "Orientation change complete in %s", w); } } diff --git a/services/core/java/com/android/server/wm/WindowSurfaceController.java b/services/core/java/com/android/server/wm/WindowSurfaceController.java index 6d813d106345f56eba038fcde346632eb09e40f0..49f27a1b495db5a79776ed211d3444ebf3a8d065 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,6 +40,8 @@ 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 { @@ -111,31 +113,22 @@ 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) { - if (SHOW_TRANSACTIONS) Slog.i(TAG, "REPARENT from: " + this + " to: " + other); + ProtoLog.i(WM_SHOW_TRANSACTIONS, "REPARENT from: %s to: %s", this, other); if ((mSurfaceControl != null) && (other.mSurfaceControl != null)) { mSurfaceControl.reparentChildren(other.mSurfaceControl); } } void detachChildren() { - if (SHOW_TRANSACTIONS) Slog.i(TAG, "SEVER CHILDREN"); + ProtoLog.i(WM_SHOW_TRANSACTIONS, "SEVER CHILDREN"); if (mSurfaceControl != null) { mSurfaceControl.detachChildren(); } } void hide(SurfaceControl.Transaction transaction, String reason) { - if (SHOW_TRANSACTIONS) logSurface("HIDE ( " + reason + " )", null); + ProtoLog.i(WM_SHOW_TRANSACTIONS, "SURFACE HIDE ( %s ): %s", reason, title); mHiddenForOtherReasons = true; mAnimator.destroyPreservedSurfaceLocked(); @@ -157,9 +150,8 @@ class WindowSurfaceController { } void destroyNotInTransaction() { - if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) { - Slog.i(TAG, "Destroying surface " + this + " called by " + Debug.getCallers(8)); - } + ProtoLog.i(WM_SHOW_SURFACE_ALLOC, + "Destroying surface %s called by %s", this, Debug.getCallers(8)); try { if (mSurfaceControl != null) { mTmpTransaction.remove(mSurfaceControl).apply(); @@ -173,8 +165,7 @@ class WindowSurfaceController { } void setCropInTransaction(Rect clipRect, boolean recoveringMemory) { - if (SHOW_TRANSACTIONS) logSurface( - "CROP " + clipRect.toShortString(), null); + ProtoLog.i(WM_SHOW_TRANSACTIONS, "SURFACE CROP %s: %s", clipRect.toShortString(), title); try { if (clipRect.width() > 0 && clipRect.height() > 0) { if (!clipRect.equals(mSurfaceCrop)) { @@ -198,8 +189,7 @@ class WindowSurfaceController { } void clearCropInTransaction(boolean recoveringMemory) { - if (SHOW_TRANSACTIONS) logSurface( - "CLEAR CROP", null); + ProtoLog.i(WM_SHOW_TRANSACTIONS, "SURFACE CLEAR CROP: %s", title); try { Rect clipRect = new Rect(0, 0, -1, -1); if (mSurfaceCrop.equals(clipRect)) { @@ -227,8 +217,8 @@ class WindowSurfaceController { mSurfaceY = top; try { - if (SHOW_TRANSACTIONS) logSurface( - "POS (setPositionInTransaction) @ (" + left + "," + top + ")", null); + ProtoLog.i(WM_SHOW_TRANSACTIONS, + "SURFACE POS (setPositionInTransaction) @ (%f,%f): %s", left, top, title); if (t == null) { mSurfaceControl.setPosition(left, top); @@ -264,8 +254,8 @@ class WindowSurfaceController { mLastDsdy = dsdy; try { - if (SHOW_TRANSACTIONS) logSurface( - "MATRIX [" + dsdx + "," + dtdx + "," + dtdy + "," + dsdy + "]", null); + ProtoLog.i(WM_SHOW_TRANSACTIONS, "SURFACE MATRIX [%f,%f,%f,%f]: %s", + dsdx, dtdx, dtdy, dsdy, title); if (t == null) { mSurfaceControl.setMatrix(dsdx, dtdx, dtdy, dsdy); } else { @@ -290,8 +280,7 @@ class WindowSurfaceController { mSurfaceH = height; try { - if (SHOW_TRANSACTIONS) logSurface( - "SIZE " + width + "x" + height, null); + ProtoLog.i(WM_SHOW_TRANSACTIONS, "SURFACE SIZE %dx%d: %s", width, height, title); mSurfaceControl.setBufferSize(width, height); } catch (RuntimeException e) { // If something goes wrong with the surface (such @@ -350,8 +339,7 @@ class WindowSurfaceController { } void setOpaque(boolean isOpaque) { - if (SHOW_TRANSACTIONS) logSurface("isOpaque=" + isOpaque, - null); + ProtoLog.i(WM_SHOW_TRANSACTIONS, "SURFACE isOpaque=%b: %s", isOpaque, title); if (mSurfaceControl == null) { return; @@ -367,8 +355,7 @@ class WindowSurfaceController { } void setSecure(boolean isSecure) { - if (SHOW_TRANSACTIONS) logSurface("isSecure=" + isSecure, - null); + ProtoLog.i(WM_SHOW_TRANSACTIONS, "SURFACE isSecure=%b: %s", isSecure, title); if (mSurfaceControl == null) { return; @@ -384,9 +371,7 @@ class WindowSurfaceController { } void setColorSpaceAgnostic(boolean agnostic) { - if (SHOW_TRANSACTIONS) { - logSurface("isColorSpaceAgnostic=" + agnostic, null); - } + ProtoLog.i(WM_SHOW_TRANSACTIONS, "SURFACE isColorSpaceAgnostic=%b: %s", agnostic, title); if (mSurfaceControl == null) { return; @@ -410,8 +395,7 @@ class WindowSurfaceController { } boolean showRobustlyInTransaction() { - if (SHOW_TRANSACTIONS) logSurface( - "SHOW (performLayout)", null); + ProtoLog.i(WM_SHOW_TRANSACTIONS, "SURFACE SHOW (performLayout): %s", title); 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 8aee0f2a83086e470b524d8d69ef90f8f2c7be77..fbfb0286db1e12b20d21787c28cbcc9dc6d87eb1 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.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.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.TAG_WITH_CLASS_NAME; import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM; import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_NORMAL; @@ -35,9 +35,10 @@ 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; @@ -135,8 +136,8 @@ class WindowToken extends WindowContainer { void removeAllWindowsIfPossible() { for (int i = mChildren.size() - 1; i >= 0; --i) { final WindowState win = mChildren.get(i); - if (DEBUG_WINDOW_MOVEMENT) Slog.w(TAG_WM, - "removeAllWindowsIfPossible: removing win=" + win); + ProtoLog.w(WM_DEBUG_WINDOW_MOVEMENT, + "removeAllWindowsIfPossible: removing win=%s", win); win.removeIfPossible(); } } @@ -197,15 +198,15 @@ class WindowToken extends WindowContainer { } void addWindow(final WindowState win) { - if (DEBUG_FOCUS) Slog.d(TAG_WM, - "addWindow: win=" + win + " Callers=" + Debug.getCallers(5)); + ProtoLog.d(WM_DEBUG_FOCUS, + "addWindow: win=%s Callers=%s", win, Debug.getCallers(5)); if (win.isChildWindow()) { // Child windows are added to their parent windows. return; } if (!mChildren.contains(win)) { - if (DEBUG_ADD_REMOVE) Slog.v(TAG_WM, "Adding " + win + " to " + this); + ProtoLog.v(WM_DEBUG_ADD_REMOVE, "Adding %s to %s", win, this); addChild(win, mWindowComparator); mWmService.mWindowsChanged = true; // TODO: Should we also be setting layout needed here and other places?