Merge "[Shell-Transition] clean-up some isAnimating call points" into tm-qpr-dev am: 45b540163a am: c20b2f0e40

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19086047

Change-Id: I4ef3143bb18a91341ce0b01482973fd6a2324f0a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
TreeHugger Robot
2022-07-11 20:13:24 +00:00
committed by Automerger Merge Worker
5 changed files with 28 additions and 26 deletions

View File

@@ -577,12 +577,6 @@
"group": "WM_ERROR",
"at": "com\/android\/server\/wm\/WindowManagerService.java"
},
"-1521427940": {
"message": "commitVisibility: %s: visible=%b mVisibleRequested=%b",
"level": "VERBOSE",
"group": "WM_DEBUG_APP_TRANSITIONS",
"at": "com\/android\/server\/wm\/ActivityRecord.java"
},
"-1517908912": {
"message": "requestScrollCapture: caught exception dispatching to window.token=%s",
"level": "WARN",
@@ -1519,6 +1513,12 @@
"group": "WM_DEBUG_FOCUS_LIGHT",
"at": "com\/android\/server\/wm\/DisplayContent.java"
},
"-636553602": {
"message": "commitVisibility: %s: visible=%b visibleRequested=%b, isInTransition=%b, runningAnimation=%b, caller=%s",
"level": "VERBOSE",
"group": "WM_DEBUG_APP_TRANSITIONS",
"at": "com\/android\/server\/wm\/ActivityRecord.java"
},
"-635082269": {
"message": "******** booted=%b msg=%b haveBoot=%b haveApp=%b haveWall=%b wallEnabled=%b haveKeyguard=%b",
"level": "INFO",

View File

@@ -224,6 +224,7 @@ import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_STARTING_WIND
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_NORMAL;
import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_WILL_PLACE_SURFACES;
import static com.android.server.wm.WindowManagerService.sEnableShellTransitions;
import static com.android.server.wm.WindowState.LEGACY_POLICY_VISIBILITY;
import static com.android.server.wm.WindowStateAnimator.HAS_DRAWN;
@@ -3149,15 +3150,10 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
mWillCloseOrEnterPip = willCloseOrEnterPip;
}
/**
* Returns whether this {@link ActivityRecord} is considered closing. Conditions are either
* 1. Is this app animating and was requested to be hidden
* 2. App is delayed closing since it might enter PIP.
*/
boolean isClosingOrEnteringPip() {
return (isAnimating(TRANSITION | PARENTS, ANIMATION_TYPE_APP_TRANSITION)
&& !mVisibleRequested) || mWillCloseOrEnterPip;
boolean willCloseOrEnterPip() {
return mWillCloseOrEnterPip;
}
/**
* @return Whether AppOps allows this package to enter picture-in-picture.
*/
@@ -5272,12 +5268,19 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
}
final int windowsCount = mChildren.size();
// With Shell-Transition, the activity will running a transition when it is visible.
// It won't be included when fromTransition is true means the call from finishTransition.
final boolean runningAnimation = sEnableShellTransitions ? visible
: isAnimating(PARENTS, ANIMATION_TYPE_APP_TRANSITION);
for (int i = 0; i < windowsCount; i++) {
mChildren.get(i).onAppVisibilityChanged(visible, isAnimating(PARENTS,
ANIMATION_TYPE_APP_TRANSITION));
mChildren.get(i).onAppVisibilityChanged(visible, runningAnimation);
}
setVisible(visible);
setVisibleRequested(visible);
ProtoLog.v(WM_DEBUG_APP_TRANSITIONS, "commitVisibility: %s: visible=%b"
+ " visibleRequested=%b, isInTransition=%b, runningAnimation=%b, caller=%s",
this, isVisible(), mVisibleRequested, isInTransition(), runningAnimation,
Debug.getCallers(5));
if (!visible) {
stopFreezingScreen(true, true);
} else {
@@ -5300,9 +5303,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
task.dispatchTaskInfoChangedIfNeeded(false /* force */);
task = task.getParent().asTask();
}
ProtoLog.v(WM_DEBUG_APP_TRANSITIONS,
"commitVisibility: %s: visible=%b mVisibleRequested=%b", this,
isVisible(), mVisibleRequested);
final DisplayContent displayContent = getDisplayContent();
displayContent.getInputMonitor().setUpdateInputWindowsNeededLw();
if (performLayout) {

View File

@@ -234,7 +234,7 @@ final class ImeInsetsSourceProvider extends WindowContainerInsetsSourceProvider
//
private static boolean isImeLayeringTarget(@NonNull InsetsControlTarget target,
@NonNull InsetsControlTarget dcTarget) {
return !dcTarget.getWindow().isClosing() && target == dcTarget;
return !isImeTargetWindowClosing(dcTarget.getWindow()) && target == dcTarget;
}
private static boolean isAboveImeLayeringTarget(@NonNull InsetsControlTarget target,
@@ -256,7 +256,14 @@ final class ImeInsetsSourceProvider extends WindowContainerInsetsSourceProvider
final InsetsControlTarget target = mDisplayContent.getImeTarget(IME_TARGET_CONTROL);
return target == mImeRequester
&& (mImeRequester.getWindow() == null
|| !mImeRequester.getWindow().isClosing());
|| !isImeTargetWindowClosing(mImeRequester.getWindow()));
}
private static boolean isImeTargetWindowClosing(@NonNull WindowState win) {
return win.mAnimatingExit || win.mActivityRecord != null
&& (win.mActivityRecord.isInTransition()
&& !win.mActivityRecord.isVisibleRequested()
|| win.mActivityRecord.willCloseOrEnterPip());
}
private boolean isTargetChangedWithinActivity(InsetsControlTarget target) {

View File

@@ -3461,10 +3461,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
return mClient.asBinder().isBinderAlive();
}
boolean isClosing() {
return mAnimatingExit || (mActivityRecord != null && mActivityRecord.isClosingOrEnteringPip());
}
void sendAppVisibilityToClients() {
super.sendAppVisibilityToClients();

View File

@@ -2118,7 +2118,6 @@ public class DisplayContentTests extends WindowTestsBase {
final WindowState appWin2 = createWindow(null, TYPE_BASE_APPLICATION, act2, "appWin2");
appWin2.setHasSurface(true);
assertTrue(appWin2.canBeImeTarget());
doReturn(true).when(appWin1).isClosing();
doReturn(true).when(appWin1).inTransitionSelfOrParent();
// Test step 3: Verify appWin2 will be the next IME target and the IME snapshot surface will