Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 856f2751 authored by Wei Sheng Shih's avatar Wei Sheng Shih Committed by Android (Google) Code Review
Browse files

Merge "[PB] Migrate visibility change to transition." into main

parents 69df0846 c7614db5
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -477,6 +477,12 @@ public interface WindowManager extends ViewManager {
     * @hide
     */
    int TRANSIT_SLEEP = 12;
    /**
     * An Activity was going to be visible from back navigation.
     * @hide
     */
    int TRANSIT_PREPARE_BACK_NAVIGATION = 13;

    /**
     * The first slot for custom transition types. Callers (like Shell) can make use of custom
     * transition types for dealing with special cases. These types are effectively ignored by
@@ -505,6 +511,7 @@ public interface WindowManager extends ViewManager {
            TRANSIT_PIP,
            TRANSIT_WAKE,
            TRANSIT_SLEEP,
            TRANSIT_PREPARE_BACK_NAVIGATION,
            TRANSIT_FIRST_CUSTOM
    })
    @Retention(RetentionPolicy.SOURCE)
@@ -1918,6 +1925,7 @@ public interface WindowManager extends ViewManager {
            case TRANSIT_PIP: return "PIP";
            case TRANSIT_WAKE: return "WAKE";
            case TRANSIT_SLEEP: return "SLEEP";
            case TRANSIT_PREPARE_BACK_NAVIGATION: return "PREDICTIVE_BACK";
            case TRANSIT_FIRST_CUSTOM: return "FIRST_CUSTOM";
            default:
                if (type > TRANSIT_FIRST_CUSTOM) {
+10 −0
Original line number Diff line number Diff line
@@ -209,3 +209,13 @@ flag {
    purpose: PURPOSE_BUGFIX
  }
}
flag {
  name: "migrate_predictive_back_transition"
  namespace: "windowing_frontend"
  description: "Create transition when visibility change from predictive back"
  bug: "347168362"
  is_fixed_read_only: true
  metadata {
    purpose: PURPOSE_BUGFIX
  }
}
+302 −6

File changed.

Preview size limit exceeded, changes collapsed.

+4 −2
Original line number Diff line number Diff line
@@ -375,7 +375,8 @@ public abstract class WMShellBaseModule {
            @ShellBackgroundThread Handler backgroundHandler,
            BackAnimationBackground backAnimationBackground,
            Optional<ShellBackAnimationRegistry> shellBackAnimationRegistry,
            ShellCommandHandler shellCommandHandler) {
            ShellCommandHandler shellCommandHandler,
            Transitions transitions) {
        if (BackAnimationController.IS_ENABLED) {
            return shellBackAnimationRegistry.map(
                    (animations) ->
@@ -387,7 +388,8 @@ public abstract class WMShellBaseModule {
                                    context,
                                    backAnimationBackground,
                                    animations,
                                    shellCommandHandler));
                                    shellCommandHandler,
                                    transitions));
        }
        return Optional.empty();
    }
+3 −1
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import static android.window.TransitionInfo.FLAG_STARTING_WINDOW_TRANSFER_RECIPI

import static com.android.window.flags.Flags.ensureWallpaperInTransitions;
import static com.android.systemui.shared.Flags.returnAnimationFrameworkLibrary;
import static com.android.window.flags.Flags.migratePredictiveBackTransition;
import static com.android.wm.shell.shared.TransitionUtil.isClosingType;
import static com.android.wm.shell.shared.TransitionUtil.isOpeningType;
import static com.android.wm.shell.sysui.ShellSharedConstants.KEY_EXTRA_SHELL_SHELL_TRANSITIONS;
@@ -821,7 +822,8 @@ public class Transitions implements RemoteCallable<Transitions>,
            }
            // The change has already animated by back gesture, don't need to play transition
            // animation on it.
            if (change.hasFlags(FLAG_BACK_GESTURE_ANIMATED)) {
            if (!migratePredictiveBackTransition()
                    && change.hasFlags(FLAG_BACK_GESTURE_ANIMATED)) {
                info.getChanges().remove(i);
            }
        }
Loading