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) { boolean allowsImplicitlySelectedSubtypes, @UserIdInt int userId) { try { try { return mTarget.getEnabledInputMethodSubtypeList(imiId, return mTarget.getEnabledInputMethodSubtypeList(imiId, allowsImplicitlySelectedSubtypes); allowsImplicitlySelectedSubtypes, userId); } catch (RemoteException e) { } catch (RemoteException e) { throw e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer(); } } Loading core/java/android/view/inputmethod/InputMethodManager.java +4 −2 Original line number Original line Diff line number Diff line Loading @@ -1514,7 +1514,8 @@ public final class InputMethodManager { boolean allowsImplicitlySelectedSubtypes) { boolean allowsImplicitlySelectedSubtypes) { return mServiceInvoker.getEnabledInputMethodSubtypeList( return mServiceInvoker.getEnabledInputMethodSubtypeList( imi == null ? null : imi.getId(), imi == null ? null : imi.getId(), allowsImplicitlySelectedSubtypes); allowsImplicitlySelectedSubtypes, UserHandle.myUserId()); } } /** /** Loading Loading @@ -3320,7 +3321,8 @@ public final class InputMethodManager { return false; return false; } } final List<InputMethodSubtype> enabledSubtypes = final List<InputMethodSubtype> enabledSubtypes = mServiceInvoker.getEnabledInputMethodSubtypeList(imeId, true); mServiceInvoker.getEnabledInputMethodSubtypeList(imeId, true, UserHandle.myUserId()); final int numSubtypes = enabledSubtypes.size(); final int numSubtypes = enabledSubtypes.size(); for (int i = 0; i < numSubtypes; ++i) { for (int i = 0; i < numSubtypes; ++i) { final InputMethodSubtype enabledSubtype = enabledSubtypes.get(i); final InputMethodSubtype enabledSubtype = enabledSubtypes.get(i); Loading core/java/com/android/internal/view/IInputMethodManager.aidl +4 −1 Original line number Original line Diff line number Diff line Loading @@ -45,8 +45,11 @@ interface IInputMethodManager { + "android.Manifest.permission.INTERACT_ACROSS_USERS_FULL, conditional = true)") + "android.Manifest.permission.INTERACT_ACROSS_USERS_FULL, conditional = true)") List<InputMethodInfo> getEnabledInputMethodList(int userId); List<InputMethodInfo> getEnabledInputMethodList(int userId); @JavaPassthrough(annotation="@android.annotation.RequiresPermission(value = " + "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); boolean allowsImplicitlySelectedSubtypes, int userId); @nullable InputMethodSubtype getLastInputMethodSubtype(); @nullable InputMethodSubtype getLastInputMethodSubtype(); boolean showSoftInput(in IInputMethodClient client, @nullable IBinder windowToken, int flags, boolean showSoftInput(in IInputMethodClient client, @nullable IBinder windowToken, int flags, Loading services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +7 −3 Original line number Original line Diff line number Diff line Loading @@ -2202,16 +2202,20 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub * @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 allowsImplicitlySelectedSubtypes {@code true} to return the implicitly selected * subtypes. * subtypes. * @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) { boolean allowsImplicitlySelectedSubtypes, @UserIdInt int userId) { final int callingUserId = UserHandle.getCallingUserId(); if (UserHandle.getCallingUserId() != userId) { mContext.enforceCallingPermission(Manifest.permission.INTERACT_ACROSS_USERS_FULL, null); } synchronized (ImfLock.class) { synchronized (ImfLock.class) { final long ident = Binder.clearCallingIdentity(); final long ident = Binder.clearCallingIdentity(); try { try { return getEnabledInputMethodSubtypeListLocked(imiId, return getEnabledInputMethodSubtypeListLocked(imiId, allowsImplicitlySelectedSubtypes, callingUserId); allowsImplicitlySelectedSubtypes, userId); } finally { } finally { Binder.restoreCallingIdentity(ident); Binder.restoreCallingIdentity(ident); } } 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) { boolean allowsImplicitlySelectedSubtypes, @UserIdInt int userId) { try { try { return mTarget.getEnabledInputMethodSubtypeList(imiId, return mTarget.getEnabledInputMethodSubtypeList(imiId, allowsImplicitlySelectedSubtypes); allowsImplicitlySelectedSubtypes, userId); } catch (RemoteException e) { } catch (RemoteException e) { throw e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer(); } } Loading
core/java/android/view/inputmethod/InputMethodManager.java +4 −2 Original line number Original line Diff line number Diff line Loading @@ -1514,7 +1514,8 @@ public final class InputMethodManager { boolean allowsImplicitlySelectedSubtypes) { boolean allowsImplicitlySelectedSubtypes) { return mServiceInvoker.getEnabledInputMethodSubtypeList( return mServiceInvoker.getEnabledInputMethodSubtypeList( imi == null ? null : imi.getId(), imi == null ? null : imi.getId(), allowsImplicitlySelectedSubtypes); allowsImplicitlySelectedSubtypes, UserHandle.myUserId()); } } /** /** Loading Loading @@ -3320,7 +3321,8 @@ public final class InputMethodManager { return false; return false; } } final List<InputMethodSubtype> enabledSubtypes = final List<InputMethodSubtype> enabledSubtypes = mServiceInvoker.getEnabledInputMethodSubtypeList(imeId, true); mServiceInvoker.getEnabledInputMethodSubtypeList(imeId, true, UserHandle.myUserId()); final int numSubtypes = enabledSubtypes.size(); final int numSubtypes = enabledSubtypes.size(); for (int i = 0; i < numSubtypes; ++i) { for (int i = 0; i < numSubtypes; ++i) { final InputMethodSubtype enabledSubtype = enabledSubtypes.get(i); final InputMethodSubtype enabledSubtype = enabledSubtypes.get(i); Loading
core/java/com/android/internal/view/IInputMethodManager.aidl +4 −1 Original line number Original line Diff line number Diff line Loading @@ -45,8 +45,11 @@ interface IInputMethodManager { + "android.Manifest.permission.INTERACT_ACROSS_USERS_FULL, conditional = true)") + "android.Manifest.permission.INTERACT_ACROSS_USERS_FULL, conditional = true)") List<InputMethodInfo> getEnabledInputMethodList(int userId); List<InputMethodInfo> getEnabledInputMethodList(int userId); @JavaPassthrough(annotation="@android.annotation.RequiresPermission(value = " + "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); boolean allowsImplicitlySelectedSubtypes, int userId); @nullable InputMethodSubtype getLastInputMethodSubtype(); @nullable InputMethodSubtype getLastInputMethodSubtype(); boolean showSoftInput(in IInputMethodClient client, @nullable IBinder windowToken, int flags, boolean showSoftInput(in IInputMethodClient client, @nullable IBinder windowToken, int flags, Loading
services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +7 −3 Original line number Original line Diff line number Diff line Loading @@ -2202,16 +2202,20 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub * @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 allowsImplicitlySelectedSubtypes {@code true} to return the implicitly selected * subtypes. * subtypes. * @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) { boolean allowsImplicitlySelectedSubtypes, @UserIdInt int userId) { final int callingUserId = UserHandle.getCallingUserId(); if (UserHandle.getCallingUserId() != userId) { mContext.enforceCallingPermission(Manifest.permission.INTERACT_ACROSS_USERS_FULL, null); } synchronized (ImfLock.class) { synchronized (ImfLock.class) { final long ident = Binder.clearCallingIdentity(); final long ident = Binder.clearCallingIdentity(); try { try { return getEnabledInputMethodSubtypeListLocked(imiId, return getEnabledInputMethodSubtypeListLocked(imiId, allowsImplicitlySelectedSubtypes, callingUserId); allowsImplicitlySelectedSubtypes, userId); } finally { } finally { Binder.restoreCallingIdentity(ident); Binder.restoreCallingIdentity(ident); } } Loading