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