Loading core/java/android/view/inputmethod/IInputMethodManagerInvoker.java +2 −2 Original line number Diff line number Diff line Loading @@ -192,9 +192,9 @@ final class IInputMethodManagerInvoker { @AnyThread void setAdditionalInputMethodSubtypes(@NonNull String imeId, @NonNull InputMethodSubtype[] subtypes) { @NonNull InputMethodSubtype[] subtypes, @UserIdInt int userId) { try { mTarget.setAdditionalInputMethodSubtypes(imeId, subtypes); mTarget.setAdditionalInputMethodSubtypes(imeId, subtypes, userId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading core/java/android/view/inputmethod/InputMethodManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -3610,7 +3610,7 @@ public final class InputMethodManager { @Deprecated public void setAdditionalInputMethodSubtypes(@NonNull String imiId, @NonNull InputMethodSubtype[] subtypes) { mServiceInvoker.setAdditionalInputMethodSubtypes(imiId, subtypes); mServiceInvoker.setAdditionalInputMethodSubtypes(imiId, subtypes, UserHandle.myUserId()); } @Nullable Loading core/java/com/android/internal/view/IInputMethodManager.aidl +5 −1 Original line number Diff line number Diff line Loading @@ -92,7 +92,11 @@ interface IInputMethodManager { + "android.Manifest.permission.INTERACT_ACROSS_USERS_FULL, conditional = true)") @nullable InputMethodSubtype getCurrentInputMethodSubtype(int userId); void setAdditionalInputMethodSubtypes(String id, in InputMethodSubtype[] subtypes); @JavaPassthrough(annotation="@android.annotation.RequiresPermission(value = " + "android.Manifest.permission.INTERACT_ACROSS_USERS_FULL, conditional = true)") void setAdditionalInputMethodSubtypes(String id, in InputMethodSubtype[] subtypes, int userId); // This is kept due to @UnsupportedAppUsage. // TODO(Bug 113914148): Consider removing this. int getInputMethodWindowVisibleHeight(in IInputMethodClient client); Loading services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +26 −12 Original line number Diff line number Diff line Loading @@ -4161,7 +4161,12 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub } @Override public void setAdditionalInputMethodSubtypes(String imiId, InputMethodSubtype[] subtypes) { public void setAdditionalInputMethodSubtypes(String imiId, InputMethodSubtype[] subtypes, @UserIdInt int userId) { if (UserHandle.getCallingUserId() != userId) { mContext.enforceCallingPermission(Manifest.permission.INTERACT_ACROSS_USERS_FULL, null); } // By this IPC call, only a process which shares the same uid with the IME can add // additional input method subtypes to the IME. if (TextUtils.isEmpty(imiId) || subtypes == null) return; Loading @@ -4175,23 +4180,32 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub } } synchronized (ImfLock.class) { if (!calledFromValidUserLocked()) { return; } if (!mSystemReady) { return; } if (mSettings.getCurrentUserId() == userId) { if (!mSettings.setAdditionalInputMethodSubtypes(imiId, toBeAdded, mAdditionalSubtypeMap, mIPackageManager)) { return; } final long ident = Binder.clearCallingIdentity(); try { buildInputMethodListLocked(false /* resetDefaultEnabledIme */); } finally { Binder.restoreCallingIdentity(ident); } return; } final ArrayMap<String, InputMethodInfo> methodMap = queryMethodMapForUser(userId); final InputMethodSettings settings = new InputMethodSettings(mContext, methodMap, userId, false); final ArrayMap<String, List<InputMethodSubtype>> additionalSubtypeMap = new ArrayMap<>(); AdditionalSubtypeUtils.load(additionalSubtypeMap, userId); settings.setAdditionalInputMethodSubtypes(imiId, toBeAdded, additionalSubtypeMap, mIPackageManager); } } Loading Loading
core/java/android/view/inputmethod/IInputMethodManagerInvoker.java +2 −2 Original line number Diff line number Diff line Loading @@ -192,9 +192,9 @@ final class IInputMethodManagerInvoker { @AnyThread void setAdditionalInputMethodSubtypes(@NonNull String imeId, @NonNull InputMethodSubtype[] subtypes) { @NonNull InputMethodSubtype[] subtypes, @UserIdInt int userId) { try { mTarget.setAdditionalInputMethodSubtypes(imeId, subtypes); mTarget.setAdditionalInputMethodSubtypes(imeId, subtypes, userId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading
core/java/android/view/inputmethod/InputMethodManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -3610,7 +3610,7 @@ public final class InputMethodManager { @Deprecated public void setAdditionalInputMethodSubtypes(@NonNull String imiId, @NonNull InputMethodSubtype[] subtypes) { mServiceInvoker.setAdditionalInputMethodSubtypes(imiId, subtypes); mServiceInvoker.setAdditionalInputMethodSubtypes(imiId, subtypes, UserHandle.myUserId()); } @Nullable Loading
core/java/com/android/internal/view/IInputMethodManager.aidl +5 −1 Original line number Diff line number Diff line Loading @@ -92,7 +92,11 @@ interface IInputMethodManager { + "android.Manifest.permission.INTERACT_ACROSS_USERS_FULL, conditional = true)") @nullable InputMethodSubtype getCurrentInputMethodSubtype(int userId); void setAdditionalInputMethodSubtypes(String id, in InputMethodSubtype[] subtypes); @JavaPassthrough(annotation="@android.annotation.RequiresPermission(value = " + "android.Manifest.permission.INTERACT_ACROSS_USERS_FULL, conditional = true)") void setAdditionalInputMethodSubtypes(String id, in InputMethodSubtype[] subtypes, int userId); // This is kept due to @UnsupportedAppUsage. // TODO(Bug 113914148): Consider removing this. int getInputMethodWindowVisibleHeight(in IInputMethodClient client); Loading
services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +26 −12 Original line number Diff line number Diff line Loading @@ -4161,7 +4161,12 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub } @Override public void setAdditionalInputMethodSubtypes(String imiId, InputMethodSubtype[] subtypes) { public void setAdditionalInputMethodSubtypes(String imiId, InputMethodSubtype[] subtypes, @UserIdInt int userId) { if (UserHandle.getCallingUserId() != userId) { mContext.enforceCallingPermission(Manifest.permission.INTERACT_ACROSS_USERS_FULL, null); } // By this IPC call, only a process which shares the same uid with the IME can add // additional input method subtypes to the IME. if (TextUtils.isEmpty(imiId) || subtypes == null) return; Loading @@ -4175,23 +4180,32 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub } } synchronized (ImfLock.class) { if (!calledFromValidUserLocked()) { return; } if (!mSystemReady) { return; } if (mSettings.getCurrentUserId() == userId) { if (!mSettings.setAdditionalInputMethodSubtypes(imiId, toBeAdded, mAdditionalSubtypeMap, mIPackageManager)) { return; } final long ident = Binder.clearCallingIdentity(); try { buildInputMethodListLocked(false /* resetDefaultEnabledIme */); } finally { Binder.restoreCallingIdentity(ident); } return; } final ArrayMap<String, InputMethodInfo> methodMap = queryMethodMapForUser(userId); final InputMethodSettings settings = new InputMethodSettings(mContext, methodMap, userId, false); final ArrayMap<String, List<InputMethodSubtype>> additionalSubtypeMap = new ArrayMap<>(); AdditionalSubtypeUtils.load(additionalSubtypeMap, userId); settings.setAdditionalInputMethodSubtypes(imiId, toBeAdded, additionalSubtypeMap, mIPackageManager); } } Loading