Skip to content

Commit ee5e77c

Browse files
committed
Make setAdditionalInputMethodSubtypes async
Bug: 5120261 Change-Id: Ic7869cfaa5361531e08d58d7dfa5ba0feab0613e
1 parent 117999d commit ee5e77c

File tree

5 files changed

+10
-20
lines changed

5 files changed

+10
-20
lines changed

api/current.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24486,7 +24486,7 @@ package android.view.inputmethod {
2448624486
method public boolean isWatchingCursor(android.view.View);
2448724487
method public void restartInput(android.view.View);
2448824488
method public void sendAppPrivateCommand(android.view.View, java.lang.String, android.os.Bundle);
24489-
method public boolean setAdditionalInputMethodSubtypes(java.lang.String, android.view.inputmethod.InputMethodSubtype[]);
24489+
method public void setAdditionalInputMethodSubtypes(java.lang.String, android.view.inputmethod.InputMethodSubtype[]);
2449024490
method public boolean setCurrentInputMethodSubtype(android.view.inputmethod.InputMethodSubtype);
2449124491
method public void setInputMethod(android.os.IBinder, java.lang.String);
2449224492
method public void setInputMethodAndSubtype(android.os.IBinder, java.lang.String, android.view.inputmethod.InputMethodSubtype);

core/java/android/view/inputmethod/InputMethodManager.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1593,15 +1593,13 @@ public boolean switchToLastInputMethod(IBinder imeToken) {
15931593
* to the current implementation.)
15941594
* @param imiId Id of InputMethodInfo which additional input method subtypes will be added to.
15951595
* @param subtypes subtypes will be added as additional subtypes of the current input method.
1596-
* @return true if the additional input method subtypes are successfully added.
15971596
*/
1598-
public boolean setAdditionalInputMethodSubtypes(String imiId, InputMethodSubtype[] subtypes) {
1597+
public void setAdditionalInputMethodSubtypes(String imiId, InputMethodSubtype[] subtypes) {
15991598
synchronized (mH) {
16001599
try {
1601-
return mService.setAdditionalInputMethodSubtypes(imiId, subtypes);
1600+
mService.setAdditionalInputMethodSubtypes(imiId, subtypes);
16021601
} catch (RemoteException e) {
16031602
Log.w(TAG, "IME died: " + mCurId, e);
1604-
return false;
16051603
}
16061604
}
16071605
}

core/java/com/android/internal/view/IInputMethodManager.aidl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,5 @@ interface IInputMethodManager {
6868
boolean setCurrentInputMethodSubtype(in InputMethodSubtype subtype);
6969
boolean switchToLastInputMethod(in IBinder token);
7070
boolean setInputMethodEnabled(String id, boolean enabled);
71-
boolean setAdditionalInputMethodSubtypes(String id, in InputMethodSubtype[] subtypes);
71+
oneway void setAdditionalInputMethodSubtypes(String id, in InputMethodSubtype[] subtypes);
7272
}

services/java/com/android/server/InputMethodManagerService.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1668,13 +1668,13 @@ public InputMethodSubtype getLastInputMethodSubtype() {
16681668
}
16691669

16701670
@Override
1671-
public boolean setAdditionalInputMethodSubtypes(String imiId, InputMethodSubtype[] subtypes) {
1671+
public void setAdditionalInputMethodSubtypes(String imiId, InputMethodSubtype[] subtypes) {
16721672
// By this IPC call, only a process which shares the same uid with the IME can add
16731673
// additional input method subtypes to the IME.
1674-
if (TextUtils.isEmpty(imiId) || subtypes == null || subtypes.length == 0) return false;
1674+
if (TextUtils.isEmpty(imiId) || subtypes == null || subtypes.length == 0) return;
16751675
synchronized (mMethodMap) {
16761676
final InputMethodInfo imi = mMethodMap.get(imiId);
1677-
if (imi == null) return false;
1677+
if (imi == null) return;
16781678
final PackageManager pm = mContext.getPackageManager();
16791679
final String[] packageInfos = pm.getPackagesForUid(Binder.getCallingUid());
16801680
if (packageInfos != null) {
@@ -1688,12 +1688,12 @@ public boolean setAdditionalInputMethodSubtypes(String imiId, InputMethodSubtype
16881688
} finally {
16891689
Binder.restoreCallingIdentity(ident);
16901690
}
1691-
return true;
1691+
return;
16921692
}
16931693
}
16941694
}
16951695
}
1696-
return false;
1696+
return;
16971697
}
16981698

16991699
private void setInputMethodWithSubtypeId(IBinder token, String id, int subtypeId) {

tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeIInputMethodManager.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,9 @@ public void removeClient(IInputMethodClient arg0) throws RemoteException {
107107

108108
}
109109

110-
public boolean setAdditionalInputMethodSubtypes(String arg0, InputMethodSubtype[] arg1)
110+
public void setAdditionalInputMethodSubtypes(String arg0, InputMethodSubtype[] arg1)
111111
throws RemoteException {
112112
// TODO Auto-generated method stub
113-
return false;
114113
}
115114

116115
public boolean setCurrentInputMethodSubtype(InputMethodSubtype arg0) throws RemoteException {
@@ -187,11 +186,4 @@ public IBinder asBinder() {
187186
// TODO Auto-generated method stub
188187
return null;
189188
}
190-
191-
public boolean setAdditionalInputMethodSubtypes(IBinder arg0, InputMethodSubtype[] arg1)
192-
throws RemoteException {
193-
// TODO Auto-generated method stub
194-
return false;
195-
}
196-
197189
}

0 commit comments

Comments
 (0)