Merge "Fix WindowMagnificationControllerTest failure on foldable targets" into sc-v2-dev am: 7aedd37457 am: 96a0c06a0e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15624358 Change-Id: I1386b5a248d8f1afe2c67850c6b5627e95f29505
This commit is contained in:
@@ -186,6 +186,7 @@ public class WindowMagnificationControllerTest extends SysuiTestCase {
|
||||
public void deleteWindowMagnification_enableAtTheBottom_overlapFlagIsFalse() {
|
||||
final WindowManager wm = mContext.getSystemService(WindowManager.class);
|
||||
final Rect bounds = wm.getCurrentWindowMetrics().getBounds();
|
||||
setSystemGestureInsets();
|
||||
|
||||
mInstrumentation.runOnMainSync(() -> {
|
||||
mWindowMagnificationController.enableWindowMagnification(Float.NaN, Float.NaN,
|
||||
@@ -461,10 +462,7 @@ public class WindowMagnificationControllerTest extends SysuiTestCase {
|
||||
@Test
|
||||
public void moveWindowMagnificationToTheBottom_enabledWithGestureInset_overlapFlagIsTrue() {
|
||||
final Rect bounds = mWindowManager.getCurrentWindowMetrics().getBounds();
|
||||
final WindowInsets testInsets = new WindowInsets.Builder()
|
||||
.setInsets(systemGestures(), Insets.of(0, 0, 0, 10))
|
||||
.build();
|
||||
mWindowManager.setWindowInsets(testInsets);
|
||||
setSystemGestureInsets();
|
||||
mInstrumentation.runOnMainSync(() -> {
|
||||
mWindowMagnificationController.enableWindowMagnification(Float.NaN, Float.NaN,
|
||||
Float.NaN);
|
||||
@@ -490,4 +488,11 @@ public class WindowMagnificationControllerTest extends SysuiTestCase {
|
||||
private boolean hasMagnificationOverlapFlag() {
|
||||
return (mSysUiState.getFlags() & SYSUI_STATE_MAGNIFICATION_OVERLAP) != 0;
|
||||
}
|
||||
|
||||
private void setSystemGestureInsets() {
|
||||
final WindowInsets testInsets = new WindowInsets.Builder()
|
||||
.setInsets(systemGestures(), Insets.of(0, 0, 0, 10))
|
||||
.build();
|
||||
mWindowManager.setWindowInsets(testInsets);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user