From d8bdc45e05bc0157d4930ad57b39df2a2d6f91b5 Mon Sep 17 00:00:00 2001 From: Riddle Hsu Date: Fri, 6 Dec 2019 21:36:32 +0800 Subject: [PATCH] Remove unused deferClearAllDrawn The flag was added in commit 7636dfb and the only read was removed in commit f5f9e12 (version P, 2 years ago). Also correct the dump format of activity record. Test: presubmit Bug: 139522754 Change-Id: Ie81bf5c758e1c537994ddded937c4ace10ef86ab --- .../com/android/server/wm/ActivityRecord.java | 25 +++++++------------ .../server/wm/AppTransitionController.java | 1 - .../server/wm/WindowStateAnimator.java | 4 --- .../com/android/server/wm/WindowToken.java | 5 ++-- 4 files changed, 12 insertions(+), 23 deletions(-) diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java index 5b7f3212719da..364528635ff6e 100644 --- a/services/core/java/com/android/server/wm/ActivityRecord.java +++ b/services/core/java/com/android/server/wm/ActivityRecord.java @@ -620,10 +620,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A // TODO: Make this final int mTargetSdk; - // Set to true when this app creates a surface while in the middle of an animation. In that - // case do not clear allDrawn until the animation completes. - boolean deferClearAllDrawn; - // Is this window's surface needed? This is almost like visible, except // it will sometimes be true a little earlier: when the activity record has // been shown, but is still waiting for its app transition to execute @@ -771,10 +767,10 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A pw.print(" primaryColor="); pw.println(Integer.toHexString(taskDescription.getPrimaryColor())); pw.print(prefix + " backgroundColor="); - pw.println(Integer.toHexString(taskDescription.getBackgroundColor())); - pw.print(prefix + " statusBarColor="); - pw.println(Integer.toHexString(taskDescription.getStatusBarColor())); - pw.print(prefix + " navigationBarColor="); + pw.print(Integer.toHexString(taskDescription.getBackgroundColor())); + pw.print(" statusBarColor="); + pw.print(Integer.toHexString(taskDescription.getStatusBarColor())); + pw.print(" navigationBarColor="); pw.println(Integer.toHexString(taskDescription.getNavigationBarColor())); } } @@ -847,14 +843,13 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A pw.println(requestedVrComponent); } super.dump(pw, prefix, dumpAll); - pw.print(" visible="); pw.print(mVisible); - if (appToken != null) { - pw.println(prefix + "app=true mVoiceInteraction=" + mVoiceInteraction); + if (mVoiceInteraction) { + pw.println(prefix + "mVoiceInteraction=true"); } - pw.print(prefix); pw.print(" mOccludesParent="); pw.print(mOccludesParent); + pw.print(prefix); pw.print("mOccludesParent="); pw.print(mOccludesParent); pw.print(" mOrientation="); pw.println(mOrientation); pw.println(prefix + "mVisibleRequested=" + mVisibleRequested - + " mClientVisible=" + mClientVisible + + " mVisible=" + mVisible + " mClientVisible=" + mClientVisible + ((mDeferHidingClient) ? " mDeferHidingClient=" + mDeferHidingClient : "") + " reportedDrawn=" + reportedDrawn + " reportedVisible=" + reportedVisible); if (paused) { @@ -901,7 +896,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A pw.println(prefix + "mRemovingFromDisplay=" + mRemovingFromDisplay); } if (lastVisibleTime != 0 || nowVisible) { - pw.print(prefix); pw.print(" nowVisible="); pw.print(nowVisible); + pw.print(prefix); pw.print("nowVisible="); pw.print(nowVisible); pw.print(" lastVisibleTime="); if (lastVisibleTime == 0) pw.print("0"); else TimeUtils.formatDuration(lastVisibleTime, now, pw); @@ -3234,7 +3229,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A // to move that animation to the new one. if (fromActivity.allDrawn) { allDrawn = true; - deferClearAllDrawn = fromActivity.deferClearAllDrawn; } if (fromActivity.firstWindowDrawn) { firstWindowDrawn = true; @@ -3718,7 +3712,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A void clearAllDrawn() { allDrawn = false; - deferClearAllDrawn = false; } /** diff --git a/services/core/java/com/android/server/wm/AppTransitionController.java b/services/core/java/com/android/server/wm/AppTransitionController.java index e9ad0d361b07c..d7f4b34ba56d6 100644 --- a/services/core/java/com/android/server/wm/AppTransitionController.java +++ b/services/core/java/com/android/server/wm/AppTransitionController.java @@ -389,7 +389,6 @@ public class AppTransitionController { // this guy's animations regardless of whether it's // gotten drawn. wtoken.allDrawn = true; - wtoken.deferClearAllDrawn = false; // Ensure that apps that are mid-starting are also scheduled to have their // starting windows removed after the animation is complete if (wtoken.startingWindow != null && !wtoken.startingWindow.mAnimatingExit) { diff --git a/services/core/java/com/android/server/wm/WindowStateAnimator.java b/services/core/java/com/android/server/wm/WindowStateAnimator.java index 94aff7bd86a77..cf2360784a327 100644 --- a/services/core/java/com/android/server/wm/WindowStateAnimator.java +++ b/services/core/java/com/android/server/wm/WindowStateAnimator.java @@ -439,10 +439,6 @@ class WindowStateAnimator { if (!mWin.mActivityRecord.isAnimating(TRANSITION)) { mWin.mActivityRecord.clearAllDrawn(); - } else { - // Currently animating, persist current state of allDrawn until animation - // is complete. - mWin.mActivityRecord.deferClearAllDrawn = true; } } diff --git a/services/core/java/com/android/server/wm/WindowToken.java b/services/core/java/com/android/server/wm/WindowToken.java index 287d7cd8a7588..2ee949685aac5 100644 --- a/services/core/java/com/android/server/wm/WindowToken.java +++ b/services/core/java/com/android/server/wm/WindowToken.java @@ -280,10 +280,11 @@ class WindowToken extends WindowContainer { super.dump(pw, prefix, dumpAll); pw.print(prefix); pw.print("windows="); pw.println(mChildren); pw.print(prefix); pw.print("windowType="); pw.print(windowType); - pw.print(" hasVisible="); pw.println(hasVisible); + pw.print(" hasVisible="); pw.print(hasVisible); if (waitingToShow) { - pw.print(prefix); pw.print("waitingToShow="); pw.print(waitingToShow); + pw.print(" waitingToShow=true"); } + pw.println(); } @Override