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

Commit 53ae6a82 authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge changes from topic "sysui_flags_drop" into pi-dev

* changes:
  Clean up Recents animation api
  Expose the system ui visibility flags and translucent state with snapshot
parents cb20eb3a 6802e2a5
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -534,8 +534,7 @@ Landroid/view/IRecentsAnimationController;->screenshotTask(I)Landroid/app/Activi
Landroid/view/IRecentsAnimationController;->setInputConsumerEnabled(Z)V
Landroid/view/IRecentsAnimationController;->setInputConsumerEnabled(Z)V
Landroid/view/IRecentsAnimationRunner$Stub;-><init>()V
Landroid/view/IRecentsAnimationRunner$Stub;-><init>()V
Landroid/view/IRecentsAnimationRunner;->onAnimationCanceled()V
Landroid/view/IRecentsAnimationRunner;->onAnimationCanceled()V
Landroid/view/IRecentsAnimationRunner;->onAnimationStart(Landroid/view/IRecentsAnimationController;[Landroid/view/RemoteAnimationTarget;)V
Landroid/view/IRecentsAnimationRunner;->onAnimationStart(Landroid/view/IRecentsAnimationController;[Landroid/view/RemoteAnimationTarget;Landroid/graphics/Rect;Landroid/graphics/Rect;)V
Landroid/view/IRecentsAnimationRunner;->onAnimationStart_New(Landroid/view/IRecentsAnimationController;[Landroid/view/RemoteAnimationTarget;Landroid/graphics/Rect;Landroid/graphics/Rect;)V
Landroid/view/IRemoteAnimationFinishedCallback;->onAnimationFinished()V
Landroid/view/IRemoteAnimationFinishedCallback;->onAnimationFinished()V
Landroid/view/IRemoteAnimationRunner$Stub;-><init>()V
Landroid/view/IRemoteAnimationRunner$Stub;-><init>()V
Landroid/view/IRemoteAnimationRunner;->onAnimationCancelled()V
Landroid/view/IRemoteAnimationRunner;->onAnimationCancelled()V
+28 −2
Original line number Original line Diff line number Diff line
@@ -2110,9 +2110,12 @@ public class ActivityManager {
        private final boolean mIsRealSnapshot;
        private final boolean mIsRealSnapshot;
        private final int mWindowingMode;
        private final int mWindowingMode;
        private final float mScale;
        private final float mScale;
        private final int mSystemUiVisibility;
        private final boolean mIsTranslucent;


        public TaskSnapshot(GraphicBuffer snapshot, int orientation, Rect contentInsets,
        public TaskSnapshot(GraphicBuffer snapshot, int orientation, Rect contentInsets,
                boolean reducedResolution, float scale, boolean isRealSnapshot, int windowingMode) {
                boolean reducedResolution, float scale, boolean isRealSnapshot, int windowingMode,
                int systemUiVisibility, boolean isTranslucent) {
            mSnapshot = snapshot;
            mSnapshot = snapshot;
            mOrientation = orientation;
            mOrientation = orientation;
            mContentInsets = new Rect(contentInsets);
            mContentInsets = new Rect(contentInsets);
@@ -2120,6 +2123,8 @@ public class ActivityManager {
            mScale = scale;
            mScale = scale;
            mIsRealSnapshot = isRealSnapshot;
            mIsRealSnapshot = isRealSnapshot;
            mWindowingMode = windowingMode;
            mWindowingMode = windowingMode;
            mSystemUiVisibility = systemUiVisibility;
            mIsTranslucent = isTranslucent;
        }
        }


        private TaskSnapshot(Parcel source) {
        private TaskSnapshot(Parcel source) {
@@ -2130,6 +2135,8 @@ public class ActivityManager {
            mScale = source.readFloat();
            mScale = source.readFloat();
            mIsRealSnapshot = source.readBoolean();
            mIsRealSnapshot = source.readBoolean();
            mWindowingMode = source.readInt();
            mWindowingMode = source.readInt();
            mSystemUiVisibility = source.readInt();
            mIsTranslucent = source.readBoolean();
        }
        }


        /**
        /**
@@ -2169,6 +2176,13 @@ public class ActivityManager {
            return mIsRealSnapshot;
            return mIsRealSnapshot;
        }
        }


        /**
         * @return Whether or not the snapshot is of a translucent app window.
         */
        public boolean isTranslucent() {
            return mIsTranslucent;
        }

        /**
        /**
         * @return The windowing mode of the task when this snapshot was taken.
         * @return The windowing mode of the task when this snapshot was taken.
         */
         */
@@ -2176,6 +2190,14 @@ public class ActivityManager {
            return mWindowingMode;
            return mWindowingMode;
        }
        }


        /**
         * @return The system ui visibility flags for the top most visible fullscreen window at the
         *         time that the snapshot was taken.
         */
        public int getSystemUiVisibility() {
            return mSystemUiVisibility;
        }

        /**
        /**
         * @return The scale this snapshot was taken in.
         * @return The scale this snapshot was taken in.
         */
         */
@@ -2197,6 +2219,8 @@ public class ActivityManager {
            dest.writeFloat(mScale);
            dest.writeFloat(mScale);
            dest.writeBoolean(mIsRealSnapshot);
            dest.writeBoolean(mIsRealSnapshot);
            dest.writeInt(mWindowingMode);
            dest.writeInt(mWindowingMode);
            dest.writeInt(mSystemUiVisibility);
            dest.writeBoolean(mIsTranslucent);
        }
        }


        @Override
        @Override
@@ -2207,7 +2231,9 @@ public class ActivityManager {
                    + " mOrientation=" + mOrientation
                    + " mOrientation=" + mOrientation
                    + " mContentInsets=" + mContentInsets.toShortString()
                    + " mContentInsets=" + mContentInsets.toShortString()
                    + " mReducedResolution=" + mReducedResolution + " mScale=" + mScale
                    + " mReducedResolution=" + mReducedResolution + " mScale=" + mScale
                    + " mIsRealSnapshot=" + mIsRealSnapshot + " mWindowingMode=" + mWindowingMode;
                    + " mIsRealSnapshot=" + mIsRealSnapshot + " mWindowingMode=" + mWindowingMode
                    + " mSystemUiVisibility=" + mSystemUiVisibility
                    + " mIsTranslucent=" + mIsTranslucent;
        }
        }


        public static final Creator<TaskSnapshot> CREATOR = new Creator<TaskSnapshot>() {
        public static final Creator<TaskSnapshot> CREATOR = new Creator<TaskSnapshot>() {
+1 −7
Original line number Original line Diff line number Diff line
@@ -28,12 +28,6 @@ import android.view.IRecentsAnimationController;
 */
 */
oneway interface IRecentsAnimationRunner {
oneway interface IRecentsAnimationRunner {


    /**
     * Deprecated, to be removed once Launcher updates
     */
    void onAnimationStart(in IRecentsAnimationController controller,
            in RemoteAnimationTarget[] apps) = 0;

    /**
    /**
     * Called when the system needs to cancel the current animation. This can be due to the
     * Called when the system needs to cancel the current animation. This can be due to the
     * wallpaper not drawing in time, or the handler not finishing the animation within a predefined
     * wallpaper not drawing in time, or the handler not finishing the animation within a predefined
@@ -48,7 +42,7 @@ oneway interface IRecentsAnimationRunner {
     * @param minimizedHomeBounds Specifies the bounds of the minimized home app, will be
     * @param minimizedHomeBounds Specifies the bounds of the minimized home app, will be
     *                            {@code null} if the device is not currently in split screen
     *                            {@code null} if the device is not currently in split screen
     */
     */
    void onAnimationStart_New(in IRecentsAnimationController controller,
    void onAnimationStart(in IRecentsAnimationController controller,
            in RemoteAnimationTarget[] apps, in Rect homeContentInsets,
            in RemoteAnimationTarget[] apps, in Rect homeContentInsets,
            in Rect minimizedHomeBounds) = 2;
            in Rect minimizedHomeBounds) = 2;
}
}
+6 −0
Original line number Original line Diff line number Diff line
@@ -33,7 +33,9 @@ public class ThumbnailData {
    public Rect insets;
    public Rect insets;
    public boolean reducedResolution;
    public boolean reducedResolution;
    public boolean isRealSnapshot;
    public boolean isRealSnapshot;
    public boolean isTranslucent;
    public int windowingMode;
    public int windowingMode;
    public int systemUiVisibility;
    public float scale;
    public float scale;


    public ThumbnailData() {
    public ThumbnailData() {
@@ -43,7 +45,9 @@ public class ThumbnailData {
        reducedResolution = false;
        reducedResolution = false;
        scale = 1f;
        scale = 1f;
        isRealSnapshot = true;
        isRealSnapshot = true;
        isTranslucent = false;
        windowingMode = WINDOWING_MODE_UNDEFINED;
        windowingMode = WINDOWING_MODE_UNDEFINED;
        systemUiVisibility = 0;
    }
    }


    public ThumbnailData(TaskSnapshot snapshot) {
    public ThumbnailData(TaskSnapshot snapshot) {
@@ -53,6 +57,8 @@ public class ThumbnailData {
        reducedResolution = snapshot.isReducedResolution();
        reducedResolution = snapshot.isReducedResolution();
        scale = snapshot.getScale();
        scale = snapshot.getScale();
        isRealSnapshot = snapshot.isRealSnapshot();
        isRealSnapshot = snapshot.isRealSnapshot();
        isTranslucent = snapshot.isTranslucent();
        windowingMode = snapshot.getWindowingMode();
        windowingMode = snapshot.getWindowingMode();
        systemUiVisibility = snapshot.getSystemUiVisibility();
    }
    }
}
}
+0 −7
Original line number Original line Diff line number Diff line
@@ -219,13 +219,6 @@ public class ActivityManagerWrapper {
            if (animationHandler != null) {
            if (animationHandler != null) {
                runner = new IRecentsAnimationRunner.Stub() {
                runner = new IRecentsAnimationRunner.Stub() {
                    public void onAnimationStart(IRecentsAnimationController controller,
                    public void onAnimationStart(IRecentsAnimationController controller,
                            RemoteAnimationTarget[] apps) {
                        final Rect stableInsets = new Rect();
                        WindowManagerWrapper.getInstance().getStableInsets(stableInsets);
                        onAnimationStart_New(controller, apps, stableInsets, null);
                    }

                    public void onAnimationStart_New(IRecentsAnimationController controller,
                            RemoteAnimationTarget[] apps, Rect homeContentInsets,
                            RemoteAnimationTarget[] apps, Rect homeContentInsets,
                            Rect minimizedHomeBounds) {
                            Rect minimizedHomeBounds) {
                        final RecentsAnimationControllerCompat controllerCompat =
                        final RecentsAnimationControllerCompat controllerCompat =
Loading