Merge "Ensure snapshot orientation matches snapshot buffer size" into qt-dev
diff --git a/services/core/java/com/android/server/wm/TaskSnapshotController.java b/services/core/java/com/android/server/wm/TaskSnapshotController.java
index d526e7c..101c4b8 100644
--- a/services/core/java/com/android/server/wm/TaskSnapshotController.java
+++ b/services/core/java/com/android/server/wm/TaskSnapshotController.java
@@ -306,7 +306,8 @@
final boolean isWindowTranslucent = mainWindow.getAttrs().format != PixelFormat.OPAQUE;
return new TaskSnapshot(
appWindowToken.mActivityComponent, screenshotBuffer.getGraphicBuffer(),
- screenshotBuffer.getColorSpace(), appWindowToken.getConfiguration().orientation,
+ screenshotBuffer.getColorSpace(),
+ appWindowToken.getTask().getConfiguration().orientation,
getInsets(mainWindow), isLowRamDevice /* reduced */, scaleFraction /* scale */,
true /* isRealSnapshot */, task.getWindowingMode(), getSystemUiVisibility(task),
!appWindowToken.fillsParent() || isWindowTranslucent);
@@ -394,10 +395,11 @@
if (hwBitmap == null) {
return null;
}
+
// Note, the app theme snapshot is never translucent because we enforce a non-translucent
// color above
return new TaskSnapshot(topChild.mActivityComponent, hwBitmap.createGraphicBufferHandle(),
- hwBitmap.getColorSpace(), topChild.getConfiguration().orientation,
+ hwBitmap.getColorSpace(), topChild.getTask().getConfiguration().orientation,
getInsets(mainWindow), ActivityManager.isLowRamDeviceStatic() /* reduced */,
1.0f /* scale */, false /* isRealSnapshot */, task.getWindowingMode(),
getSystemUiVisibility(task), false);