Merge "Sandbox more input-related configs instead of fontScale with SCM" into main
diff --git a/services/core/java/com/android/server/wm/AppCompatSizeCompatModePolicy.java b/services/core/java/com/android/server/wm/AppCompatSizeCompatModePolicy.java
index b03aa52..0f1e36d 100644
--- a/services/core/java/com/android/server/wm/AppCompatSizeCompatModePolicy.java
+++ b/services/core/java/com/android/server/wm/AppCompatSizeCompatModePolicy.java
@@ -361,7 +361,10 @@
if (enableSizeCompatModeImprovementsForConnectedDisplays()) {
overrideConfig.touchscreen = fullConfig.touchscreen;
overrideConfig.navigation = fullConfig.navigation;
- overrideConfig.fontScale = fullConfig.fontScale;
+ overrideConfig.keyboard = fullConfig.keyboard;
+ overrideConfig.keyboardHidden = fullConfig.keyboardHidden;
+ overrideConfig.hardKeyboardHidden = fullConfig.hardKeyboardHidden;
+ overrideConfig.navigationHidden = fullConfig.navigationHidden;
}
// The smallest screen width is the short side of screen bounds. Because the bounds
// and density won't be changed, smallestScreenWidthDp is also fixed.
diff --git a/services/tests/wmtests/src/com/android/server/wm/SizeCompatTests.java b/services/tests/wmtests/src/com/android/server/wm/SizeCompatTests.java
index 33a48aa..e2c4a1d 100644
--- a/services/tests/wmtests/src/com/android/server/wm/SizeCompatTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/SizeCompatTests.java
@@ -572,8 +572,8 @@
new TestDisplayContent.Builder(mAtm, 1000, 2000).build();
final InputDevice device = new InputDevice.Builder()
.setAssociatedDisplayId(newDisplay.mDisplayId)
- .setSources(InputDevice.SOURCE_TOUCHSCREEN | InputDevice.SOURCE_TRACKBALL
- | InputDevice.KEYBOARD_TYPE_ALPHABETIC)
+ .setKeyboardType(InputDevice.KEYBOARD_TYPE_ALPHABETIC)
+ .setSources(InputDevice.SOURCE_TOUCHSCREEN | InputDevice.SOURCE_TRACKBALL)
.build();
final InputDevice[] devices = {device};
doReturn(true).when(newDisplay.mWmService.mInputManager)
@@ -596,6 +596,7 @@
assertEquals(originalTouchscreen, newConfiguration.touchscreen);
assertEquals(originalNavigation, newConfiguration.navigation);
assertEquals(originalKeyboard, newConfiguration.keyboard);
+ // TODO(b/399749909): assert keyboardHidden, hardkeyboardHidden, and navigationHidden too.
}
@Test