Increase the max size of emulated displays

This CL incrases the max display size that can be emulated. The previous
logic would only allow a size that is maximum 2x bigger than the host
device emulating the display. For screenshot diff testing, we need to
emulate big devices (like Lenovo P12 Pro) on small devices/emulators, so
we need to increase this maximum size.

Bug: 230832101
Test: Manual
Change-Id: I4b6b871b75a638a1c818931c5c8970873d886cf3
This commit is contained in:
Jordan Demeulenaere
2022-06-22 17:33:23 +02:00
parent 630304370c
commit 825dd5d1c6

View File

@@ -2941,9 +2941,10 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
// Set some sort of reasonable bounds on the size of the display that we will try
// to emulate.
final int minSize = 200;
final int maxScale = 2;
width = Math.min(Math.max(width, minSize), mInitialDisplayWidth * maxScale);
height = Math.min(Math.max(height, minSize), mInitialDisplayHeight * maxScale);
final int maxScale = 3;
final int maxSize = Math.max(mInitialDisplayWidth, mInitialDisplayHeight) * maxScale;
width = Math.min(Math.max(width, minSize), maxSize);
height = Math.min(Math.max(height, minSize), maxSize);
}
Slog.i(TAG_WM, "Using new display size: " + width + "x" + height);