diff options
author | 2024-11-26 05:57:29 +0000 | |
---|---|---|
committer | 2024-11-26 05:57:29 +0000 | |
commit | c0b9f318b68597ced8c8215fdca1c3ab0d4674f4 (patch) | |
tree | 7e62f0c4f78415a888c8144398990eef64e9b95b /tests/src/com/android/inputmethod | |
parent | 1923336007591badf4304bb360077dea176dd956 (diff) | |
download | latinime-c0b9f318b68597ced8c8215fdca1c3ab0d4674f4.tar.gz latinime-c0b9f318b68597ced8c8215fdca1c3ab0d4674f4.tar.xz latinime-c0b9f318b68597ced8c8215fdca1c3ab0d4674f4.zip |
Fix bug: AOSP keyboard is shown incompletely in Android V landscape mode
Root cause: The AOSP keyboard uses `DisplayMetrics#widthPixels` to calculate the keyboard width and draw keys. Since Android 15’s edge-to-edge enforcement, this property now returns the full screen width, including window insets. This results in an incorrectly large key width calculation.
Fix: Subtract window insets including system bar and display cutout from the width.
Change-Id: Iea01ba749a48145cf5b484dc22a570874b1b7ca4
Test: use `m LatinIME` to install the AOSP keyboard and test landscape mode manually
Bug: 377594757
Diffstat (limited to '')
-rw-r--r-- | tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetTestsBase.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetTestsBase.java b/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetTestsBase.java index 29787acc9..1f13b4106 100644 --- a/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetTestsBase.java +++ b/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetTestsBase.java @@ -155,7 +155,7 @@ public abstract class KeyboardLayoutSetTestsBase extends AndroidTestCase { final boolean languageSwitchKeyEnabled, final boolean splitLayoutEnabled) { final Context context = getContext(); final Resources res = context.getResources(); - final int keyboardWidth = ResourceUtils.getDefaultKeyboardWidth(res); + final int keyboardWidth = ResourceUtils.getDefaultKeyboardWidth(context); final int keyboardHeight = ResourceUtils.getDefaultKeyboardHeight(res); final Builder builder = new Builder(context, editorInfo); builder.setKeyboardGeometry(keyboardWidth, keyboardHeight) |