Merge "[Shell-Transition] clean-up some isAnimating call points" into tm-qpr-dev am: 45b540163a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19086047 Change-Id: I19ba26b0f40a0edc0076191db1214d751401a537 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -577,12 +577,6 @@
|
|||||||
"group": "WM_ERROR",
|
"group": "WM_ERROR",
|
||||||
"at": "com\/android\/server\/wm\/WindowManagerService.java"
|
"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": {
|
"-1517908912": {
|
||||||
"message": "requestScrollCapture: caught exception dispatching to window.token=%s",
|
"message": "requestScrollCapture: caught exception dispatching to window.token=%s",
|
||||||
"level": "WARN",
|
"level": "WARN",
|
||||||
@@ -1513,6 +1507,12 @@
|
|||||||
"group": "WM_DEBUG_FOCUS_LIGHT",
|
"group": "WM_DEBUG_FOCUS_LIGHT",
|
||||||
"at": "com\/android\/server\/wm\/DisplayContent.java"
|
"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": {
|
"-635082269": {
|
||||||
"message": "******** booted=%b msg=%b haveBoot=%b haveApp=%b haveWall=%b wallEnabled=%b haveKeyguard=%b",
|
"message": "******** booted=%b msg=%b haveBoot=%b haveApp=%b haveWall=%b wallEnabled=%b haveKeyguard=%b",
|
||||||
"level": "INFO",
|
"level": "INFO",
|
||||||
|
|||||||
@@ -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.WindowManagerDebugConfig.TAG_WM;
|
||||||
import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_NORMAL;
|
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.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.WindowState.LEGACY_POLICY_VISIBILITY;
|
||||||
import static com.android.server.wm.WindowStateAnimator.HAS_DRAWN;
|
import static com.android.server.wm.WindowStateAnimator.HAS_DRAWN;
|
||||||
|
|
||||||
@@ -3149,15 +3150,10 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
|||||||
mWillCloseOrEnterPip = willCloseOrEnterPip;
|
mWillCloseOrEnterPip = willCloseOrEnterPip;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
boolean willCloseOrEnterPip() {
|
||||||
* Returns whether this {@link ActivityRecord} is considered closing. Conditions are either
|
return mWillCloseOrEnterPip;
|
||||||
* 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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Whether AppOps allows this package to enter picture-in-picture.
|
* @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();
|
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++) {
|
for (int i = 0; i < windowsCount; i++) {
|
||||||
mChildren.get(i).onAppVisibilityChanged(visible, isAnimating(PARENTS,
|
mChildren.get(i).onAppVisibilityChanged(visible, runningAnimation);
|
||||||
ANIMATION_TYPE_APP_TRANSITION));
|
|
||||||
}
|
}
|
||||||
setVisible(visible);
|
setVisible(visible);
|
||||||
setVisibleRequested(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) {
|
if (!visible) {
|
||||||
stopFreezingScreen(true, true);
|
stopFreezingScreen(true, true);
|
||||||
} else {
|
} else {
|
||||||
@@ -5300,9 +5303,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
|||||||
task.dispatchTaskInfoChangedIfNeeded(false /* force */);
|
task.dispatchTaskInfoChangedIfNeeded(false /* force */);
|
||||||
task = task.getParent().asTask();
|
task = task.getParent().asTask();
|
||||||
}
|
}
|
||||||
ProtoLog.v(WM_DEBUG_APP_TRANSITIONS,
|
|
||||||
"commitVisibility: %s: visible=%b mVisibleRequested=%b", this,
|
|
||||||
isVisible(), mVisibleRequested);
|
|
||||||
final DisplayContent displayContent = getDisplayContent();
|
final DisplayContent displayContent = getDisplayContent();
|
||||||
displayContent.getInputMonitor().setUpdateInputWindowsNeededLw();
|
displayContent.getInputMonitor().setUpdateInputWindowsNeededLw();
|
||||||
if (performLayout) {
|
if (performLayout) {
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ final class ImeInsetsSourceProvider extends WindowContainerInsetsSourceProvider
|
|||||||
//
|
//
|
||||||
private static boolean isImeLayeringTarget(@NonNull InsetsControlTarget target,
|
private static boolean isImeLayeringTarget(@NonNull InsetsControlTarget target,
|
||||||
@NonNull InsetsControlTarget dcTarget) {
|
@NonNull InsetsControlTarget dcTarget) {
|
||||||
return !dcTarget.getWindow().isClosing() && target == dcTarget;
|
return !isImeTargetWindowClosing(dcTarget.getWindow()) && target == dcTarget;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isAboveImeLayeringTarget(@NonNull InsetsControlTarget target,
|
private static boolean isAboveImeLayeringTarget(@NonNull InsetsControlTarget target,
|
||||||
@@ -256,7 +256,14 @@ final class ImeInsetsSourceProvider extends WindowContainerInsetsSourceProvider
|
|||||||
final InsetsControlTarget target = mDisplayContent.getImeTarget(IME_TARGET_CONTROL);
|
final InsetsControlTarget target = mDisplayContent.getImeTarget(IME_TARGET_CONTROL);
|
||||||
return target == mImeRequester
|
return target == mImeRequester
|
||||||
&& (mImeRequester.getWindow() == null
|
&& (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) {
|
private boolean isTargetChangedWithinActivity(InsetsControlTarget target) {
|
||||||
|
|||||||
@@ -3461,10 +3461,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
|
|||||||
return mClient.asBinder().isBinderAlive();
|
return mClient.asBinder().isBinderAlive();
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isClosing() {
|
|
||||||
return mAnimatingExit || (mActivityRecord != null && mActivityRecord.isClosingOrEnteringPip());
|
|
||||||
}
|
|
||||||
|
|
||||||
void sendAppVisibilityToClients() {
|
void sendAppVisibilityToClients() {
|
||||||
super.sendAppVisibilityToClients();
|
super.sendAppVisibilityToClients();
|
||||||
|
|
||||||
|
|||||||
@@ -2118,7 +2118,6 @@ public class DisplayContentTests extends WindowTestsBase {
|
|||||||
final WindowState appWin2 = createWindow(null, TYPE_BASE_APPLICATION, act2, "appWin2");
|
final WindowState appWin2 = createWindow(null, TYPE_BASE_APPLICATION, act2, "appWin2");
|
||||||
appWin2.setHasSurface(true);
|
appWin2.setHasSurface(true);
|
||||||
assertTrue(appWin2.canBeImeTarget());
|
assertTrue(appWin2.canBeImeTarget());
|
||||||
doReturn(true).when(appWin1).isClosing();
|
|
||||||
doReturn(true).when(appWin1).inTransitionSelfOrParent();
|
doReturn(true).when(appWin1).inTransitionSelfOrParent();
|
||||||
|
|
||||||
// Test step 3: Verify appWin2 will be the next IME target and the IME snapshot surface will
|
// Test step 3: Verify appWin2 will be the next IME target and the IME snapshot surface will
|
||||||
|
|||||||
Reference in New Issue
Block a user