Adjusted Settings to use updated internal InputMethodManager methods

IMM#isStylusHandwritingAvailableAsUser, IMM#getEnabledInputMethodListAsUser, and IMM#getEnabledInputMethodSubtypeListAsUser use now UserHandle instead of userId. These internal APIs are used in Settings and are updated.

Test: atest android.view.inputmethod.cts.installtests.MultiUserTest
Fix: 283765791
Change-Id: Iedb301fbe26810f2101cbb2669b8be95b87a3e7f
This commit is contained in:
Felix Stern
2023-07-25 08:09:58 +00:00
parent bc8d6ba152
commit e8de480865
4 changed files with 9 additions and 6 deletions

View File

@@ -20,6 +20,7 @@ import android.content.Context;
import android.hardware.input.InputDeviceIdentifier;
import android.hardware.input.InputManager;
import android.hardware.input.KeyboardLayout;
import android.os.UserHandle;
import android.view.InputDevice;
import android.view.inputmethod.InputMethodInfo;
import android.view.inputmethod.InputMethodManager;
@@ -55,7 +56,7 @@ public class NewKeyboardSettingsUtils {
static List<String> getSuitableImeLabels(Context context, InputMethodManager imm, int userId) {
List<String> suitableInputMethodInfoLabels = new ArrayList<>();
List<InputMethodInfo> infoList = imm.getEnabledInputMethodListAsUser(userId);
List<InputMethodInfo> infoList = imm.getEnabledInputMethodListAsUser(UserHandle.of(userId));
for (InputMethodInfo info : infoList) {
List<InputMethodSubtype> subtypes =
imm.getEnabledInputMethodSubtypeList(info, true);