summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Riddle Hsu <riddlehsu@google.com> 2025-03-02 20:29:34 -0800
committer Android (Google) Code Review <android-gerrit@google.com> 2025-03-02 20:29:34 -0800
commit4d304a58bf4bcbed1a684e73e94da9bea11806dd (patch)
tree3f677200e5a1eb90db1c123a545a09854f1fcce6
parent7a3c826d311f98d8d3e0dc312957406305360aa0 (diff)
parent3c50c9df73fb1685854f46c223bd9cc59cbbc556 (diff)
Merge "Remove legacy prepareAppTransition and old type check" into main
-rw-r--r--services/core/java/com/android/server/policy/PhoneWindowManager.java6
-rw-r--r--services/core/java/com/android/server/policy/WindowManagerPolicy.java14
-rw-r--r--services/core/java/com/android/server/wm/ActivityClientController.java3
-rw-r--r--services/core/java/com/android/server/wm/ActivityStarter.java7
-rw-r--r--services/core/java/com/android/server/wm/DisplayContent.java33
-rw-r--r--services/core/java/com/android/server/wm/KeyguardController.java13
-rw-r--r--services/core/java/com/android/server/wm/WallpaperController.java45
-rw-r--r--services/core/java/com/android/server/wm/WindowManagerService.java44
-rw-r--r--services/core/java/com/android/server/wm/WindowOrganizerController.java11
9 files changed, 14 insertions, 162 deletions
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java
index f27194a7b792..22f20028eb9c 100644
--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -6706,12 +6706,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
return mKeyguardDelegate.isInputRestricted();
}
- /** {@inheritDoc} */
- @Override
- public boolean isKeyguardUnoccluding() {
- return keyguardOn() && !mWindowManagerFuncs.isAppTransitionStateIdle();
- }
-
@Override
public void dismissKeyguardLw(IKeyguardDismissCallback callback, CharSequence message) {
if (mKeyguardDelegate != null && mKeyguardDelegate.isShowing()) {
diff --git a/services/core/java/com/android/server/policy/WindowManagerPolicy.java b/services/core/java/com/android/server/policy/WindowManagerPolicy.java
index cc31bb17dc9d..d7de22edf8ce 100644
--- a/services/core/java/com/android/server/policy/WindowManagerPolicy.java
+++ b/services/core/java/com/android/server/policy/WindowManagerPolicy.java
@@ -337,12 +337,6 @@ public interface WindowManagerPolicy extends WindowManagerPolicyConstants {
void moveDisplayToTopIfAllowed(int displayId);
/**
- * Return whether the app transition state is idle.
- * @return {@code true} if app transition state is idle on the default display.
- */
- boolean isAppTransitionStateIdle();
-
- /**
* Enables the screen if all conditions are met.
*/
void enableScreenIfNeeded();
@@ -989,14 +983,6 @@ public interface WindowManagerPolicy extends WindowManagerPolicyConstants {
public boolean isKeyguardOccluded();
/**
- * Return whether the keyguard is unoccluding.
- * @return {@code true} if the keyguard is unoccluding.
- */
- default boolean isKeyguardUnoccluding() {
- return false;
- }
-
- /**
* @return true if in keyguard is on.
*/
boolean isKeyguardShowing();
diff --git a/services/core/java/com/android/server/wm/ActivityClientController.java b/services/core/java/com/android/server/wm/ActivityClientController.java
index 7ce52b101824..463a830c9e68 100644
--- a/services/core/java/com/android/server/wm/ActivityClientController.java
+++ b/services/core/java/com/android/server/wm/ActivityClientController.java
@@ -1510,9 +1510,6 @@ class ActivityClientController extends IActivityClientController.Stub {
synchronized (mGlobalLock) {
final ActivityRecord r = ActivityRecord.isInRootTaskLocked(token);
if (r != null && r.isState(RESUMED, PAUSING)) {
- r.mDisplayContent.mAppTransition.overridePendingAppTransition(
- packageName, enterAnim, exitAnim, backgroundColor, null, null,
- r.mOverrideTaskTransition);
r.mTransitionController.setOverrideAnimation(
TransitionInfo.AnimationOptions.makeCustomAnimOptions(packageName,
enterAnim, 0 /* changeResId */, exitAnim,
diff --git a/services/core/java/com/android/server/wm/ActivityStarter.java b/services/core/java/com/android/server/wm/ActivityStarter.java
index d463ed098d34..233f91385ca4 100644
--- a/services/core/java/com/android/server/wm/ActivityStarter.java
+++ b/services/core/java/com/android/server/wm/ActivityStarter.java
@@ -59,9 +59,7 @@ import static android.security.Flags.preventIntentRedirectAbortOrThrowException;
import static android.security.Flags.preventIntentRedirectShowToast;
import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.WindowManager.TRANSIT_FLAG_AVOID_MOVE_TO_FRONT;
-import static android.view.WindowManager.TRANSIT_NONE;
import static android.view.WindowManager.TRANSIT_OPEN;
-import static android.view.WindowManager.TRANSIT_TO_FRONT;
import static android.window.TaskFragmentOperation.OP_TYPE_START_ACTIVITY_IN_TASK_FRAGMENT;
import static com.android.internal.protolog.WmProtoLogGroups.WM_DEBUG_CONFIGURATION;
@@ -2558,11 +2556,6 @@ class ActivityStarter {
if (actuallyMoved) {
// Only record if the activity actually moved.
mMovedToTopActivity = act;
- if (mNoAnimation) {
- act.mDisplayContent.prepareAppTransition(TRANSIT_NONE);
- } else {
- act.mDisplayContent.prepareAppTransition(TRANSIT_TO_FRONT);
- }
}
act.updateOptionsLocked(mOptions);
deliverNewIntent(act, intentGrants);
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java
index 679fd0019ea8..e134e271f6dc 100644
--- a/services/core/java/com/android/server/wm/DisplayContent.java
+++ b/services/core/java/com/android/server/wm/DisplayContent.java
@@ -82,7 +82,6 @@ import static android.view.WindowManager.LayoutParams.TYPE_TOAST;
import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER;
import static android.view.WindowManager.REMOVE_CONTENT_MODE_DESTROY;
import static android.view.WindowManager.TRANSIT_CHANGE;
-import static android.view.WindowManager.TRANSIT_NONE;
import static android.view.WindowManager.TRANSIT_OPEN;
import static android.view.WindowManager.TRANSIT_TO_FRONT;
import static android.view.inputmethod.ImeTracker.DEBUG_IME_VISIBILITY;
@@ -5636,29 +5635,11 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
}
/**
- * @deprecated new transition should use {@link #requestTransitionAndLegacyPrepare(int, int)}
- */
- @Deprecated
- void prepareAppTransition(@WindowManager.TransitionType int transit) {
- prepareAppTransition(transit, 0 /* flags */);
- }
-
- /**
- * @deprecated new transition should use {@link #requestTransitionAndLegacyPrepare(int, int)}
- */
- @Deprecated
- void prepareAppTransition(@WindowManager.TransitionType int transit,
- @WindowManager.TransitionFlags int flags) {
- mAppTransition.prepareAppTransition(transit, flags);
- }
-
- /**
* Helper that both requests a transition (using the new transition system) and prepares
* the legacy transition system. Use this when both systems have the same start-point.
*
* @see TransitionController#requestTransitionIfNeeded(int, int, WindowContainer,
* WindowContainer)
- * @see AppTransition#prepareAppTransition
*/
void requestTransitionAndLegacyPrepare(@WindowManager.TransitionType int transit,
@WindowManager.TransitionFlags int flags, @Nullable WindowContainer trigger) {
@@ -6546,19 +6527,9 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
// If keyguard is not locked, the change of flags won't affect activity visibility.
return;
}
- // We might change the visibilities here, so prepare an empty app transition which might be
- // overridden later if we actually change visibilities.
- final boolean wasTransitionSet = mAppTransition.isTransitionSet();
- if (!wasTransitionSet) {
- prepareAppTransition(TRANSIT_NONE);
- }
mRootWindowContainer.ensureActivitiesVisible();
-
- // If there was a transition set already we don't want to interfere with it as we might be
- // starting it too early.
- if (!wasTransitionSet) {
- executeAppTransition();
- }
+ // In case there is a visibility change.
+ executeAppTransition();
}
/**
diff --git a/services/core/java/com/android/server/wm/KeyguardController.java b/services/core/java/com/android/server/wm/KeyguardController.java
index 4eeed5ec8423..ff1e400a4a23 100644
--- a/services/core/java/com/android/server/wm/KeyguardController.java
+++ b/services/core/java/com/android/server/wm/KeyguardController.java
@@ -28,7 +28,6 @@ import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_GOING_AWAY_TO_SHA
import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_GOING_AWAY_WITH_WALLPAPER;
import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_OCCLUDING;
import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_UNOCCLUDING;
-import static android.view.WindowManager.TRANSIT_KEYGUARD_GOING_AWAY;
import static android.view.WindowManager.TRANSIT_KEYGUARD_OCCLUDE;
import static android.view.WindowManager.TRANSIT_KEYGUARD_UNOCCLUDE;
import static android.view.WindowManager.TRANSIT_OPEN;
@@ -310,7 +309,6 @@ class KeyguardController {
state.writeEventLog("keyguardGoingAway");
final int transitFlags = convertTransitFlags(flags);
final DisplayContent dc = mRootWindowContainer.getDefaultDisplay();
- dc.prepareAppTransition(TRANSIT_KEYGUARD_GOING_AWAY, transitFlags);
// We are deprecating TRANSIT_KEYGUARD_GOING_AWAY for Shell transition and use
// TRANSIT_FLAG_KEYGUARD_GOING_AWAY to indicate that it should animate keyguard going
// away.
@@ -490,8 +488,6 @@ class KeyguardController {
if (trigger != null) {
transition.collect(trigger);
}
- } else {
- dc.prepareAppTransition(transitType, transitFlags);
}
} else {
if (tc.inTransition()) {
@@ -515,7 +511,6 @@ class KeyguardController {
private void handleDismissInsecureKeyguard(DisplayContent dc) {
mService.deferWindowLayout();
try {
- dc.prepareAppTransition(TRANSIT_KEYGUARD_GOING_AWAY, 0 /* transitFlags */);
// We are deprecating TRANSIT_KEYGUARD_GOING_AWAY for Shell transition and use
// TRANSIT_FLAG_KEYGUARD_GOING_AWAY to indicate that it should animate keyguard going
// away.
@@ -542,14 +537,6 @@ class KeyguardController {
mWindowManager.dismissKeyguard(null /* callback */, null /* message */);
final KeyguardDisplayState state = getDisplayState(displayId);
state.mDismissalRequested = true;
-
- // If we are about to unocclude the Keyguard, but we can dismiss it without security,
- // we immediately dismiss the Keyguard so the activity gets shown without a flicker.
- final DisplayContent dc = mRootWindowContainer.getDefaultDisplay();
- if (state.mKeyguardShowing && canDismissKeyguard()
- && dc.mAppTransition.containsTransitRequest(TRANSIT_KEYGUARD_UNOCCLUDE)) {
- mWindowManager.executeAppTransition();
- }
}
ActivityRecord getTopOccludingActivity(int displayId) {
diff --git a/services/core/java/com/android/server/wm/WallpaperController.java b/services/core/java/com/android/server/wm/WallpaperController.java
index 644417ec98e5..3a4d9d27f65a 100644
--- a/services/core/java/com/android/server/wm/WallpaperController.java
+++ b/services/core/java/com/android/server/wm/WallpaperController.java
@@ -21,7 +21,6 @@ import static android.app.WallpaperManager.COMMAND_UNFREEZE;
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
-import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_GOING_AWAY_WITH_WALLPAPER;
import static com.android.internal.protolog.WmProtoLogGroups.WM_DEBUG_WALLPAPER;
import static com.android.server.policy.WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
@@ -118,42 +117,20 @@ class WallpaperController {
private boolean mShouldOffsetWallpaperCenter;
private final ToBooleanFunction<WindowState> mFindWallpaperTargetFunction = w -> {
- final boolean useShellTransition = w.mTransitionController.isShellTransitionsEnabled();
- if (!useShellTransition) {
- if (w.mActivityRecord != null && !w.mActivityRecord.isVisible()
- && !w.mActivityRecord.isAnimating(TRANSITION | PARENTS)) {
- // If this window's app token is hidden and not animating, it is of no interest.
- if (DEBUG_WALLPAPER) Slog.v(TAG, "Skipping hidden and not animating token: " + w);
- return false;
- }
- } else {
- final ActivityRecord ar = w.mActivityRecord;
- // The animating window can still be visible on screen if it is in transition, so we
- // should check whether this window can be wallpaper target even when visibleRequested
- // is false.
- if (ar != null && !ar.isVisibleRequested() && !ar.isVisible()) {
- // An activity that is not going to remain visible shouldn't be the target.
- return false;
- }
+ final ActivityRecord ar = w.mActivityRecord;
+ // The animating window can still be visible on screen if it is in transition, so we
+ // should check whether this window can be wallpaper target even when visibleRequested
+ // is false.
+ if (ar != null && !ar.isVisibleRequested() && !ar.isVisible()) {
+ // An activity that is not going to remain visible shouldn't be the target.
+ return false;
}
if (DEBUG_WALLPAPER) Slog.v(TAG, "Win " + w + ": isOnScreen=" + w.isOnScreen()
+ " mDrawState=" + w.mWinAnimator.mDrawState);
- final WindowContainer animatingContainer = w.mActivityRecord != null
- ? w.mActivityRecord.getAnimatingContainer() : null;
- if (!useShellTransition && animatingContainer != null
- && animatingContainer.isAnimating(TRANSITION | PARENTS)
- && AppTransition.isKeyguardGoingAwayTransitOld(animatingContainer.mTransit)
- && (animatingContainer.mTransitFlags
- & TRANSIT_FLAG_KEYGUARD_GOING_AWAY_WITH_WALLPAPER) != 0) {
- // Keep the wallpaper visible when Keyguard is going away.
- mFindResults.setUseTopWallpaperAsTarget(true);
- }
-
if (mService.mPolicy.isKeyguardLocked()) {
if (w.canShowWhenLocked()) {
- if (mService.mPolicy.isKeyguardOccluded() || (useShellTransition
- ? w.inTransition() : mService.mPolicy.isKeyguardUnoccluding())) {
+ if (mService.mPolicy.isKeyguardOccluded() || w.inTransition()) {
// The lowest show-when-locked window decides whether to show wallpaper.
mFindResults.mNeedsShowWhenLockedWallpaper = !isFullscreen(w.mAttrs)
|| (w.mActivityRecord != null && !w.mActivityRecord.fillsParent());
@@ -176,15 +153,11 @@ class WallpaperController {
}
}
- final boolean animationWallpaper = animatingContainer != null
- && animatingContainer.getAnimation() != null
- && animatingContainer.getAnimation().getShowWallpaper();
- final boolean hasWallpaper = w.hasWallpaper() || animationWallpaper;
if (isBackNavigationTarget(w)) {
if (DEBUG_WALLPAPER) Slog.v(TAG, "Found back animation wallpaper target: " + w);
mFindResults.setWallpaperTarget(w);
return true;
- } else if (hasWallpaper
+ } else if (w.hasWallpaper()
&& (w.mActivityRecord != null ? w.isOnScreen() : w.isReadyForDisplay())) {
if (DEBUG_WALLPAPER) Slog.v(TAG, "Found wallpaper target: " + w);
mFindResults.setWallpaperTarget(w);
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index 71f69048f2cb..54f960973eff 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -17,7 +17,6 @@
package com.android.server.wm;
import static android.Manifest.permission.ACCESS_SURFACE_FLINGER;
-import static android.Manifest.permission.CONTROL_REMOTE_APP_TRANSITION_ANIMATIONS;
import static android.Manifest.permission.INPUT_CONSUMER;
import static android.Manifest.permission.INTERNAL_SYSTEM_WINDOW;
import static android.Manifest.permission.MANAGE_APP_TOKENS;
@@ -88,7 +87,6 @@ import static android.view.WindowManager.LayoutParams.TYPE_TOAST;
import static android.view.WindowManager.LayoutParams.TYPE_VOICE_INTERACTION;
import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER;
import static android.view.WindowManager.REMOVE_CONTENT_MODE_UNDEFINED;
-import static android.view.WindowManager.TRANSIT_NONE;
import static android.view.WindowManager.TRANSIT_OPEN;
import static android.view.WindowManager.TRANSIT_TO_FRONT;
import static android.view.WindowManager.fixScale;
@@ -3237,49 +3235,17 @@ public class WindowManagerService extends IWindowManager.Stub
}
}
- // TODO(multi-display): remove when no default display use case.
- void prepareAppTransitionNone() {
- if (!checkCallingPermission(MANAGE_APP_TOKENS, "prepareAppTransition()")) {
- throw new SecurityException("Requires MANAGE_APP_TOKENS permission");
- }
- getDefaultDisplayContentLocked().prepareAppTransition(TRANSIT_NONE);
- }
-
@Override
public void overridePendingAppTransitionMultiThumbFuture(
IAppTransitionAnimationSpecsFuture specsFuture, IRemoteCallback callback,
boolean scaleUp, int displayId) {
- synchronized (mGlobalLock) {
- final DisplayContent displayContent = mRoot.getDisplayContent(displayId);
- if (displayContent == null) {
- Slog.w(TAG, "Attempted to call overridePendingAppTransitionMultiThumbFuture"
- + " for the display " + displayId + " that does not exist.");
- return;
- }
- displayContent.mAppTransition.overridePendingAppTransitionMultiThumbFuture(specsFuture,
- callback, scaleUp);
- }
+ // TODO(b/365884835): remove this method and callers.
}
@Override
public void overridePendingAppTransitionRemote(RemoteAnimationAdapter remoteAnimationAdapter,
int displayId) {
- if (!checkCallingPermission(CONTROL_REMOTE_APP_TRANSITION_ANIMATIONS,
- "overridePendingAppTransitionRemote()")) {
- throw new SecurityException(
- "Requires CONTROL_REMOTE_APP_TRANSITION_ANIMATIONS permission");
- }
- synchronized (mGlobalLock) {
- final DisplayContent displayContent = mRoot.getDisplayContent(displayId);
- if (displayContent == null) {
- Slog.w(TAG, "Attempted to call overridePendingAppTransitionRemote"
- + " for the display " + displayId + " that does not exist.");
- return;
- }
- remoteAnimationAdapter.setCallingPidUid(Binder.getCallingPid(), Binder.getCallingUid());
- displayContent.mAppTransition.overridePendingAppTransitionRemote(
- remoteAnimationAdapter);
- }
+ // TODO(b/365884835): remove this method and callers.
}
@Override
@@ -3396,11 +3362,6 @@ public class WindowManagerService extends IWindowManager.Stub
}
@Override
- public boolean isAppTransitionStateIdle() {
- return getDefaultDisplayContentLocked().mAppTransition.isIdle();
- }
-
- @Override
public void disableKeyguard(IBinder token, String tag, int userId) {
userId = mAmInternal.handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(),
userId, false /* allowAll */, ALLOW_FULL_ONLY, "disableKeyguard", null);
@@ -7968,7 +7929,6 @@ public class WindowManagerService extends IWindowManager.Stub
@Override
public void registerAppTransitionListener(AppTransitionListener listener) {
synchronized (mGlobalLock) {
- getDefaultDisplayContentLocked().mAppTransition.registerListenerLocked(listener);
mAtmService.getTransitionController().registerLegacyListener(listener);
}
}
diff --git a/services/core/java/com/android/server/wm/WindowOrganizerController.java b/services/core/java/com/android/server/wm/WindowOrganizerController.java
index 4b4736ec6c59..ea1f35a130b0 100644
--- a/services/core/java/com/android/server/wm/WindowOrganizerController.java
+++ b/services/core/java/com/android/server/wm/WindowOrganizerController.java
@@ -472,6 +472,7 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
transition.setAllReady();
}
+ // TODO(b/365884835): remove this method and callers.
@Override
public int startLegacyTransition(int type, @NonNull RemoteAnimationAdapter adapter,
@NonNull IWindowContainerTransactionCallback callback,
@@ -489,16 +490,6 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
throw new IllegalArgumentException("Can't use legacy transitions in"
+ " when shell transitions are enabled.");
}
- final DisplayContent dc =
- mService.mRootWindowContainer.getDisplayContent(DEFAULT_DISPLAY);
- if (dc.mAppTransition.isTransitionSet()) {
- // a transition already exists, so the callback probably won't be called.
- return -1;
- }
- adapter.setCallingPidUid(caller.mPid, caller.mUid);
- dc.prepareAppTransition(type);
- dc.mAppTransition.overridePendingAppTransitionRemote(adapter, true /* sync */,
- false /* isActivityEmbedding */);
syncId = startSyncWithOrganizer(callback);
applyTransaction(t, syncId, mService.mChainTracker.startLegacy("legacyTransit"),
caller);