Loading core/java/android/hardware/input/IInputManager.aidl +2 −2 Original line number Diff line number Diff line Loading @@ -120,8 +120,8 @@ interface IInputManager { in InputMethodInfo imeInfo, in InputMethodSubtype imeSubtype, String keyboardLayoutDescriptor); String[] getKeyboardLayoutListForInputDevice(in InputDeviceIdentifier identifier, int userId, in InputMethodInfo imeInfo, in InputMethodSubtype imeSubtype); KeyboardLayout[] getKeyboardLayoutListForInputDevice(in InputDeviceIdentifier identifier, int userId, in InputMethodInfo imeInfo, in InputMethodSubtype imeSubtype); // Modifier key remapping APIs. @EnforcePermission("REMAP_MODIFIER_KEYS") Loading core/java/android/hardware/input/InputManager.java +6 −6 Original line number Diff line number Diff line Loading @@ -986,7 +986,7 @@ public final class InputManager { @Nullable public String getKeyboardLayoutForInputDevice(@NonNull InputDeviceIdentifier identifier, @UserIdInt int userId, @NonNull InputMethodInfo imeInfo, @NonNull InputMethodSubtype imeSubtype) { @Nullable InputMethodSubtype imeSubtype) { try { return mIm.getKeyboardLayoutForInputDevice(identifier, userId, imeInfo, imeSubtype); } catch (RemoteException ex) { Loading Loading @@ -1014,7 +1014,7 @@ public final class InputManager { @RequiresPermission(Manifest.permission.SET_KEYBOARD_LAYOUT) public void setKeyboardLayoutForInputDevice(@NonNull InputDeviceIdentifier identifier, @UserIdInt int userId, @NonNull InputMethodInfo imeInfo, @NonNull InputMethodSubtype imeSubtype, @NonNull String keyboardLayoutDescriptor) { @Nullable InputMethodSubtype imeSubtype, @NonNull String keyboardLayoutDescriptor) { if (identifier == null) { throw new IllegalArgumentException("identifier must not be null"); } Loading @@ -1031,8 +1031,8 @@ public final class InputManager { } /** * Gets all keyboard layout descriptors that are enabled for the specified input device, userId, * imeInfo and imeSubtype. * Gets all keyboard layouts that are enabled for the specified input device, userId, imeInfo * and imeSubtype. * * @param identifier The identifier for the input device. * @param userId user profile ID Loading @@ -1042,9 +1042,9 @@ public final class InputManager { * * @hide */ public String[] getKeyboardLayoutListForInputDevice(InputDeviceIdentifier identifier, public KeyboardLayout[] getKeyboardLayoutListForInputDevice(InputDeviceIdentifier identifier, @UserIdInt int userId, @NonNull InputMethodInfo imeInfo, @NonNull InputMethodSubtype imeSubtype) { @Nullable InputMethodSubtype imeSubtype) { if (identifier == null) { throw new IllegalArgumentException("inputDeviceDescriptor must not be null"); } Loading services/core/java/com/android/server/input/InputManagerService.java +4 −4 Original line number Diff line number Diff line Loading @@ -1193,7 +1193,7 @@ public class InputManagerService extends IInputManager.Stub @Override // Binder call public String getKeyboardLayoutForInputDevice(InputDeviceIdentifier identifier, @UserIdInt int userId, @NonNull InputMethodInfo imeInfo, @NonNull InputMethodSubtype imeSubtype) { @Nullable InputMethodSubtype imeSubtype) { return mKeyboardLayoutManager.getKeyboardLayoutForInputDevice(identifier, userId, imeInfo, imeSubtype); } Loading @@ -1202,16 +1202,16 @@ public class InputManagerService extends IInputManager.Stub @Override // Binder call public void setKeyboardLayoutForInputDevice(InputDeviceIdentifier identifier, @UserIdInt int userId, @NonNull InputMethodInfo imeInfo, @NonNull InputMethodSubtype imeSubtype, String keyboardLayoutDescriptor) { @Nullable InputMethodSubtype imeSubtype, String keyboardLayoutDescriptor) { super.setKeyboardLayoutForInputDevice_enforcePermission(); mKeyboardLayoutManager.setKeyboardLayoutForInputDevice(identifier, userId, imeInfo, imeSubtype, keyboardLayoutDescriptor); } @Override // Binder call public String[] getKeyboardLayoutListForInputDevice(InputDeviceIdentifier identifier, public KeyboardLayout[] getKeyboardLayoutListForInputDevice(InputDeviceIdentifier identifier, @UserIdInt int userId, @NonNull InputMethodInfo imeInfo, @NonNull InputMethodSubtype imeSubtype) { @Nullable InputMethodSubtype imeSubtype) { return mKeyboardLayoutManager.getKeyboardLayoutListForInputDevice(identifier, userId, imeInfo, imeSubtype); } Loading services/core/java/com/android/server/input/KeyboardLayoutManager.java +6 −10 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.server.input; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.UserIdInt; import android.app.Notification; import android.app.NotificationManager; Loading Loading @@ -550,7 +551,7 @@ final class KeyboardLayoutManager implements InputManager.InputDeviceListener { public String getKeyboardLayoutForInputDevice(InputDeviceIdentifier identifier, @UserIdInt int userId, @NonNull InputMethodInfo imeInfo, @NonNull InputMethodSubtype imeSubtype) { @Nullable InputMethodSubtype imeSubtype) { // TODO(b/259530132): Implement the new keyboard layout API: Returning non-IME specific // layout for now. return getCurrentKeyboardLayoutForInputDevice(identifier); Loading @@ -558,23 +559,18 @@ final class KeyboardLayoutManager implements InputManager.InputDeviceListener { public void setKeyboardLayoutForInputDevice(InputDeviceIdentifier identifier, @UserIdInt int userId, @NonNull InputMethodInfo imeInfo, @NonNull InputMethodSubtype imeSubtype, String keyboardLayoutDescriptor) { @Nullable InputMethodSubtype imeSubtype, String keyboardLayoutDescriptor) { // TODO(b/259530132): Implement the new keyboard layout API: setting non-IME specific // layout for now. setCurrentKeyboardLayoutForInputDevice(identifier, keyboardLayoutDescriptor); } public String[] getKeyboardLayoutListForInputDevice(InputDeviceIdentifier identifier, public KeyboardLayout[] getKeyboardLayoutListForInputDevice(InputDeviceIdentifier identifier, @UserIdInt int userId, @NonNull InputMethodInfo imeInfo, @NonNull InputMethodSubtype imeSubtype) { @Nullable InputMethodSubtype imeSubtype) { // TODO(b/259530132): Implement the new keyboard layout API: Returning list of all // layouts for now. KeyboardLayout[] allLayouts = getKeyboardLayouts(); String[] allLayoutDesc = new String[allLayouts.length]; for (int i = 0; i < allLayouts.length; i++) { allLayoutDesc[i] = allLayouts[i].getDescriptor(); } return allLayoutDesc; return getKeyboardLayouts(); } public void switchKeyboardLayout(int deviceId, int direction) { Loading Loading
core/java/android/hardware/input/IInputManager.aidl +2 −2 Original line number Diff line number Diff line Loading @@ -120,8 +120,8 @@ interface IInputManager { in InputMethodInfo imeInfo, in InputMethodSubtype imeSubtype, String keyboardLayoutDescriptor); String[] getKeyboardLayoutListForInputDevice(in InputDeviceIdentifier identifier, int userId, in InputMethodInfo imeInfo, in InputMethodSubtype imeSubtype); KeyboardLayout[] getKeyboardLayoutListForInputDevice(in InputDeviceIdentifier identifier, int userId, in InputMethodInfo imeInfo, in InputMethodSubtype imeSubtype); // Modifier key remapping APIs. @EnforcePermission("REMAP_MODIFIER_KEYS") Loading
core/java/android/hardware/input/InputManager.java +6 −6 Original line number Diff line number Diff line Loading @@ -986,7 +986,7 @@ public final class InputManager { @Nullable public String getKeyboardLayoutForInputDevice(@NonNull InputDeviceIdentifier identifier, @UserIdInt int userId, @NonNull InputMethodInfo imeInfo, @NonNull InputMethodSubtype imeSubtype) { @Nullable InputMethodSubtype imeSubtype) { try { return mIm.getKeyboardLayoutForInputDevice(identifier, userId, imeInfo, imeSubtype); } catch (RemoteException ex) { Loading Loading @@ -1014,7 +1014,7 @@ public final class InputManager { @RequiresPermission(Manifest.permission.SET_KEYBOARD_LAYOUT) public void setKeyboardLayoutForInputDevice(@NonNull InputDeviceIdentifier identifier, @UserIdInt int userId, @NonNull InputMethodInfo imeInfo, @NonNull InputMethodSubtype imeSubtype, @NonNull String keyboardLayoutDescriptor) { @Nullable InputMethodSubtype imeSubtype, @NonNull String keyboardLayoutDescriptor) { if (identifier == null) { throw new IllegalArgumentException("identifier must not be null"); } Loading @@ -1031,8 +1031,8 @@ public final class InputManager { } /** * Gets all keyboard layout descriptors that are enabled for the specified input device, userId, * imeInfo and imeSubtype. * Gets all keyboard layouts that are enabled for the specified input device, userId, imeInfo * and imeSubtype. * * @param identifier The identifier for the input device. * @param userId user profile ID Loading @@ -1042,9 +1042,9 @@ public final class InputManager { * * @hide */ public String[] getKeyboardLayoutListForInputDevice(InputDeviceIdentifier identifier, public KeyboardLayout[] getKeyboardLayoutListForInputDevice(InputDeviceIdentifier identifier, @UserIdInt int userId, @NonNull InputMethodInfo imeInfo, @NonNull InputMethodSubtype imeSubtype) { @Nullable InputMethodSubtype imeSubtype) { if (identifier == null) { throw new IllegalArgumentException("inputDeviceDescriptor must not be null"); } Loading
services/core/java/com/android/server/input/InputManagerService.java +4 −4 Original line number Diff line number Diff line Loading @@ -1193,7 +1193,7 @@ public class InputManagerService extends IInputManager.Stub @Override // Binder call public String getKeyboardLayoutForInputDevice(InputDeviceIdentifier identifier, @UserIdInt int userId, @NonNull InputMethodInfo imeInfo, @NonNull InputMethodSubtype imeSubtype) { @Nullable InputMethodSubtype imeSubtype) { return mKeyboardLayoutManager.getKeyboardLayoutForInputDevice(identifier, userId, imeInfo, imeSubtype); } Loading @@ -1202,16 +1202,16 @@ public class InputManagerService extends IInputManager.Stub @Override // Binder call public void setKeyboardLayoutForInputDevice(InputDeviceIdentifier identifier, @UserIdInt int userId, @NonNull InputMethodInfo imeInfo, @NonNull InputMethodSubtype imeSubtype, String keyboardLayoutDescriptor) { @Nullable InputMethodSubtype imeSubtype, String keyboardLayoutDescriptor) { super.setKeyboardLayoutForInputDevice_enforcePermission(); mKeyboardLayoutManager.setKeyboardLayoutForInputDevice(identifier, userId, imeInfo, imeSubtype, keyboardLayoutDescriptor); } @Override // Binder call public String[] getKeyboardLayoutListForInputDevice(InputDeviceIdentifier identifier, public KeyboardLayout[] getKeyboardLayoutListForInputDevice(InputDeviceIdentifier identifier, @UserIdInt int userId, @NonNull InputMethodInfo imeInfo, @NonNull InputMethodSubtype imeSubtype) { @Nullable InputMethodSubtype imeSubtype) { return mKeyboardLayoutManager.getKeyboardLayoutListForInputDevice(identifier, userId, imeInfo, imeSubtype); } Loading
services/core/java/com/android/server/input/KeyboardLayoutManager.java +6 −10 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.server.input; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.UserIdInt; import android.app.Notification; import android.app.NotificationManager; Loading Loading @@ -550,7 +551,7 @@ final class KeyboardLayoutManager implements InputManager.InputDeviceListener { public String getKeyboardLayoutForInputDevice(InputDeviceIdentifier identifier, @UserIdInt int userId, @NonNull InputMethodInfo imeInfo, @NonNull InputMethodSubtype imeSubtype) { @Nullable InputMethodSubtype imeSubtype) { // TODO(b/259530132): Implement the new keyboard layout API: Returning non-IME specific // layout for now. return getCurrentKeyboardLayoutForInputDevice(identifier); Loading @@ -558,23 +559,18 @@ final class KeyboardLayoutManager implements InputManager.InputDeviceListener { public void setKeyboardLayoutForInputDevice(InputDeviceIdentifier identifier, @UserIdInt int userId, @NonNull InputMethodInfo imeInfo, @NonNull InputMethodSubtype imeSubtype, String keyboardLayoutDescriptor) { @Nullable InputMethodSubtype imeSubtype, String keyboardLayoutDescriptor) { // TODO(b/259530132): Implement the new keyboard layout API: setting non-IME specific // layout for now. setCurrentKeyboardLayoutForInputDevice(identifier, keyboardLayoutDescriptor); } public String[] getKeyboardLayoutListForInputDevice(InputDeviceIdentifier identifier, public KeyboardLayout[] getKeyboardLayoutListForInputDevice(InputDeviceIdentifier identifier, @UserIdInt int userId, @NonNull InputMethodInfo imeInfo, @NonNull InputMethodSubtype imeSubtype) { @Nullable InputMethodSubtype imeSubtype) { // TODO(b/259530132): Implement the new keyboard layout API: Returning list of all // layouts for now. KeyboardLayout[] allLayouts = getKeyboardLayouts(); String[] allLayoutDesc = new String[allLayouts.length]; for (int i = 0; i < allLayouts.length; i++) { allLayoutDesc[i] = allLayouts[i].getDescriptor(); } return allLayoutDesc; return getKeyboardLayouts(); } public void switchKeyboardLayout(int deviceId, int direction) { Loading