Loading services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +7 −6 Original line number Diff line number Diff line Loading @@ -5518,17 +5518,19 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. */ @GuardedBy("ImfLock.class") InputMethodSubtype getCurrentInputMethodSubtypeLocked() { String selectedMethodId = getSelectedMethodIdLocked(); final int userId = mCurrentUserId; final var selectedMethodId = getInputMethodBindingController(userId).getSelectedMethodId(); if (selectedMethodId == null) { return null; } final InputMethodSettings settings = InputMethodSettingsRepository.get(mCurrentUserId); final boolean subtypeIsSelected = settings.isSubtypeSelected(); final InputMethodSettings settings = InputMethodSettingsRepository.get(userId); final InputMethodInfo imi = settings.getMethodMap().get(selectedMethodId); if (imi == null || imi.getSubtypeCount() == 0) { return null; } if (!subtypeIsSelected || mCurrentSubtype == null final int currentSubtypeHashCode = SecureSettingsWrapper.getInt( Settings.Secure.SELECTED_INPUT_METHOD_SUBTYPE, NOT_A_SUBTYPE_ID, userId); if (currentSubtypeHashCode == NOT_A_SUBTYPE_ID || mCurrentSubtype == null || !SubtypeUtils.isValidSubtypeId(imi, mCurrentSubtype.hashCode())) { int subtypeId = settings.getSelectedInputMethodSubtypeId(selectedMethodId); if (subtypeId == NOT_A_SUBTYPE_ID) { Loading @@ -5542,8 +5544,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. if (explicitlyOrImplicitlyEnabledSubtypes.size() == 1) { mCurrentSubtype = explicitlyOrImplicitlyEnabledSubtypes.get(0); } else if (explicitlyOrImplicitlyEnabledSubtypes.size() > 1) { final String locale = SystemLocaleWrapper.get(settings.getUserId()) .get(0).toString(); final String locale = SystemLocaleWrapper.get(userId).get(0).toString(); mCurrentSubtype = SubtypeUtils.findLastResortApplicableSubtype( explicitlyOrImplicitlyEnabledSubtypes, SubtypeUtils.SUBTYPE_MODE_KEYBOARD, locale, true); Loading services/core/java/com/android/server/inputmethod/InputMethodSettings.java +0 −4 Original line number Diff line number Diff line Loading @@ -528,10 +528,6 @@ final class InputMethodSettings { return imi; } boolean isSubtypeSelected() { return getSelectedInputMethodSubtypeHashCode() != NOT_A_SUBTYPE_ID; } private int getSelectedInputMethodSubtypeHashCode() { return getInt(Settings.Secure.SELECTED_INPUT_METHOD_SUBTYPE, NOT_A_SUBTYPE_ID); Loading Loading
services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +7 −6 Original line number Diff line number Diff line Loading @@ -5518,17 +5518,19 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. */ @GuardedBy("ImfLock.class") InputMethodSubtype getCurrentInputMethodSubtypeLocked() { String selectedMethodId = getSelectedMethodIdLocked(); final int userId = mCurrentUserId; final var selectedMethodId = getInputMethodBindingController(userId).getSelectedMethodId(); if (selectedMethodId == null) { return null; } final InputMethodSettings settings = InputMethodSettingsRepository.get(mCurrentUserId); final boolean subtypeIsSelected = settings.isSubtypeSelected(); final InputMethodSettings settings = InputMethodSettingsRepository.get(userId); final InputMethodInfo imi = settings.getMethodMap().get(selectedMethodId); if (imi == null || imi.getSubtypeCount() == 0) { return null; } if (!subtypeIsSelected || mCurrentSubtype == null final int currentSubtypeHashCode = SecureSettingsWrapper.getInt( Settings.Secure.SELECTED_INPUT_METHOD_SUBTYPE, NOT_A_SUBTYPE_ID, userId); if (currentSubtypeHashCode == NOT_A_SUBTYPE_ID || mCurrentSubtype == null || !SubtypeUtils.isValidSubtypeId(imi, mCurrentSubtype.hashCode())) { int subtypeId = settings.getSelectedInputMethodSubtypeId(selectedMethodId); if (subtypeId == NOT_A_SUBTYPE_ID) { Loading @@ -5542,8 +5544,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. if (explicitlyOrImplicitlyEnabledSubtypes.size() == 1) { mCurrentSubtype = explicitlyOrImplicitlyEnabledSubtypes.get(0); } else if (explicitlyOrImplicitlyEnabledSubtypes.size() > 1) { final String locale = SystemLocaleWrapper.get(settings.getUserId()) .get(0).toString(); final String locale = SystemLocaleWrapper.get(userId).get(0).toString(); mCurrentSubtype = SubtypeUtils.findLastResortApplicableSubtype( explicitlyOrImplicitlyEnabledSubtypes, SubtypeUtils.SUBTYPE_MODE_KEYBOARD, locale, true); Loading
services/core/java/com/android/server/inputmethod/InputMethodSettings.java +0 −4 Original line number Diff line number Diff line Loading @@ -528,10 +528,6 @@ final class InputMethodSettings { return imi; } boolean isSubtypeSelected() { return getSelectedInputMethodSubtypeHashCode() != NOT_A_SUBTYPE_ID; } private int getSelectedInputMethodSubtypeHashCode() { return getInt(Settings.Secure.SELECTED_INPUT_METHOD_SUBTYPE, NOT_A_SUBTYPE_ID); Loading