Loading core/java/android/window/TaskSnapshot.java +24 −3 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ public class TaskSnapshot implements Parcelable { /** The size of the snapshot before scaling */ private final Point mTaskSize; private final Rect mContentInsets; private final Rect mLetterboxInsets; // Whether this snapshot is a down-sampled version of the high resolution snapshot, used // mainly for loading snapshots quickly from disk when user is flinging fast private final boolean mIsLowResolution; Loading @@ -67,9 +68,10 @@ public class TaskSnapshot implements Parcelable { public TaskSnapshot(long id, @NonNull ComponentName topActivityComponent, HardwareBuffer snapshot, @NonNull ColorSpace colorSpace, int orientation, int rotation, Point taskSize, Rect contentInsets, boolean isLowResolution, boolean isRealSnapshot, int windowingMode, @WindowInsetsController.Appearance int appearance, boolean isTranslucent, boolean hasImeSurface) { Rect contentInsets, Rect letterboxInsets, boolean isLowResolution, boolean isRealSnapshot, int windowingMode, @WindowInsetsController.Appearance int appearance, boolean isTranslucent, boolean hasImeSurface) { mId = id; mTopActivityComponent = topActivityComponent; mSnapshot = snapshot; Loading @@ -79,6 +81,7 @@ public class TaskSnapshot implements Parcelable { mRotation = rotation; mTaskSize = new Point(taskSize); mContentInsets = new Rect(contentInsets); mLetterboxInsets = new Rect(letterboxInsets); mIsLowResolution = isLowResolution; mIsRealSnapshot = isRealSnapshot; mWindowingMode = windowingMode; Loading @@ -99,6 +102,7 @@ public class TaskSnapshot implements Parcelable { mRotation = source.readInt(); mTaskSize = source.readTypedObject(Point.CREATOR); mContentInsets = source.readTypedObject(Rect.CREATOR); mLetterboxInsets = source.readTypedObject(Rect.CREATOR); mIsLowResolution = source.readBoolean(); mIsRealSnapshot = source.readBoolean(); mWindowingMode = source.readInt(); Loading Loading @@ -178,6 +182,14 @@ public class TaskSnapshot implements Parcelable { return mContentInsets; } /** * @return The letterbox insets on the snapshot. These can be clipped off in order to * remove any letterbox areas in the snapshot. */ public Rect getLetterboxInsets() { return mLetterboxInsets; } /** * @return Whether this snapshot is a down-sampled version of the full resolution. */ Loading Loading @@ -241,6 +253,7 @@ public class TaskSnapshot implements Parcelable { dest.writeInt(mRotation); dest.writeTypedObject(mTaskSize, 0); dest.writeTypedObject(mContentInsets, 0); dest.writeTypedObject(mLetterboxInsets, 0); dest.writeBoolean(mIsLowResolution); dest.writeBoolean(mIsRealSnapshot); dest.writeInt(mWindowingMode); Loading @@ -262,6 +275,7 @@ public class TaskSnapshot implements Parcelable { + " mRotation=" + mRotation + " mTaskSize=" + mTaskSize.toString() + " mContentInsets=" + mContentInsets.toShortString() + " mLetterboxInsets=" + mLetterboxInsets.toShortString() + " mIsLowResolution=" + mIsLowResolution + " mIsRealSnapshot=" + mIsRealSnapshot + " mWindowingMode=" + mWindowingMode Loading Loading @@ -289,6 +303,7 @@ public class TaskSnapshot implements Parcelable { private int mRotation; private Point mTaskSize; private Rect mContentInsets; private Rect mLetterboxInsets; private boolean mIsRealSnapshot; private int mWindowingMode; private @WindowInsetsController.Appearance Loading Loading @@ -340,6 +355,11 @@ public class TaskSnapshot implements Parcelable { return this; } public Builder setLetterboxInsets(Rect letterboxInsets) { mLetterboxInsets = letterboxInsets; return this; } public Builder setIsRealSnapshot(boolean realSnapshot) { mIsRealSnapshot = realSnapshot; return this; Loading Loading @@ -387,6 +407,7 @@ public class TaskSnapshot implements Parcelable { mRotation, mTaskSize, mContentInsets, mLetterboxInsets, // When building a TaskSnapshot with the Builder class, isLowResolution // is always false. Low-res snapshots are only created when loading from // disk. Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawerTests.java +2 −2 Original line number Diff line number Diff line Loading @@ -301,8 +301,8 @@ public class StartingSurfaceDrawerTests { System.currentTimeMillis(), new ComponentName("", ""), buffer, ColorSpace.get(ColorSpace.Named.SRGB), ORIENTATION_PORTRAIT, Surface.ROTATION_0, taskSize, contentInsets, false, true /* isRealSnapshot */, WINDOWING_MODE_FULLSCREEN, Surface.ROTATION_0, taskSize, contentInsets, new Rect() /* letterboxInsets */, false, true /* isRealSnapshot */, WINDOWING_MODE_FULLSCREEN, 0 /* systemUiVisibility */, false /* isTranslucent */, hasImeSurface /* hasImeSurface */); } Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/startingsurface/TaskSnapshotWindowTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -94,8 +94,8 @@ public class TaskSnapshotWindowTest { System.currentTimeMillis(), new ComponentName("", ""), buffer, ColorSpace.get(ColorSpace.Named.SRGB), ORIENTATION_PORTRAIT, Surface.ROTATION_0, taskSize, contentInsets, false, true /* isRealSnapshot */, WINDOWING_MODE_FULLSCREEN, Surface.ROTATION_0, taskSize, contentInsets, new Rect() /* letterboxInsets */, false, true /* isRealSnapshot */, WINDOWING_MODE_FULLSCREEN, 0 /* systemUiVisibility */, false /* isTranslucent */, false /* hasImeSurface */); } Loading packages/SystemUI/shared/src/com/android/systemui/shared/recents/model/ThumbnailData.java +3 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ public class ThumbnailData { public int orientation; public int rotation; public Rect insets; public Rect letterboxInsets; public boolean reducedResolution; public boolean isRealSnapshot; public boolean isTranslucent; Loading @@ -55,6 +56,7 @@ public class ThumbnailData { orientation = ORIENTATION_UNDEFINED; rotation = ROTATION_UNDEFINED; insets = new Rect(); letterboxInsets = new Rect(); reducedResolution = false; scale = 1f; isRealSnapshot = true; Loading Loading @@ -97,6 +99,7 @@ public class ThumbnailData { public ThumbnailData(TaskSnapshot snapshot) { thumbnail = makeThumbnail(snapshot); insets = new Rect(snapshot.getContentInsets()); letterboxInsets = new Rect(snapshot.getLetterboxInsets()); orientation = snapshot.getOrientation(); rotation = snapshot.getRotation(); reducedResolution = snapshot.isLowResolution(); Loading proto/src/task_snapshot.proto +4 −0 Original line number Diff line number Diff line Loading @@ -41,4 +41,8 @@ // The task height when the snapshot was taken int32 task_height = 15; int32 appearance = 16; int32 letterbox_inset_left = 17; int32 letterbox_inset_top = 18; int32 letterbox_inset_right = 19; int32 letterbox_inset_bottom = 20; } Loading
core/java/android/window/TaskSnapshot.java +24 −3 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ public class TaskSnapshot implements Parcelable { /** The size of the snapshot before scaling */ private final Point mTaskSize; private final Rect mContentInsets; private final Rect mLetterboxInsets; // Whether this snapshot is a down-sampled version of the high resolution snapshot, used // mainly for loading snapshots quickly from disk when user is flinging fast private final boolean mIsLowResolution; Loading @@ -67,9 +68,10 @@ public class TaskSnapshot implements Parcelable { public TaskSnapshot(long id, @NonNull ComponentName topActivityComponent, HardwareBuffer snapshot, @NonNull ColorSpace colorSpace, int orientation, int rotation, Point taskSize, Rect contentInsets, boolean isLowResolution, boolean isRealSnapshot, int windowingMode, @WindowInsetsController.Appearance int appearance, boolean isTranslucent, boolean hasImeSurface) { Rect contentInsets, Rect letterboxInsets, boolean isLowResolution, boolean isRealSnapshot, int windowingMode, @WindowInsetsController.Appearance int appearance, boolean isTranslucent, boolean hasImeSurface) { mId = id; mTopActivityComponent = topActivityComponent; mSnapshot = snapshot; Loading @@ -79,6 +81,7 @@ public class TaskSnapshot implements Parcelable { mRotation = rotation; mTaskSize = new Point(taskSize); mContentInsets = new Rect(contentInsets); mLetterboxInsets = new Rect(letterboxInsets); mIsLowResolution = isLowResolution; mIsRealSnapshot = isRealSnapshot; mWindowingMode = windowingMode; Loading @@ -99,6 +102,7 @@ public class TaskSnapshot implements Parcelable { mRotation = source.readInt(); mTaskSize = source.readTypedObject(Point.CREATOR); mContentInsets = source.readTypedObject(Rect.CREATOR); mLetterboxInsets = source.readTypedObject(Rect.CREATOR); mIsLowResolution = source.readBoolean(); mIsRealSnapshot = source.readBoolean(); mWindowingMode = source.readInt(); Loading Loading @@ -178,6 +182,14 @@ public class TaskSnapshot implements Parcelable { return mContentInsets; } /** * @return The letterbox insets on the snapshot. These can be clipped off in order to * remove any letterbox areas in the snapshot. */ public Rect getLetterboxInsets() { return mLetterboxInsets; } /** * @return Whether this snapshot is a down-sampled version of the full resolution. */ Loading Loading @@ -241,6 +253,7 @@ public class TaskSnapshot implements Parcelable { dest.writeInt(mRotation); dest.writeTypedObject(mTaskSize, 0); dest.writeTypedObject(mContentInsets, 0); dest.writeTypedObject(mLetterboxInsets, 0); dest.writeBoolean(mIsLowResolution); dest.writeBoolean(mIsRealSnapshot); dest.writeInt(mWindowingMode); Loading @@ -262,6 +275,7 @@ public class TaskSnapshot implements Parcelable { + " mRotation=" + mRotation + " mTaskSize=" + mTaskSize.toString() + " mContentInsets=" + mContentInsets.toShortString() + " mLetterboxInsets=" + mLetterboxInsets.toShortString() + " mIsLowResolution=" + mIsLowResolution + " mIsRealSnapshot=" + mIsRealSnapshot + " mWindowingMode=" + mWindowingMode Loading Loading @@ -289,6 +303,7 @@ public class TaskSnapshot implements Parcelable { private int mRotation; private Point mTaskSize; private Rect mContentInsets; private Rect mLetterboxInsets; private boolean mIsRealSnapshot; private int mWindowingMode; private @WindowInsetsController.Appearance Loading Loading @@ -340,6 +355,11 @@ public class TaskSnapshot implements Parcelable { return this; } public Builder setLetterboxInsets(Rect letterboxInsets) { mLetterboxInsets = letterboxInsets; return this; } public Builder setIsRealSnapshot(boolean realSnapshot) { mIsRealSnapshot = realSnapshot; return this; Loading Loading @@ -387,6 +407,7 @@ public class TaskSnapshot implements Parcelable { mRotation, mTaskSize, mContentInsets, mLetterboxInsets, // When building a TaskSnapshot with the Builder class, isLowResolution // is always false. Low-res snapshots are only created when loading from // disk. Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawerTests.java +2 −2 Original line number Diff line number Diff line Loading @@ -301,8 +301,8 @@ public class StartingSurfaceDrawerTests { System.currentTimeMillis(), new ComponentName("", ""), buffer, ColorSpace.get(ColorSpace.Named.SRGB), ORIENTATION_PORTRAIT, Surface.ROTATION_0, taskSize, contentInsets, false, true /* isRealSnapshot */, WINDOWING_MODE_FULLSCREEN, Surface.ROTATION_0, taskSize, contentInsets, new Rect() /* letterboxInsets */, false, true /* isRealSnapshot */, WINDOWING_MODE_FULLSCREEN, 0 /* systemUiVisibility */, false /* isTranslucent */, hasImeSurface /* hasImeSurface */); } Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/startingsurface/TaskSnapshotWindowTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -94,8 +94,8 @@ public class TaskSnapshotWindowTest { System.currentTimeMillis(), new ComponentName("", ""), buffer, ColorSpace.get(ColorSpace.Named.SRGB), ORIENTATION_PORTRAIT, Surface.ROTATION_0, taskSize, contentInsets, false, true /* isRealSnapshot */, WINDOWING_MODE_FULLSCREEN, Surface.ROTATION_0, taskSize, contentInsets, new Rect() /* letterboxInsets */, false, true /* isRealSnapshot */, WINDOWING_MODE_FULLSCREEN, 0 /* systemUiVisibility */, false /* isTranslucent */, false /* hasImeSurface */); } Loading
packages/SystemUI/shared/src/com/android/systemui/shared/recents/model/ThumbnailData.java +3 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ public class ThumbnailData { public int orientation; public int rotation; public Rect insets; public Rect letterboxInsets; public boolean reducedResolution; public boolean isRealSnapshot; public boolean isTranslucent; Loading @@ -55,6 +56,7 @@ public class ThumbnailData { orientation = ORIENTATION_UNDEFINED; rotation = ROTATION_UNDEFINED; insets = new Rect(); letterboxInsets = new Rect(); reducedResolution = false; scale = 1f; isRealSnapshot = true; Loading Loading @@ -97,6 +99,7 @@ public class ThumbnailData { public ThumbnailData(TaskSnapshot snapshot) { thumbnail = makeThumbnail(snapshot); insets = new Rect(snapshot.getContentInsets()); letterboxInsets = new Rect(snapshot.getLetterboxInsets()); orientation = snapshot.getOrientation(); rotation = snapshot.getRotation(); reducedResolution = snapshot.isLowResolution(); Loading
proto/src/task_snapshot.proto +4 −0 Original line number Diff line number Diff line Loading @@ -41,4 +41,8 @@ // The task height when the snapshot was taken int32 task_height = 15; int32 appearance = 16; int32 letterbox_inset_left = 17; int32 letterbox_inset_top = 18; int32 letterbox_inset_right = 19; int32 letterbox_inset_bottom = 20; }