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

Commit 4dc04606 authored by Peter Kalauskas's avatar Peter Kalauskas
Browse files

Rename full and reduced scale configs

Rename:
  config_fullTaskSnapshotScale -> config_highResTaskSnapshotScale
  config_reducedTaskSnapshotScale -> config_lowResTaskSnapshotScale

Both full and reduced scale can be "reduced" from 100%, so name them
more clearly.

Test: TaskSnapshotCacheTest
Test: TaskSnapshotControllerTest
Test: TaskSnapshotPersisterLoaderTest
Test: TaskSnapshotSurfaceTest
Bug: 148617404
Bug: 142063079
Change-Id: Ie8073d5a3048c19450308b2af22d363deaa51b6a
parent 79977dcc
Loading
Loading
Loading
Loading
+15 −12
Original line number Diff line number Diff line
@@ -1955,7 +1955,7 @@ public class ActivityManager {
        private final Rect mContentInsets;
        // Whether this snapshot is a down-sampled version of the full resolution, used mainly for
        // low-ram devices
        private final boolean mReducedResolution;
        private final boolean mIsLowResolution;
        // Whether or not the snapshot is a real snapshot or an app-theme generated snapshot due to
        // the task having a secure window or having previews disabled
        private final boolean mIsRealSnapshot;
@@ -1969,7 +1969,7 @@ public class ActivityManager {
        public TaskSnapshot(long id,
                @NonNull ComponentName topActivityComponent, GraphicBuffer snapshot,
                @NonNull ColorSpace colorSpace, int orientation, int rotation, Rect contentInsets,
                boolean reducedResolution, float scale, boolean isRealSnapshot, int windowingMode,
                boolean isLowResolution, float scale, boolean isRealSnapshot, int windowingMode,
                int systemUiVisibility, boolean isTranslucent) {
            mId = id;
            mTopActivityComponent = topActivityComponent;
@@ -1979,7 +1979,7 @@ public class ActivityManager {
            mOrientation = orientation;
            mRotation = rotation;
            mContentInsets = new Rect(contentInsets);
            mReducedResolution = reducedResolution;
            mIsLowResolution = isLowResolution;
            mScale = scale;
            mIsRealSnapshot = isRealSnapshot;
            mWindowingMode = windowingMode;
@@ -1998,7 +1998,7 @@ public class ActivityManager {
            mOrientation = source.readInt();
            mRotation = source.readInt();
            mContentInsets = source.readParcelable(null /* classLoader */);
            mReducedResolution = source.readBoolean();
            mIsLowResolution = source.readBoolean();
            mScale = source.readFloat();
            mIsRealSnapshot = source.readBoolean();
            mWindowingMode = source.readInt();
@@ -2063,8 +2063,8 @@ public class ActivityManager {
         * @return Whether this snapshot is a down-sampled version of the full resolution.
         */
        @UnsupportedAppUsage
        public boolean isReducedResolution() {
            return mReducedResolution;
        public boolean isLowResolution() {
            return mIsLowResolution;
        }

        /**
@@ -2121,7 +2121,7 @@ public class ActivityManager {
            dest.writeInt(mOrientation);
            dest.writeInt(mRotation);
            dest.writeParcelable(mContentInsets, 0);
            dest.writeBoolean(mReducedResolution);
            dest.writeBoolean(mIsLowResolution);
            dest.writeFloat(mScale);
            dest.writeBoolean(mIsRealSnapshot);
            dest.writeInt(mWindowingMode);
@@ -2141,7 +2141,7 @@ public class ActivityManager {
                    + " mOrientation=" + mOrientation
                    + " mRotation=" + mRotation
                    + " mContentInsets=" + mContentInsets.toShortString()
                    + " mReducedResolution=" + mReducedResolution + " mScale=" + mScale
                    + " mIsLowResolution=" + mIsLowResolution + " mScale=" + mScale
                    + " mIsRealSnapshot=" + mIsRealSnapshot + " mWindowingMode=" + mWindowingMode
                    + " mSystemUiVisibility=" + mSystemUiVisibility
                    + " mIsTranslucent=" + mIsTranslucent;
@@ -2165,7 +2165,7 @@ public class ActivityManager {
            private int mOrientation;
            private int mRotation;
            private Rect mContentInsets;
            private boolean mReducedResolution;
            private boolean mIsLowResolution;
            private float mScaleFraction;
            private boolean mIsRealSnapshot;
            private int mWindowingMode;
@@ -2208,8 +2208,11 @@ public class ActivityManager {
                return this;
            }

            public Builder setReducedResolution(boolean reducedResolution) {
                mReducedResolution = reducedResolution;
            /**
             * Set to true if this is a low-resolution snapshot stored in *_reduced.jpg.
             */
            public Builder setIsLowResolution(boolean isLowResolution) {
                mIsLowResolution = isLowResolution;
                return this;
            }

@@ -2260,7 +2263,7 @@ public class ActivityManager {
                        mOrientation,
                        mRotation,
                        mContentInsets,
                        mReducedResolution,
                        mIsLowResolution,
                        mScaleFraction,
                        mIsRealSnapshot,
                        mWindowingMode,
+2 −2
Original line number Diff line number Diff line
@@ -584,12 +584,12 @@ interface IActivityManager {
    void cancelTaskWindowTransition(int taskId);
    /**
     * @param taskId the id of the task to retrieve the sAutoapshots for
     * @param reducedResolution if set, if the snapshot needs to be loaded from disk, this will load
     * @param isLowResolution if set, if the snapshot needs to be loaded from disk, this will load
     *                          a reduced resolution of it, which is much faster
     * @return a graphic buffer representing a screenshot of a task
     */
    @UnsupportedAppUsage
    ActivityManager.TaskSnapshot getTaskSnapshot(int taskId, boolean reducedResolution);
    ActivityManager.TaskSnapshot getTaskSnapshot(int taskId, boolean isLowResolution);
    void scheduleApplicationInfoChanged(in List<String> packageNames, int userId);
    void setPersistentVrThread(int tid);

+2 −2
Original line number Diff line number Diff line
@@ -401,11 +401,11 @@ interface IActivityTaskManager {

    /**
     * @param taskId the id of the task to retrieve the sAutoapshots for
     * @param reducedResolution if set, if the snapshot needs to be loaded from disk, this will load
     * @param isLowResolution if set, if the snapshot needs to be loaded from disk, this will load
     *                          a reduced resolution of it, which is much faster
     * @return a graphic buffer representing a screenshot of a task
     */
    ActivityManager.TaskSnapshot getTaskSnapshot(int taskId, boolean reducedResolution);
    ActivityManager.TaskSnapshot getTaskSnapshot(int taskId, boolean isLowResolution);

    /**
     * See {@link android.app.Activity#setDisablePreviewScreenshots}
+3 −3
Original line number Diff line number Diff line
@@ -170,13 +170,13 @@ public class TaskInfo {
    }

    /**
     * @param reducedResolution
     * @param isLowResolution
     * @return
     * @hide
     */
    public ActivityManager.TaskSnapshot getTaskSnapshot(boolean reducedResolution) {
    public ActivityManager.TaskSnapshot getTaskSnapshot(boolean isLowResolution) {
        try {
            return ActivityManager.getService().getTaskSnapshot(taskId, reducedResolution);
            return ActivityManager.getService().getTaskSnapshot(taskId, isLowResolution);
        } catch (RemoteException e) {
            Log.e(TAG, "Failed to get task snapshot, taskId=" + taskId, e);
            return null;
+2 −2
Original line number Diff line number Diff line
@@ -2729,12 +2729,12 @@
    <string name="config_defaultNetworkScorerPackageName"></string>

    <!-- The amount to scale fullscreen snapshots for Overview and snapshot starting windows. -->
    <item name="config_fullTaskSnapshotScale" format="float" type="dimen">1.0</item>
    <item name="config_highResTaskSnapshotScale" format="float" type="dimen">1.0</item>

    <!-- The amount to scale reduced scale snapshots for Overview and snapshot starting windows.
         Reduced scale snapshots are loaded before full screen snapshots to improve load times and
         minimize the chance the user will see an empty task card. -->
    <item name="config_reducedTaskSnapshotScale" format="float" type="dimen">0.5</item>
    <item name="config_lowResTaskSnapshotScale" format="float" type="dimen">0.5</item>

    <!-- Feature flag to store TaskSnapshot in 16 bit pixel format to save memory. -->
    <bool name="config_use16BitTaskSnapshotPixelFormat">false</bool>
Loading