Loading core/java/android/app/ActivityManager.java +2 −1 Original line number Diff line number Diff line Loading @@ -2177,7 +2177,8 @@ public class ActivityManager { } /** * @return Whether or not the snapshot is of a translucent app window. * @return Whether or not the snapshot is of a translucent app window (non-fullscreen or has * a non-opaque pixel format). */ public boolean isTranslucent() { return mIsTranslucent; Loading services/core/java/com/android/server/wm/TaskSnapshotController.java +6 −3 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.app.ActivityManager.TaskSnapshot; import android.content.pm.PackageManager; import android.graphics.Bitmap; import android.graphics.GraphicBuffer; import android.graphics.PixelFormat; import android.graphics.Rect; import android.os.Environment; import android.os.Handler; Loading Loading @@ -266,7 +267,7 @@ class TaskSnapshotController { final GraphicBuffer buffer = SurfaceControl.captureLayers( task.getSurfaceControl().getHandle(), mTmpRect, scaleFraction); final boolean isWindowTranslucent = mainWindow.getAttrs().format != PixelFormat.OPAQUE; if (buffer == null || buffer.getWidth() <= 1 || buffer.getHeight() <= 1) { if (DEBUG_SCREENSHOT) { Slog.w(TAG_WM, "Failed to take screenshot for " + task); Loading @@ -276,7 +277,7 @@ class TaskSnapshotController { return new TaskSnapshot(buffer, top.getConfiguration().orientation, getInsets(mainWindow), isLowRamDevice /* reduced */, scaleFraction /* scale */, true /* isRealSnapshot */, task.getWindowingMode(), getSystemUiVisibility(task), !top.fillsParent()); !top.fillsParent() || isWindowTranslucent); } private boolean shouldDisableSnapshots() { Loading Loading @@ -363,11 +364,13 @@ class TaskSnapshotController { if (hwBitmap == null) { return null; } // Note, the app theme snapshot is never translucent because we enforce a non-translucent // color above return new TaskSnapshot(hwBitmap.createGraphicBufferHandle(), topChild.getConfiguration().orientation, mainWindow.mStableInsets, ActivityManager.isLowRamDeviceStatic() /* reduced */, 1.0f /* scale */, false /* isRealSnapshot */, task.getWindowingMode(), getSystemUiVisibility(task), !topChild.fillsParent()); false); } /** Loading Loading
core/java/android/app/ActivityManager.java +2 −1 Original line number Diff line number Diff line Loading @@ -2177,7 +2177,8 @@ public class ActivityManager { } /** * @return Whether or not the snapshot is of a translucent app window. * @return Whether or not the snapshot is of a translucent app window (non-fullscreen or has * a non-opaque pixel format). */ public boolean isTranslucent() { return mIsTranslucent; Loading
services/core/java/com/android/server/wm/TaskSnapshotController.java +6 −3 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.app.ActivityManager.TaskSnapshot; import android.content.pm.PackageManager; import android.graphics.Bitmap; import android.graphics.GraphicBuffer; import android.graphics.PixelFormat; import android.graphics.Rect; import android.os.Environment; import android.os.Handler; Loading Loading @@ -266,7 +267,7 @@ class TaskSnapshotController { final GraphicBuffer buffer = SurfaceControl.captureLayers( task.getSurfaceControl().getHandle(), mTmpRect, scaleFraction); final boolean isWindowTranslucent = mainWindow.getAttrs().format != PixelFormat.OPAQUE; if (buffer == null || buffer.getWidth() <= 1 || buffer.getHeight() <= 1) { if (DEBUG_SCREENSHOT) { Slog.w(TAG_WM, "Failed to take screenshot for " + task); Loading @@ -276,7 +277,7 @@ class TaskSnapshotController { return new TaskSnapshot(buffer, top.getConfiguration().orientation, getInsets(mainWindow), isLowRamDevice /* reduced */, scaleFraction /* scale */, true /* isRealSnapshot */, task.getWindowingMode(), getSystemUiVisibility(task), !top.fillsParent()); !top.fillsParent() || isWindowTranslucent); } private boolean shouldDisableSnapshots() { Loading Loading @@ -363,11 +364,13 @@ class TaskSnapshotController { if (hwBitmap == null) { return null; } // Note, the app theme snapshot is never translucent because we enforce a non-translucent // color above return new TaskSnapshot(hwBitmap.createGraphicBufferHandle(), topChild.getConfiguration().orientation, mainWindow.mStableInsets, ActivityManager.isLowRamDeviceStatic() /* reduced */, 1.0f /* scale */, false /* isRealSnapshot */, task.getWindowingMode(), getSystemUiVisibility(task), !topChild.fillsParent()); false); } /** Loading