Loading core/java/android/app/ActivityManager.java +15 −2 Original line number Diff line number Diff line Loading @@ -1822,7 +1822,8 @@ public class ActivityManager { * @hide */ public static class TaskSnapshot implements Parcelable { // Identifier of this snapshot private final long mId; // Top activity in task when snapshot was taken private final ComponentName mTopActivityComponent; private final GraphicBuffer mSnapshot; Loading @@ -1841,10 +1842,12 @@ public class ActivityManager { // Must be one of the named color spaces, otherwise, always use SRGB color space. private final ColorSpace mColorSpace; public TaskSnapshot(@NonNull ComponentName topActivityComponent, GraphicBuffer snapshot, public TaskSnapshot(long id, @NonNull ComponentName topActivityComponent, GraphicBuffer snapshot, @NonNull ColorSpace colorSpace, int orientation, Rect contentInsets, boolean reducedResolution, float scale, boolean isRealSnapshot, int windowingMode, int systemUiVisibility, boolean isTranslucent) { mId = id; mTopActivityComponent = topActivityComponent; mSnapshot = snapshot; mColorSpace = colorSpace.getId() < 0 Loading @@ -1860,6 +1863,7 @@ public class ActivityManager { } private TaskSnapshot(Parcel source) { mId = source.readLong(); mTopActivityComponent = ComponentName.readFromParcel(source); mSnapshot = source.readParcelable(null /* classLoader */); int colorSpaceId = source.readInt(); Loading @@ -1876,6 +1880,13 @@ public class ActivityManager { mIsTranslucent = source.readBoolean(); } /** * @return Identifier of this snapshot. */ public long getId() { return mId; } /** * @return The top activity component for the task at the point this snapshot was taken. */ Loading Loading @@ -1970,6 +1981,7 @@ public class ActivityManager { @Override public void writeToParcel(Parcel dest, int flags) { dest.writeLong(mId); ComponentName.writeToParcel(mTopActivityComponent, dest); dest.writeParcelable(mSnapshot, 0); dest.writeInt(mColorSpace.getId()); Loading @@ -1988,6 +2000,7 @@ public class ActivityManager { final int width = mSnapshot != null ? mSnapshot.getWidth() : 0; final int height = mSnapshot != null ? mSnapshot.getHeight() : 0; return "TaskSnapshot{" + " mId=" + mId + " mTopActivityComponent=" + mTopActivityComponent.flattenToShortString() + " mSnapshot=" + mSnapshot + " (" + width + "x" + height + ")" + " mColorSpace=" + mColorSpace.toString() Loading packages/SystemUI/shared/src/com/android/systemui/shared/recents/model/ThumbnailData.java +3 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ public class ThumbnailData { public int windowingMode; public int systemUiVisibility; public float scale; public long snapshotId; public ThumbnailData() { thumbnail = null; Loading @@ -49,6 +50,7 @@ public class ThumbnailData { isTranslucent = false; windowingMode = WINDOWING_MODE_UNDEFINED; systemUiVisibility = 0; snapshotId = 0; } public ThumbnailData(TaskSnapshot snapshot) { Loading @@ -61,5 +63,6 @@ public class ThumbnailData { isTranslucent = snapshot.isTranslucent(); windowingMode = snapshot.getWindowingMode(); systemUiVisibility = snapshot.getSystemUiVisibility(); snapshotId = snapshot.getId(); } } proto/src/task_snapshot.proto +2 −1 Original line number Diff line number Diff line Loading @@ -33,4 +33,5 @@ bool is_translucent = 9; string top_activity_component = 10; float scale = 11; int64 id = 12; } services/core/java/com/android/server/wm/TaskSnapshotController.java +4 −1 Original line number Diff line number Diff line Loading @@ -310,6 +310,7 @@ class TaskSnapshotController { } final boolean isWindowTranslucent = mainWindow.getAttrs().format != PixelFormat.OPAQUE; return new TaskSnapshot( System.currentTimeMillis() /* id */, appWindowToken.mActivityComponent, screenshotBuffer.getGraphicBuffer(), screenshotBuffer.getColorSpace(), appWindowToken.getTask().getConfiguration().orientation, Loading Loading @@ -404,7 +405,9 @@ class TaskSnapshotController { // Note, the app theme snapshot is never translucent because we enforce a non-translucent // color above return new TaskSnapshot(topChild.mActivityComponent, hwBitmap.createGraphicBufferHandle(), return new TaskSnapshot( System.currentTimeMillis() /* id */, topChild.mActivityComponent, hwBitmap.createGraphicBufferHandle(), hwBitmap.getColorSpace(), topChild.getTask().getConfiguration().orientation, getInsets(mainWindow), ActivityManager.isLowRamDeviceStatic() /* reduced */, mFullSnapshotScale, false /* isRealSnapshot */, task.getWindowingMode(), Loading services/core/java/com/android/server/wm/TaskSnapshotLoader.java +1 −1 Original line number Diff line number Diff line Loading @@ -92,7 +92,7 @@ class TaskSnapshotLoader { // For legacy snapshots, restore the scale based on the reduced resolution state final float legacyScale = reducedResolution ? mPersister.getReducedScale() : 1f; final float scale = Float.compare(proto.scale, 0f) != 0 ? proto.scale : legacyScale; return new TaskSnapshot(topActivityComponent, buffer, bitmap.getColorSpace(), return new TaskSnapshot(proto.id, topActivityComponent, buffer, bitmap.getColorSpace(), proto.orientation, new Rect(proto.insetLeft, proto.insetTop, proto.insetRight, proto.insetBottom), reducedResolution, scale, proto.isRealSnapshot, proto.windowingMode, Loading Loading
core/java/android/app/ActivityManager.java +15 −2 Original line number Diff line number Diff line Loading @@ -1822,7 +1822,8 @@ public class ActivityManager { * @hide */ public static class TaskSnapshot implements Parcelable { // Identifier of this snapshot private final long mId; // Top activity in task when snapshot was taken private final ComponentName mTopActivityComponent; private final GraphicBuffer mSnapshot; Loading @@ -1841,10 +1842,12 @@ public class ActivityManager { // Must be one of the named color spaces, otherwise, always use SRGB color space. private final ColorSpace mColorSpace; public TaskSnapshot(@NonNull ComponentName topActivityComponent, GraphicBuffer snapshot, public TaskSnapshot(long id, @NonNull ComponentName topActivityComponent, GraphicBuffer snapshot, @NonNull ColorSpace colorSpace, int orientation, Rect contentInsets, boolean reducedResolution, float scale, boolean isRealSnapshot, int windowingMode, int systemUiVisibility, boolean isTranslucent) { mId = id; mTopActivityComponent = topActivityComponent; mSnapshot = snapshot; mColorSpace = colorSpace.getId() < 0 Loading @@ -1860,6 +1863,7 @@ public class ActivityManager { } private TaskSnapshot(Parcel source) { mId = source.readLong(); mTopActivityComponent = ComponentName.readFromParcel(source); mSnapshot = source.readParcelable(null /* classLoader */); int colorSpaceId = source.readInt(); Loading @@ -1876,6 +1880,13 @@ public class ActivityManager { mIsTranslucent = source.readBoolean(); } /** * @return Identifier of this snapshot. */ public long getId() { return mId; } /** * @return The top activity component for the task at the point this snapshot was taken. */ Loading Loading @@ -1970,6 +1981,7 @@ public class ActivityManager { @Override public void writeToParcel(Parcel dest, int flags) { dest.writeLong(mId); ComponentName.writeToParcel(mTopActivityComponent, dest); dest.writeParcelable(mSnapshot, 0); dest.writeInt(mColorSpace.getId()); Loading @@ -1988,6 +2000,7 @@ public class ActivityManager { final int width = mSnapshot != null ? mSnapshot.getWidth() : 0; final int height = mSnapshot != null ? mSnapshot.getHeight() : 0; return "TaskSnapshot{" + " mId=" + mId + " mTopActivityComponent=" + mTopActivityComponent.flattenToShortString() + " mSnapshot=" + mSnapshot + " (" + width + "x" + height + ")" + " mColorSpace=" + mColorSpace.toString() Loading
packages/SystemUI/shared/src/com/android/systemui/shared/recents/model/ThumbnailData.java +3 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ public class ThumbnailData { public int windowingMode; public int systemUiVisibility; public float scale; public long snapshotId; public ThumbnailData() { thumbnail = null; Loading @@ -49,6 +50,7 @@ public class ThumbnailData { isTranslucent = false; windowingMode = WINDOWING_MODE_UNDEFINED; systemUiVisibility = 0; snapshotId = 0; } public ThumbnailData(TaskSnapshot snapshot) { Loading @@ -61,5 +63,6 @@ public class ThumbnailData { isTranslucent = snapshot.isTranslucent(); windowingMode = snapshot.getWindowingMode(); systemUiVisibility = snapshot.getSystemUiVisibility(); snapshotId = snapshot.getId(); } }
proto/src/task_snapshot.proto +2 −1 Original line number Diff line number Diff line Loading @@ -33,4 +33,5 @@ bool is_translucent = 9; string top_activity_component = 10; float scale = 11; int64 id = 12; }
services/core/java/com/android/server/wm/TaskSnapshotController.java +4 −1 Original line number Diff line number Diff line Loading @@ -310,6 +310,7 @@ class TaskSnapshotController { } final boolean isWindowTranslucent = mainWindow.getAttrs().format != PixelFormat.OPAQUE; return new TaskSnapshot( System.currentTimeMillis() /* id */, appWindowToken.mActivityComponent, screenshotBuffer.getGraphicBuffer(), screenshotBuffer.getColorSpace(), appWindowToken.getTask().getConfiguration().orientation, Loading Loading @@ -404,7 +405,9 @@ class TaskSnapshotController { // Note, the app theme snapshot is never translucent because we enforce a non-translucent // color above return new TaskSnapshot(topChild.mActivityComponent, hwBitmap.createGraphicBufferHandle(), return new TaskSnapshot( System.currentTimeMillis() /* id */, topChild.mActivityComponent, hwBitmap.createGraphicBufferHandle(), hwBitmap.getColorSpace(), topChild.getTask().getConfiguration().orientation, getInsets(mainWindow), ActivityManager.isLowRamDeviceStatic() /* reduced */, mFullSnapshotScale, false /* isRealSnapshot */, task.getWindowingMode(), Loading
services/core/java/com/android/server/wm/TaskSnapshotLoader.java +1 −1 Original line number Diff line number Diff line Loading @@ -92,7 +92,7 @@ class TaskSnapshotLoader { // For legacy snapshots, restore the scale based on the reduced resolution state final float legacyScale = reducedResolution ? mPersister.getReducedScale() : 1f; final float scale = Float.compare(proto.scale, 0f) != 0 ? proto.scale : legacyScale; return new TaskSnapshot(topActivityComponent, buffer, bitmap.getColorSpace(), return new TaskSnapshot(proto.id, topActivityComponent, buffer, bitmap.getColorSpace(), proto.orientation, new Rect(proto.insetLeft, proto.insetTop, proto.insetRight, proto.insetBottom), reducedResolution, scale, proto.isRealSnapshot, proto.windowingMode, Loading