Loading core/java/android/view/inputmethod/IInputMethodManagerInvoker.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -90,10 +90,10 @@ final class IInputMethodManagerInvoker { @AnyThread @AnyThread @NonNull @NonNull List<InputMethodSubtype> getEnabledInputMethodSubtypeList(@Nullable String imiId, List<InputMethodSubtype> getEnabledInputMethodSubtypeList(@Nullable String imiId, boolean allowsImplicitlySelectedSubtypes, @UserIdInt int userId) { boolean allowsImplicitlyEnabledSubtypes, @UserIdInt int userId) { try { try { return mTarget.getEnabledInputMethodSubtypeList(imiId, return mTarget.getEnabledInputMethodSubtypeList(imiId, allowsImplicitlySelectedSubtypes, userId); allowsImplicitlyEnabledSubtypes, userId); } catch (RemoteException e) { } catch (RemoteException e) { throw e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer(); } } Loading core/java/android/view/inputmethod/InputMethodManager.java +4 −4 Original line number Original line Diff line number Diff line Loading @@ -1578,16 +1578,16 @@ public final class InputMethodManager { * * * @param imi The {@link InputMethodInfo} whose subtypes list will be returned. If {@code null}, * @param imi The {@link InputMethodInfo} whose subtypes list will be returned. If {@code null}, * returns enabled subtypes for the currently selected {@link InputMethodInfo}. * returns enabled subtypes for the currently selected {@link InputMethodInfo}. * @param allowsImplicitlySelectedSubtypes A boolean flag to allow to return the implicitly * @param allowsImplicitlyEnabledSubtypes A boolean flag to allow to return the implicitly * selected subtypes. If an input method info doesn't have enabled subtypes, the framework * enabled subtypes. If an input method info doesn't have enabled subtypes, the framework * will implicitly enable subtypes according to the current system language. * will implicitly enable subtypes according to the current system language. */ */ @NonNull @NonNull public List<InputMethodSubtype> getEnabledInputMethodSubtypeList(@Nullable InputMethodInfo imi, public List<InputMethodSubtype> getEnabledInputMethodSubtypeList(@Nullable InputMethodInfo imi, boolean allowsImplicitlySelectedSubtypes) { boolean allowsImplicitlyEnabledSubtypes) { return mServiceInvoker.getEnabledInputMethodSubtypeList( return mServiceInvoker.getEnabledInputMethodSubtypeList( imi == null ? null : imi.getId(), imi == null ? null : imi.getId(), allowsImplicitlySelectedSubtypes, allowsImplicitlyEnabledSubtypes, UserHandle.myUserId()); UserHandle.myUserId()); } } Loading core/java/com/android/internal/view/IInputMethodManager.aidl +1 −1 Original line number Original line Diff line number Diff line Loading @@ -48,7 +48,7 @@ interface IInputMethodManager { @JavaPassthrough(annotation="@android.annotation.RequiresPermission(value = " @JavaPassthrough(annotation="@android.annotation.RequiresPermission(value = " + "android.Manifest.permission.INTERACT_ACROSS_USERS_FULL, conditional = true)") + "android.Manifest.permission.INTERACT_ACROSS_USERS_FULL, conditional = true)") List<InputMethodSubtype> getEnabledInputMethodSubtypeList(in @nullable String imiId, List<InputMethodSubtype> getEnabledInputMethodSubtypeList(in @nullable String imiId, boolean allowsImplicitlySelectedSubtypes, int userId); boolean allowsImplicitlyEnabledSubtypes, int userId); @JavaPassthrough(annotation="@android.annotation.RequiresPermission(value = " @JavaPassthrough(annotation="@android.annotation.RequiresPermission(value = " + "android.Manifest.permission.INTERACT_ACROSS_USERS_FULL, conditional = true)") + "android.Manifest.permission.INTERACT_ACROSS_USERS_FULL, conditional = true)") Loading services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +6 −6 Original line number Original line Diff line number Diff line Loading @@ -2167,13 +2167,13 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub * Gets enabled subtypes of the specified {@link InputMethodInfo}. * Gets enabled subtypes of the specified {@link InputMethodInfo}. * * * @param imiId if null, returns enabled subtypes for the current {@link InputMethodInfo}. * @param imiId if null, returns enabled subtypes for the current {@link InputMethodInfo}. * @param allowsImplicitlySelectedSubtypes {@code true} to return the implicitly selected * @param allowsImplicitlyEnabledSubtypes {@code true} to return the implicitly enabled * subtypes. * subtypes. * @param userId the user ID to be queried about. * @param userId the user ID to be queried about. */ */ @Override @Override public List<InputMethodSubtype> getEnabledInputMethodSubtypeList(String imiId, public List<InputMethodSubtype> getEnabledInputMethodSubtypeList(String imiId, boolean allowsImplicitlySelectedSubtypes, @UserIdInt int userId) { boolean allowsImplicitlyEnabledSubtypes, @UserIdInt int userId) { if (UserHandle.getCallingUserId() != userId) { if (UserHandle.getCallingUserId() != userId) { mContext.enforceCallingPermission(Manifest.permission.INTERACT_ACROSS_USERS_FULL, null); mContext.enforceCallingPermission(Manifest.permission.INTERACT_ACROSS_USERS_FULL, null); } } Loading @@ -2182,7 +2182,7 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub final long ident = Binder.clearCallingIdentity(); final long ident = Binder.clearCallingIdentity(); try { try { return getEnabledInputMethodSubtypeListLocked(imiId, return getEnabledInputMethodSubtypeListLocked(imiId, allowsImplicitlySelectedSubtypes, userId); allowsImplicitlyEnabledSubtypes, userId); } finally { } finally { Binder.restoreCallingIdentity(ident); Binder.restoreCallingIdentity(ident); } } Loading @@ -2191,7 +2191,7 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub @GuardedBy("ImfLock.class") @GuardedBy("ImfLock.class") private List<InputMethodSubtype> getEnabledInputMethodSubtypeListLocked(String imiId, private List<InputMethodSubtype> getEnabledInputMethodSubtypeListLocked(String imiId, boolean allowsImplicitlySelectedSubtypes, @UserIdInt int userId) { boolean allowsImplicitlyEnabledSubtypes, @UserIdInt int userId) { if (userId == mSettings.getCurrentUserId()) { if (userId == mSettings.getCurrentUserId()) { final InputMethodInfo imi; final InputMethodInfo imi; String selectedMethodId = getSelectedMethodIdLocked(); String selectedMethodId = getSelectedMethodIdLocked(); Loading @@ -2204,7 +2204,7 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub return Collections.emptyList(); return Collections.emptyList(); } } return mSettings.getEnabledInputMethodSubtypeListLocked( return mSettings.getEnabledInputMethodSubtypeListLocked( imi, allowsImplicitlySelectedSubtypes); imi, allowsImplicitlyEnabledSubtypes); } } final ArrayMap<String, InputMethodInfo> methodMap = queryMethodMapForUser(userId); final ArrayMap<String, InputMethodInfo> methodMap = queryMethodMapForUser(userId); final InputMethodInfo imi = methodMap.get(imiId); final InputMethodInfo imi = methodMap.get(imiId); Loading @@ -2214,7 +2214,7 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub final InputMethodSettings settings = new InputMethodSettings(mContext, methodMap, userId, final InputMethodSettings settings = new InputMethodSettings(mContext, methodMap, userId, true); true); return settings.getEnabledInputMethodSubtypeListLocked( return settings.getEnabledInputMethodSubtypeListLocked( imi, allowsImplicitlySelectedSubtypes); imi, allowsImplicitlyEnabledSubtypes); } } /** /** Loading services/core/java/com/android/server/inputmethod/InputMethodUtils.java +6 −6 Original line number Original line Diff line number Diff line Loading @@ -415,10 +415,10 @@ final class InputMethodUtils { } } List<InputMethodSubtype> getEnabledInputMethodSubtypeListLocked( List<InputMethodSubtype> getEnabledInputMethodSubtypeListLocked( InputMethodInfo imi, boolean allowsImplicitlySelectedSubtypes) { InputMethodInfo imi, boolean allowsImplicitlyEnabledSubtypes) { List<InputMethodSubtype> enabledSubtypes = List<InputMethodSubtype> enabledSubtypes = getEnabledInputMethodSubtypeListLocked(imi); getEnabledInputMethodSubtypeListLocked(imi); if (allowsImplicitlySelectedSubtypes && enabledSubtypes.isEmpty()) { if (allowsImplicitlyEnabledSubtypes && enabledSubtypes.isEmpty()) { enabledSubtypes = SubtypeUtils.getImplicitlyApplicableSubtypesLocked(mRes, imi); enabledSubtypes = SubtypeUtils.getImplicitlyApplicableSubtypesLocked(mRes, imi); } } return InputMethodSubtype.sort(imi, enabledSubtypes); return InputMethodSubtype.sort(imi, enabledSubtypes); Loading Loading @@ -669,12 +669,12 @@ final class InputMethodUtils { // If IME is enabled and no subtypes are enabled, applicable subtypes // If IME is enabled and no subtypes are enabled, applicable subtypes // are enabled implicitly, so needs to treat them to be enabled. // are enabled implicitly, so needs to treat them to be enabled. if (imi != null && imi.getSubtypeCount() > 0) { if (imi != null && imi.getSubtypeCount() > 0) { List<InputMethodSubtype> implicitlySelectedSubtypes = List<InputMethodSubtype> implicitlyEnabledSubtypes = SubtypeUtils.getImplicitlyApplicableSubtypesLocked(mRes, imi); SubtypeUtils.getImplicitlyApplicableSubtypesLocked(mRes, imi); if (implicitlySelectedSubtypes != null) { if (implicitlyEnabledSubtypes != null) { final int N = implicitlySelectedSubtypes.size(); final int N = implicitlyEnabledSubtypes.size(); for (int i = 0; i < N; ++i) { for (int i = 0; i < N; ++i) { final InputMethodSubtype st = implicitlySelectedSubtypes.get(i); final InputMethodSubtype st = implicitlyEnabledSubtypes.get(i); if (String.valueOf(st.hashCode()).equals(subtypeHashCode)) { if (String.valueOf(st.hashCode()).equals(subtypeHashCode)) { return subtypeHashCode; return subtypeHashCode; } } Loading Loading
core/java/android/view/inputmethod/IInputMethodManagerInvoker.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -90,10 +90,10 @@ final class IInputMethodManagerInvoker { @AnyThread @AnyThread @NonNull @NonNull List<InputMethodSubtype> getEnabledInputMethodSubtypeList(@Nullable String imiId, List<InputMethodSubtype> getEnabledInputMethodSubtypeList(@Nullable String imiId, boolean allowsImplicitlySelectedSubtypes, @UserIdInt int userId) { boolean allowsImplicitlyEnabledSubtypes, @UserIdInt int userId) { try { try { return mTarget.getEnabledInputMethodSubtypeList(imiId, return mTarget.getEnabledInputMethodSubtypeList(imiId, allowsImplicitlySelectedSubtypes, userId); allowsImplicitlyEnabledSubtypes, userId); } catch (RemoteException e) { } catch (RemoteException e) { throw e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer(); } } Loading
core/java/android/view/inputmethod/InputMethodManager.java +4 −4 Original line number Original line Diff line number Diff line Loading @@ -1578,16 +1578,16 @@ public final class InputMethodManager { * * * @param imi The {@link InputMethodInfo} whose subtypes list will be returned. If {@code null}, * @param imi The {@link InputMethodInfo} whose subtypes list will be returned. If {@code null}, * returns enabled subtypes for the currently selected {@link InputMethodInfo}. * returns enabled subtypes for the currently selected {@link InputMethodInfo}. * @param allowsImplicitlySelectedSubtypes A boolean flag to allow to return the implicitly * @param allowsImplicitlyEnabledSubtypes A boolean flag to allow to return the implicitly * selected subtypes. If an input method info doesn't have enabled subtypes, the framework * enabled subtypes. If an input method info doesn't have enabled subtypes, the framework * will implicitly enable subtypes according to the current system language. * will implicitly enable subtypes according to the current system language. */ */ @NonNull @NonNull public List<InputMethodSubtype> getEnabledInputMethodSubtypeList(@Nullable InputMethodInfo imi, public List<InputMethodSubtype> getEnabledInputMethodSubtypeList(@Nullable InputMethodInfo imi, boolean allowsImplicitlySelectedSubtypes) { boolean allowsImplicitlyEnabledSubtypes) { return mServiceInvoker.getEnabledInputMethodSubtypeList( return mServiceInvoker.getEnabledInputMethodSubtypeList( imi == null ? null : imi.getId(), imi == null ? null : imi.getId(), allowsImplicitlySelectedSubtypes, allowsImplicitlyEnabledSubtypes, UserHandle.myUserId()); UserHandle.myUserId()); } } Loading
core/java/com/android/internal/view/IInputMethodManager.aidl +1 −1 Original line number Original line Diff line number Diff line Loading @@ -48,7 +48,7 @@ interface IInputMethodManager { @JavaPassthrough(annotation="@android.annotation.RequiresPermission(value = " @JavaPassthrough(annotation="@android.annotation.RequiresPermission(value = " + "android.Manifest.permission.INTERACT_ACROSS_USERS_FULL, conditional = true)") + "android.Manifest.permission.INTERACT_ACROSS_USERS_FULL, conditional = true)") List<InputMethodSubtype> getEnabledInputMethodSubtypeList(in @nullable String imiId, List<InputMethodSubtype> getEnabledInputMethodSubtypeList(in @nullable String imiId, boolean allowsImplicitlySelectedSubtypes, int userId); boolean allowsImplicitlyEnabledSubtypes, int userId); @JavaPassthrough(annotation="@android.annotation.RequiresPermission(value = " @JavaPassthrough(annotation="@android.annotation.RequiresPermission(value = " + "android.Manifest.permission.INTERACT_ACROSS_USERS_FULL, conditional = true)") + "android.Manifest.permission.INTERACT_ACROSS_USERS_FULL, conditional = true)") Loading
services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +6 −6 Original line number Original line Diff line number Diff line Loading @@ -2167,13 +2167,13 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub * Gets enabled subtypes of the specified {@link InputMethodInfo}. * Gets enabled subtypes of the specified {@link InputMethodInfo}. * * * @param imiId if null, returns enabled subtypes for the current {@link InputMethodInfo}. * @param imiId if null, returns enabled subtypes for the current {@link InputMethodInfo}. * @param allowsImplicitlySelectedSubtypes {@code true} to return the implicitly selected * @param allowsImplicitlyEnabledSubtypes {@code true} to return the implicitly enabled * subtypes. * subtypes. * @param userId the user ID to be queried about. * @param userId the user ID to be queried about. */ */ @Override @Override public List<InputMethodSubtype> getEnabledInputMethodSubtypeList(String imiId, public List<InputMethodSubtype> getEnabledInputMethodSubtypeList(String imiId, boolean allowsImplicitlySelectedSubtypes, @UserIdInt int userId) { boolean allowsImplicitlyEnabledSubtypes, @UserIdInt int userId) { if (UserHandle.getCallingUserId() != userId) { if (UserHandle.getCallingUserId() != userId) { mContext.enforceCallingPermission(Manifest.permission.INTERACT_ACROSS_USERS_FULL, null); mContext.enforceCallingPermission(Manifest.permission.INTERACT_ACROSS_USERS_FULL, null); } } Loading @@ -2182,7 +2182,7 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub final long ident = Binder.clearCallingIdentity(); final long ident = Binder.clearCallingIdentity(); try { try { return getEnabledInputMethodSubtypeListLocked(imiId, return getEnabledInputMethodSubtypeListLocked(imiId, allowsImplicitlySelectedSubtypes, userId); allowsImplicitlyEnabledSubtypes, userId); } finally { } finally { Binder.restoreCallingIdentity(ident); Binder.restoreCallingIdentity(ident); } } Loading @@ -2191,7 +2191,7 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub @GuardedBy("ImfLock.class") @GuardedBy("ImfLock.class") private List<InputMethodSubtype> getEnabledInputMethodSubtypeListLocked(String imiId, private List<InputMethodSubtype> getEnabledInputMethodSubtypeListLocked(String imiId, boolean allowsImplicitlySelectedSubtypes, @UserIdInt int userId) { boolean allowsImplicitlyEnabledSubtypes, @UserIdInt int userId) { if (userId == mSettings.getCurrentUserId()) { if (userId == mSettings.getCurrentUserId()) { final InputMethodInfo imi; final InputMethodInfo imi; String selectedMethodId = getSelectedMethodIdLocked(); String selectedMethodId = getSelectedMethodIdLocked(); Loading @@ -2204,7 +2204,7 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub return Collections.emptyList(); return Collections.emptyList(); } } return mSettings.getEnabledInputMethodSubtypeListLocked( return mSettings.getEnabledInputMethodSubtypeListLocked( imi, allowsImplicitlySelectedSubtypes); imi, allowsImplicitlyEnabledSubtypes); } } final ArrayMap<String, InputMethodInfo> methodMap = queryMethodMapForUser(userId); final ArrayMap<String, InputMethodInfo> methodMap = queryMethodMapForUser(userId); final InputMethodInfo imi = methodMap.get(imiId); final InputMethodInfo imi = methodMap.get(imiId); Loading @@ -2214,7 +2214,7 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub final InputMethodSettings settings = new InputMethodSettings(mContext, methodMap, userId, final InputMethodSettings settings = new InputMethodSettings(mContext, methodMap, userId, true); true); return settings.getEnabledInputMethodSubtypeListLocked( return settings.getEnabledInputMethodSubtypeListLocked( imi, allowsImplicitlySelectedSubtypes); imi, allowsImplicitlyEnabledSubtypes); } } /** /** Loading
services/core/java/com/android/server/inputmethod/InputMethodUtils.java +6 −6 Original line number Original line Diff line number Diff line Loading @@ -415,10 +415,10 @@ final class InputMethodUtils { } } List<InputMethodSubtype> getEnabledInputMethodSubtypeListLocked( List<InputMethodSubtype> getEnabledInputMethodSubtypeListLocked( InputMethodInfo imi, boolean allowsImplicitlySelectedSubtypes) { InputMethodInfo imi, boolean allowsImplicitlyEnabledSubtypes) { List<InputMethodSubtype> enabledSubtypes = List<InputMethodSubtype> enabledSubtypes = getEnabledInputMethodSubtypeListLocked(imi); getEnabledInputMethodSubtypeListLocked(imi); if (allowsImplicitlySelectedSubtypes && enabledSubtypes.isEmpty()) { if (allowsImplicitlyEnabledSubtypes && enabledSubtypes.isEmpty()) { enabledSubtypes = SubtypeUtils.getImplicitlyApplicableSubtypesLocked(mRes, imi); enabledSubtypes = SubtypeUtils.getImplicitlyApplicableSubtypesLocked(mRes, imi); } } return InputMethodSubtype.sort(imi, enabledSubtypes); return InputMethodSubtype.sort(imi, enabledSubtypes); Loading Loading @@ -669,12 +669,12 @@ final class InputMethodUtils { // If IME is enabled and no subtypes are enabled, applicable subtypes // If IME is enabled and no subtypes are enabled, applicable subtypes // are enabled implicitly, so needs to treat them to be enabled. // are enabled implicitly, so needs to treat them to be enabled. if (imi != null && imi.getSubtypeCount() > 0) { if (imi != null && imi.getSubtypeCount() > 0) { List<InputMethodSubtype> implicitlySelectedSubtypes = List<InputMethodSubtype> implicitlyEnabledSubtypes = SubtypeUtils.getImplicitlyApplicableSubtypesLocked(mRes, imi); SubtypeUtils.getImplicitlyApplicableSubtypesLocked(mRes, imi); if (implicitlySelectedSubtypes != null) { if (implicitlyEnabledSubtypes != null) { final int N = implicitlySelectedSubtypes.size(); final int N = implicitlyEnabledSubtypes.size(); for (int i = 0; i < N; ++i) { for (int i = 0; i < N; ++i) { final InputMethodSubtype st = implicitlySelectedSubtypes.get(i); final InputMethodSubtype st = implicitlyEnabledSubtypes.get(i); if (String.valueOf(st.hashCode()).equals(subtypeHashCode)) { if (String.valueOf(st.hashCode()).equals(subtypeHashCode)) { return subtypeHashCode; return subtypeHashCode; } } Loading