Loading core/java/android/app/ActivityManager.java +21 −3 Original line number Diff line number Diff line Loading @@ -2102,18 +2102,24 @@ public class ActivityManager { private final GraphicBuffer mSnapshot; private final int mOrientation; 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; // 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; private final int mWindowingMode; private final float mScale; public TaskSnapshot(GraphicBuffer snapshot, int orientation, Rect contentInsets, boolean reducedResolution, float scale, boolean isRealSnapshot) { boolean reducedResolution, float scale, boolean isRealSnapshot, int windowingMode) { mSnapshot = snapshot; mOrientation = orientation; mContentInsets = new Rect(contentInsets); mReducedResolution = reducedResolution; mScale = scale; mIsRealSnapshot = isRealSnapshot; mWindowingMode = windowingMode; } private TaskSnapshot(Parcel source) { Loading @@ -2123,6 +2129,7 @@ public class ActivityManager { mReducedResolution = source.readBoolean(); mScale = source.readFloat(); mIsRealSnapshot = source.readBoolean(); mWindowingMode = source.readInt(); } /** Loading Loading @@ -2162,6 +2169,13 @@ public class ActivityManager { return mIsRealSnapshot; } /** * @return The windowing mode of the task when this snapshot was taken. */ public int getWindowingMode() { return mWindowingMode; } /** * @return The scale this snapshot was taken in. */ Loading @@ -2182,14 +2196,18 @@ public class ActivityManager { dest.writeBoolean(mReducedResolution); dest.writeFloat(mScale); dest.writeBoolean(mIsRealSnapshot); dest.writeInt(mWindowingMode); } @Override public String toString() { return "TaskSnapshot{mSnapshot=" + mSnapshot + " mOrientation=" + mOrientation final int width = mSnapshot != null ? mSnapshot.getWidth() : 0; final int height = mSnapshot != null ? mSnapshot.getHeight() : 0; return "TaskSnapshot{mSnapshot=" + mSnapshot + " (" + width + "x" + height + ")" + " mOrientation=" + mOrientation + " mContentInsets=" + mContentInsets.toShortString() + " mReducedResolution=" + mReducedResolution + " mScale=" + mScale + " mIsRealSnapshot=" + mIsRealSnapshot; + " mIsRealSnapshot=" + mIsRealSnapshot + " mWindowingMode=" + mWindowingMode; } public static final Creator<TaskSnapshot> CREATOR = new Creator<TaskSnapshot>() { Loading packages/SystemUI/shared/src/com/android/systemui/shared/recents/model/ThumbnailData.java +4 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.shared.recents.model; import static android.content.res.Configuration.ORIENTATION_UNDEFINED; import static com.android.systemui.shared.system.WindowManagerWrapper.WINDOWING_MODE_UNDEFINED; import android.app.ActivityManager.TaskSnapshot; import android.graphics.Bitmap; Loading @@ -32,6 +33,7 @@ public class ThumbnailData { public Rect insets; public boolean reducedResolution; public boolean isRealSnapshot; public int windowingMode; public float scale; public ThumbnailData() { Loading @@ -41,6 +43,7 @@ public class ThumbnailData { reducedResolution = false; scale = 1f; isRealSnapshot = true; windowingMode = WINDOWING_MODE_UNDEFINED; } public ThumbnailData(TaskSnapshot snapshot) { Loading @@ -50,5 +53,6 @@ public class ThumbnailData { reducedResolution = snapshot.isReducedResolution(); scale = snapshot.getScale(); isRealSnapshot = snapshot.isRealSnapshot(); windowingMode = snapshot.getWindowingMode(); } } packages/SystemUI/shared/src/com/android/systemui/shared/system/WindowManagerWrapper.java +10 −0 Original line number Diff line number Diff line Loading @@ -60,6 +60,16 @@ public class WindowManagerWrapper { public static final int ACTIVITY_TYPE_STANDARD = WindowConfiguration.ACTIVITY_TYPE_STANDARD; public static final int WINDOWING_MODE_UNDEFINED = WindowConfiguration.WINDOWING_MODE_UNDEFINED; public static final int WINDOWING_MODE_FULLSCREEN = WindowConfiguration.WINDOWING_MODE_FULLSCREEN; public static final int WINDOWING_MODE_PINNED = WindowConfiguration.WINDOWING_MODE_PINNED; public static final int WINDOWING_MODE_SPLIT_SCREEN_PRIMARY = WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY; public static final int WINDOWING_MODE_SPLIT_SCREEN_SECONDARY = WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_SECONDARY; public static final int WINDOWING_MODE_FREEFORM = WindowConfiguration.WINDOWING_MODE_FREEFORM; private static final WindowManagerWrapper sInstance = new WindowManagerWrapper(); public static WindowManagerWrapper getInstance() { Loading proto/src/task_snapshot.proto +1 −0 Original line number Diff line number Diff line Loading @@ -28,4 +28,5 @@ int32 inset_right = 4; int32 inset_bottom = 5; bool is_real_snapshot = 6; int32 windowing_mode = 7; } No newline at end of file services/core/java/com/android/server/wm/TaskSnapshotController.java +3 −4 Original line number Diff line number Diff line Loading @@ -273,9 +273,8 @@ class TaskSnapshotController { return null; } return new TaskSnapshot(buffer, top.getConfiguration().orientation, getInsets(mainWindow), isLowRamDevice /* reduced */, scaleFraction /* scale */, true /* isRealSnapshot */); getInsets(mainWindow), isLowRamDevice /* reduced */, scaleFraction /* scale */, true /* isRealSnapshot */, task.getWindowingMode()); } private boolean shouldDisableSnapshots() { Loading Loading @@ -365,7 +364,7 @@ class TaskSnapshotController { return new TaskSnapshot(hwBitmap.createGraphicBufferHandle(), topChild.getConfiguration().orientation, mainWindow.mStableInsets, ActivityManager.isLowRamDeviceStatic() /* reduced */, 1.0f /* scale */, false /* isRealSnapshot */); false /* isRealSnapshot */, task.getWindowingMode()); } /** Loading Loading
core/java/android/app/ActivityManager.java +21 −3 Original line number Diff line number Diff line Loading @@ -2102,18 +2102,24 @@ public class ActivityManager { private final GraphicBuffer mSnapshot; private final int mOrientation; 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; // 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; private final int mWindowingMode; private final float mScale; public TaskSnapshot(GraphicBuffer snapshot, int orientation, Rect contentInsets, boolean reducedResolution, float scale, boolean isRealSnapshot) { boolean reducedResolution, float scale, boolean isRealSnapshot, int windowingMode) { mSnapshot = snapshot; mOrientation = orientation; mContentInsets = new Rect(contentInsets); mReducedResolution = reducedResolution; mScale = scale; mIsRealSnapshot = isRealSnapshot; mWindowingMode = windowingMode; } private TaskSnapshot(Parcel source) { Loading @@ -2123,6 +2129,7 @@ public class ActivityManager { mReducedResolution = source.readBoolean(); mScale = source.readFloat(); mIsRealSnapshot = source.readBoolean(); mWindowingMode = source.readInt(); } /** Loading Loading @@ -2162,6 +2169,13 @@ public class ActivityManager { return mIsRealSnapshot; } /** * @return The windowing mode of the task when this snapshot was taken. */ public int getWindowingMode() { return mWindowingMode; } /** * @return The scale this snapshot was taken in. */ Loading @@ -2182,14 +2196,18 @@ public class ActivityManager { dest.writeBoolean(mReducedResolution); dest.writeFloat(mScale); dest.writeBoolean(mIsRealSnapshot); dest.writeInt(mWindowingMode); } @Override public String toString() { return "TaskSnapshot{mSnapshot=" + mSnapshot + " mOrientation=" + mOrientation final int width = mSnapshot != null ? mSnapshot.getWidth() : 0; final int height = mSnapshot != null ? mSnapshot.getHeight() : 0; return "TaskSnapshot{mSnapshot=" + mSnapshot + " (" + width + "x" + height + ")" + " mOrientation=" + mOrientation + " mContentInsets=" + mContentInsets.toShortString() + " mReducedResolution=" + mReducedResolution + " mScale=" + mScale + " mIsRealSnapshot=" + mIsRealSnapshot; + " mIsRealSnapshot=" + mIsRealSnapshot + " mWindowingMode=" + mWindowingMode; } public static final Creator<TaskSnapshot> CREATOR = new Creator<TaskSnapshot>() { Loading
packages/SystemUI/shared/src/com/android/systemui/shared/recents/model/ThumbnailData.java +4 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.shared.recents.model; import static android.content.res.Configuration.ORIENTATION_UNDEFINED; import static com.android.systemui.shared.system.WindowManagerWrapper.WINDOWING_MODE_UNDEFINED; import android.app.ActivityManager.TaskSnapshot; import android.graphics.Bitmap; Loading @@ -32,6 +33,7 @@ public class ThumbnailData { public Rect insets; public boolean reducedResolution; public boolean isRealSnapshot; public int windowingMode; public float scale; public ThumbnailData() { Loading @@ -41,6 +43,7 @@ public class ThumbnailData { reducedResolution = false; scale = 1f; isRealSnapshot = true; windowingMode = WINDOWING_MODE_UNDEFINED; } public ThumbnailData(TaskSnapshot snapshot) { Loading @@ -50,5 +53,6 @@ public class ThumbnailData { reducedResolution = snapshot.isReducedResolution(); scale = snapshot.getScale(); isRealSnapshot = snapshot.isRealSnapshot(); windowingMode = snapshot.getWindowingMode(); } }
packages/SystemUI/shared/src/com/android/systemui/shared/system/WindowManagerWrapper.java +10 −0 Original line number Diff line number Diff line Loading @@ -60,6 +60,16 @@ public class WindowManagerWrapper { public static final int ACTIVITY_TYPE_STANDARD = WindowConfiguration.ACTIVITY_TYPE_STANDARD; public static final int WINDOWING_MODE_UNDEFINED = WindowConfiguration.WINDOWING_MODE_UNDEFINED; public static final int WINDOWING_MODE_FULLSCREEN = WindowConfiguration.WINDOWING_MODE_FULLSCREEN; public static final int WINDOWING_MODE_PINNED = WindowConfiguration.WINDOWING_MODE_PINNED; public static final int WINDOWING_MODE_SPLIT_SCREEN_PRIMARY = WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY; public static final int WINDOWING_MODE_SPLIT_SCREEN_SECONDARY = WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_SECONDARY; public static final int WINDOWING_MODE_FREEFORM = WindowConfiguration.WINDOWING_MODE_FREEFORM; private static final WindowManagerWrapper sInstance = new WindowManagerWrapper(); public static WindowManagerWrapper getInstance() { Loading
proto/src/task_snapshot.proto +1 −0 Original line number Diff line number Diff line Loading @@ -28,4 +28,5 @@ int32 inset_right = 4; int32 inset_bottom = 5; bool is_real_snapshot = 6; int32 windowing_mode = 7; } No newline at end of file
services/core/java/com/android/server/wm/TaskSnapshotController.java +3 −4 Original line number Diff line number Diff line Loading @@ -273,9 +273,8 @@ class TaskSnapshotController { return null; } return new TaskSnapshot(buffer, top.getConfiguration().orientation, getInsets(mainWindow), isLowRamDevice /* reduced */, scaleFraction /* scale */, true /* isRealSnapshot */); getInsets(mainWindow), isLowRamDevice /* reduced */, scaleFraction /* scale */, true /* isRealSnapshot */, task.getWindowingMode()); } private boolean shouldDisableSnapshots() { Loading Loading @@ -365,7 +364,7 @@ class TaskSnapshotController { return new TaskSnapshot(hwBitmap.createGraphicBufferHandle(), topChild.getConfiguration().orientation, mainWindow.mStableInsets, ActivityManager.isLowRamDeviceStatic() /* reduced */, 1.0f /* scale */, false /* isRealSnapshot */); false /* isRealSnapshot */, task.getWindowingMode()); } /** Loading