Loading core/java/android/app/ActivityManager.java +15 −2 Original line number Diff line number Diff line Loading @@ -2101,15 +2101,17 @@ public class ActivityManager { private final int mOrientation; private final Rect mContentInsets; private final boolean mReducedResolution; private final boolean mIsRealSnapshot; private final float mScale; public TaskSnapshot(GraphicBuffer snapshot, int orientation, Rect contentInsets, boolean reducedResolution, float scale) { boolean reducedResolution, float scale, boolean isRealSnapshot) { mSnapshot = snapshot; mOrientation = orientation; mContentInsets = new Rect(contentInsets); mReducedResolution = reducedResolution; mScale = scale; mIsRealSnapshot = isRealSnapshot; } private TaskSnapshot(Parcel source) { Loading @@ -2118,6 +2120,7 @@ public class ActivityManager { mContentInsets = source.readParcelable(null /* classLoader */); mReducedResolution = source.readBoolean(); mScale = source.readFloat(); mIsRealSnapshot = source.readBoolean(); } /** Loading Loading @@ -2149,6 +2152,14 @@ public class ActivityManager { return mReducedResolution; } /** * @return 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. */ public boolean isRealSnapshot() { return mIsRealSnapshot; } /** * @return The scale this snapshot was taken in. */ Loading @@ -2168,13 +2179,15 @@ public class ActivityManager { dest.writeParcelable(mContentInsets, 0); dest.writeBoolean(mReducedResolution); dest.writeFloat(mScale); dest.writeBoolean(mIsRealSnapshot); } @Override public String toString() { return "TaskSnapshot{mSnapshot=" + mSnapshot + " mOrientation=" + mOrientation + " mContentInsets=" + mContentInsets.toShortString() + " mReducedResolution=" + mReducedResolution + " mScale=" + mScale; + " mReducedResolution=" + mReducedResolution + " mScale=" + mScale + " mIsRealSnapshot=" + mIsRealSnapshot; } public static final Creator<TaskSnapshot> CREATOR = new Creator<TaskSnapshot>() { Loading packages/SystemUI/shared/src/com/android/systemui/shared/recents/model/ThumbnailData.java +3 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ public class ThumbnailData { public int orientation; public Rect insets; public boolean reducedResolution; public boolean isRealSnapshot; public float scale; public ThumbnailData() { Loading @@ -39,6 +40,7 @@ public class ThumbnailData { insets = new Rect(); reducedResolution = false; scale = 1f; isRealSnapshot = true; } public ThumbnailData(TaskSnapshot snapshot) { Loading @@ -47,5 +49,6 @@ public class ThumbnailData { orientation = snapshot.getOrientation(); reducedResolution = snapshot.isReducedResolution(); scale = snapshot.getScale(); isRealSnapshot = snapshot.isRealSnapshot(); } } proto/src/task_snapshot.proto +1 −0 Original line number Diff line number Diff line Loading @@ -27,4 +27,5 @@ int32 inset_top = 3; int32 inset_right = 4; int32 inset_bottom = 5; bool is_real_snapshot = 6; } No newline at end of file services/core/java/com/android/server/wm/TaskSnapshotController.java +4 −2 Original line number Diff line number Diff line Loading @@ -273,7 +273,8 @@ class TaskSnapshotController { } return new TaskSnapshot(buffer, top.getConfiguration().orientation, getInsetsFromTaskBounds(mainWindow, task), isLowRamDevice /* reduced */, scaleFraction /* scale */); isLowRamDevice /* reduced */, scaleFraction /* scale */, true /* isRealSnapshot */); } private boolean shouldDisableSnapshots() { Loading Loading @@ -369,7 +370,8 @@ class TaskSnapshotController { } return new TaskSnapshot(hwBitmap.createGraphicBufferHandle(), topChild.getConfiguration().orientation, mainWindow.mStableInsets, ActivityManager.isLowRamDeviceStatic() /* reduced */, 1.0f /* scale */); ActivityManager.isLowRamDeviceStatic() /* reduced */, 1.0f /* scale */, false /* isRealSnapshot */); } /** Loading services/core/java/com/android/server/wm/TaskSnapshotLoader.java +2 −1 Original line number Diff line number Diff line Loading @@ -89,7 +89,8 @@ class TaskSnapshotLoader { } return new TaskSnapshot(buffer, proto.orientation, new Rect(proto.insetLeft, proto.insetTop, proto.insetRight, proto.insetBottom), reducedResolution, reducedResolution ? REDUCED_SCALE : 1f); reducedResolution, reducedResolution ? REDUCED_SCALE : 1f, proto.isRealSnapshot); } catch (IOException e) { Slog.w(TAG, "Unable to load task snapshot data for taskId=" + taskId); return null; Loading Loading
core/java/android/app/ActivityManager.java +15 −2 Original line number Diff line number Diff line Loading @@ -2101,15 +2101,17 @@ public class ActivityManager { private final int mOrientation; private final Rect mContentInsets; private final boolean mReducedResolution; private final boolean mIsRealSnapshot; private final float mScale; public TaskSnapshot(GraphicBuffer snapshot, int orientation, Rect contentInsets, boolean reducedResolution, float scale) { boolean reducedResolution, float scale, boolean isRealSnapshot) { mSnapshot = snapshot; mOrientation = orientation; mContentInsets = new Rect(contentInsets); mReducedResolution = reducedResolution; mScale = scale; mIsRealSnapshot = isRealSnapshot; } private TaskSnapshot(Parcel source) { Loading @@ -2118,6 +2120,7 @@ public class ActivityManager { mContentInsets = source.readParcelable(null /* classLoader */); mReducedResolution = source.readBoolean(); mScale = source.readFloat(); mIsRealSnapshot = source.readBoolean(); } /** Loading Loading @@ -2149,6 +2152,14 @@ public class ActivityManager { return mReducedResolution; } /** * @return 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. */ public boolean isRealSnapshot() { return mIsRealSnapshot; } /** * @return The scale this snapshot was taken in. */ Loading @@ -2168,13 +2179,15 @@ public class ActivityManager { dest.writeParcelable(mContentInsets, 0); dest.writeBoolean(mReducedResolution); dest.writeFloat(mScale); dest.writeBoolean(mIsRealSnapshot); } @Override public String toString() { return "TaskSnapshot{mSnapshot=" + mSnapshot + " mOrientation=" + mOrientation + " mContentInsets=" + mContentInsets.toShortString() + " mReducedResolution=" + mReducedResolution + " mScale=" + mScale; + " mReducedResolution=" + mReducedResolution + " mScale=" + mScale + " mIsRealSnapshot=" + mIsRealSnapshot; } public static final Creator<TaskSnapshot> CREATOR = new Creator<TaskSnapshot>() { Loading
packages/SystemUI/shared/src/com/android/systemui/shared/recents/model/ThumbnailData.java +3 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ public class ThumbnailData { public int orientation; public Rect insets; public boolean reducedResolution; public boolean isRealSnapshot; public float scale; public ThumbnailData() { Loading @@ -39,6 +40,7 @@ public class ThumbnailData { insets = new Rect(); reducedResolution = false; scale = 1f; isRealSnapshot = true; } public ThumbnailData(TaskSnapshot snapshot) { Loading @@ -47,5 +49,6 @@ public class ThumbnailData { orientation = snapshot.getOrientation(); reducedResolution = snapshot.isReducedResolution(); scale = snapshot.getScale(); isRealSnapshot = snapshot.isRealSnapshot(); } }
proto/src/task_snapshot.proto +1 −0 Original line number Diff line number Diff line Loading @@ -27,4 +27,5 @@ int32 inset_top = 3; int32 inset_right = 4; int32 inset_bottom = 5; bool is_real_snapshot = 6; } No newline at end of file
services/core/java/com/android/server/wm/TaskSnapshotController.java +4 −2 Original line number Diff line number Diff line Loading @@ -273,7 +273,8 @@ class TaskSnapshotController { } return new TaskSnapshot(buffer, top.getConfiguration().orientation, getInsetsFromTaskBounds(mainWindow, task), isLowRamDevice /* reduced */, scaleFraction /* scale */); isLowRamDevice /* reduced */, scaleFraction /* scale */, true /* isRealSnapshot */); } private boolean shouldDisableSnapshots() { Loading Loading @@ -369,7 +370,8 @@ class TaskSnapshotController { } return new TaskSnapshot(hwBitmap.createGraphicBufferHandle(), topChild.getConfiguration().orientation, mainWindow.mStableInsets, ActivityManager.isLowRamDeviceStatic() /* reduced */, 1.0f /* scale */); ActivityManager.isLowRamDeviceStatic() /* reduced */, 1.0f /* scale */, false /* isRealSnapshot */); } /** Loading
services/core/java/com/android/server/wm/TaskSnapshotLoader.java +2 −1 Original line number Diff line number Diff line Loading @@ -89,7 +89,8 @@ class TaskSnapshotLoader { } return new TaskSnapshot(buffer, proto.orientation, new Rect(proto.insetLeft, proto.insetTop, proto.insetRight, proto.insetBottom), reducedResolution, reducedResolution ? REDUCED_SCALE : 1f); reducedResolution, reducedResolution ? REDUCED_SCALE : 1f, proto.isRealSnapshot); } catch (IOException e) { Slog.w(TAG, "Unable to load task snapshot data for taskId=" + taskId); return null; Loading