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

Commit 16133819 authored by Evan Rosky's avatar Evan Rosky Committed by Automerger Merge Worker
Browse files

Merge "Hook up nav-bar attach/detach logic to Shell Transitions" into sc-v2-dev am: 6399316a

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

Change-Id: Icff3f8c9aae37671bace4751254d0b2d5513ad7e
parents 1a93eb28 6399316a
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -475,6 +475,19 @@ public class ActivityTaskManager {
        }
    }

    /**
     * Detaches the navigation bar from the app it was attached to during a transition.
     * @hide
     */
    @RequiresPermission(android.Manifest.permission.CONTROL_REMOTE_APP_TRANSITION_ANIMATIONS)
    public void detachNavigationBarFromApp(@NonNull IBinder transition) {
        try {
            getService().detachNavigationBarFromApp(transition);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * Information you can retrieve about a root task in the system.
     * @hide
+6 −0
Original line number Diff line number Diff line
@@ -330,4 +330,10 @@ interface IActivityTaskManager {
     * When the Picture-in-picture state has changed.
     */
    void onPictureInPictureStateChanged(in PictureInPictureUiState pipState);

    /**
     * Re-attach navbar to the display during a recents transition.
     * TODO(188595497): Remove this once navbar attachment is in shell.
     */
    void detachNavigationBarFromApp(in IBinder transition);
}
+9 −1
Original line number Diff line number Diff line
@@ -466,6 +466,13 @@ public interface WindowManager extends ViewManager {
     */
    int TRANSIT_FLAG_KEYGUARD_LOCKED = 0x40;

    /**
     * Transition flag: Indicates that this transition is for recents animation.
     * TODO(b/188669821): Remove once special-case logic moves to shell.
     * @hide
     */
    int TRANSIT_FLAG_IS_RECENTS = 0x80;

    /**
     * @hide
     */
@@ -476,7 +483,8 @@ public interface WindowManager extends ViewManager {
            TRANSIT_FLAG_KEYGUARD_GOING_AWAY_SUBTLE_ANIMATION,
            TRANSIT_FLAG_APP_CRASHED,
            TRANSIT_FLAG_OPEN_BEHIND,
            TRANSIT_FLAG_KEYGUARD_LOCKED
            TRANSIT_FLAG_KEYGUARD_LOCKED,
            TRANSIT_FLAG_IS_RECENTS
    })
    @Retention(RetentionPolicy.SOURCE)
    @interface TransitionFlags {}
+17 −2
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import static android.view.WindowManager.TRANSIT_TO_FRONT;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SuppressLint;
import android.app.ActivityTaskManager;
import android.graphics.Rect;
import android.os.IBinder;
import android.os.Parcelable;
@@ -135,7 +136,7 @@ public class RemoteTransitionCompat implements Parcelable {
                }
                t.apply();
                mRecentsSession.setup(controller, info, finishedCallback, pausingTask,
                        leashMap);
                        leashMap, mToken);
                recents.onAnimationStart(mRecentsSession, apps, wallpapers, new Rect(0, 0, 0, 0),
                        new Rect());
            }
@@ -178,10 +179,11 @@ public class RemoteTransitionCompat implements Parcelable {
        private TransitionInfo mInfo = null;
        private SurfaceControl mOpeningLeash = null;
        private ArrayMap<SurfaceControl, SurfaceControl> mLeashMap = null;
        private IBinder mTransition = null;

        void setup(RecentsAnimationControllerCompat wrapped, TransitionInfo info,
                IRemoteTransitionFinishedCallback finishCB, WindowContainerToken pausingTask,
                ArrayMap<SurfaceControl, SurfaceControl> leashMap) {
                ArrayMap<SurfaceControl, SurfaceControl> leashMap, IBinder transition) {
            if (mInfo != null) {
                throw new IllegalStateException("Trying to run a new recents animation while"
                        + " recents is already active.");
@@ -191,6 +193,7 @@ public class RemoteTransitionCompat implements Parcelable {
            mFinishCB = finishCB;
            mPausingTask = pausingTask;
            mLeashMap = leashMap;
            mTransition = transition;
        }

        @SuppressLint("NewApi")
@@ -298,6 +301,7 @@ public class RemoteTransitionCompat implements Parcelable {
            mInfo = null;
            mOpeningLeash = null;
            mLeashMap = null;
            mTransition = null;
        }

        @Override public void setDeferCancelUntilNextTransition(boolean defer, boolean screenshot) {
@@ -318,6 +322,17 @@ public class RemoteTransitionCompat implements Parcelable {
        @Override public boolean removeTask(int taskId) {
            return mWrapped != null ? mWrapped.removeTask(taskId) : false;
        }

        /**
         * @see IRecentsAnimationController#detachNavigationBarFromApp
         */
        @Override public void detachNavigationBarFromApp(boolean moveHomeToTop) {
            try {
                ActivityTaskManager.getService().detachNavigationBarFromApp(mTransition);
            } catch (RemoteException e) {
                Log.e(TAG, "Failed to detach the navigation bar from app", e);
            }
        }
    }


+6 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import static android.app.ActivityManager.START_RETURN_LOCK_TASK_MODE_VIOLATION;
import static android.app.ActivityManager.START_SUCCESS;
import static android.app.ActivityManager.START_TASK_TO_FRONT;
import static android.app.ActivityTaskManager.INVALID_TASK_ID;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_SECONDARY;
import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
@@ -1547,6 +1548,11 @@ class ActivityStarter {
            newTransition.setRemoteTransition(remoteTransition);
        }
        mService.getTransitionController().collect(r);
        // TODO(b/188669821): Remove when navbar reparenting moves to shell
        if (r.getActivityType() == ACTIVITY_TYPE_HOME && r.getOptions() != null
                && r.getOptions().getTransientLaunch()) {
            mService.getTransitionController().setIsLegacyRecents();
        }
        try {
            mService.deferWindowLayout();
            Trace.traceBegin(Trace.TRACE_TAG_WINDOW_MANAGER, "startActivityInner");
Loading