Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee5e77ca authored by satok's avatar satok
Browse files

Make setAdditionalInputMethodSubtypes async

Bug: 5120261
Change-Id: Ic7869cfaa5361531e08d58d7dfa5ba0feab0613e
parent 117999d1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -24486,7 +24486,7 @@ package android.view.inputmethod {
    method public boolean isWatchingCursor(android.view.View);
    method public void restartInput(android.view.View);
    method public void sendAppPrivateCommand(android.view.View, java.lang.String, android.os.Bundle);
    method public boolean setAdditionalInputMethodSubtypes(java.lang.String, android.view.inputmethod.InputMethodSubtype[]);
    method public void setAdditionalInputMethodSubtypes(java.lang.String, android.view.inputmethod.InputMethodSubtype[]);
    method public boolean setCurrentInputMethodSubtype(android.view.inputmethod.InputMethodSubtype);
    method public void setInputMethod(android.os.IBinder, java.lang.String);
    method public void setInputMethodAndSubtype(android.os.IBinder, java.lang.String, android.view.inputmethod.InputMethodSubtype);
+2 −4
Original line number Diff line number Diff line
@@ -1593,15 +1593,13 @@ public final class InputMethodManager {
     * to the current implementation.)
     * @param imiId Id of InputMethodInfo which additional input method subtypes will be added to.
     * @param subtypes subtypes will be added as additional subtypes of the current input method.
     * @return true if the additional input method subtypes are successfully added.
     */
    public boolean setAdditionalInputMethodSubtypes(String imiId, InputMethodSubtype[] subtypes) {
    public void setAdditionalInputMethodSubtypes(String imiId, InputMethodSubtype[] subtypes) {
        synchronized (mH) {
            try {
                return mService.setAdditionalInputMethodSubtypes(imiId, subtypes);
                mService.setAdditionalInputMethodSubtypes(imiId, subtypes);
            } catch (RemoteException e) {
                Log.w(TAG, "IME died: " + mCurId, e);
                return false;
            }
        }
    }
+1 −1
Original line number Diff line number Diff line
@@ -68,5 +68,5 @@ interface IInputMethodManager {
    boolean setCurrentInputMethodSubtype(in InputMethodSubtype subtype);
    boolean switchToLastInputMethod(in IBinder token);
    boolean setInputMethodEnabled(String id, boolean enabled);
    boolean setAdditionalInputMethodSubtypes(String id, in InputMethodSubtype[] subtypes);
    oneway void setAdditionalInputMethodSubtypes(String id, in InputMethodSubtype[] subtypes);
}
+5 −5
Original line number Diff line number Diff line
@@ -1668,13 +1668,13 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
    }

    @Override
    public boolean setAdditionalInputMethodSubtypes(String imiId, InputMethodSubtype[] subtypes) {
    public void setAdditionalInputMethodSubtypes(String imiId, InputMethodSubtype[] subtypes) {
        // 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 || subtypes.length == 0) return false;
        if (TextUtils.isEmpty(imiId) || subtypes == null || subtypes.length == 0) return;
        synchronized (mMethodMap) {
            final InputMethodInfo imi = mMethodMap.get(imiId);
            if (imi == null) return false;
            if (imi == null) return;
            final PackageManager pm = mContext.getPackageManager();
            final String[] packageInfos = pm.getPackagesForUid(Binder.getCallingUid());
            if (packageInfos != null) {
@@ -1688,12 +1688,12 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
                        } finally {
                            Binder.restoreCallingIdentity(ident);
                        }
                        return true;
                        return;
                    }
                }
            }
        }
        return false;
        return;
    }

    private void setInputMethodWithSubtypeId(IBinder token, String id, int subtypeId) {
+1 −9
Original line number Diff line number Diff line
@@ -107,10 +107,9 @@ public class BridgeIInputMethodManager implements IInputMethodManager {

    }

    public boolean setAdditionalInputMethodSubtypes(String arg0, InputMethodSubtype[] arg1)
    public void setAdditionalInputMethodSubtypes(String arg0, InputMethodSubtype[] arg1)
            throws RemoteException {
        // TODO Auto-generated method stub
        return false;
    }

    public boolean setCurrentInputMethodSubtype(InputMethodSubtype arg0) throws RemoteException {
@@ -187,11 +186,4 @@ public class BridgeIInputMethodManager implements IInputMethodManager {
        // TODO Auto-generated method stub
        return null;
    }

    public boolean setAdditionalInputMethodSubtypes(IBinder arg0, InputMethodSubtype[] arg1)
            throws RemoteException {
        // TODO Auto-generated method stub
        return false;
    }

}