Loading core/java/android/util/imetracing/ImeTracing.java +1 −5 Original line number Diff line number Diff line Loading @@ -27,8 +27,6 @@ import android.util.Log; import android.util.proto.ProtoOutputStream; import android.view.inputmethod.InputMethodManager; import com.android.internal.inputmethod.Completable; import com.android.internal.inputmethod.ResultCallbacks; import com.android.internal.view.IInputMethodManager; import java.io.PrintWriter; Loading Loading @@ -92,9 +90,7 @@ public abstract class ImeTracing { * @param where */ public void sendToService(byte[] protoDump, int source, String where) throws RemoteException { final Completable.Void value = Completable.createVoid(); mService.startProtoDump(protoDump, source, where, ResultCallbacks.of(value)); Completable.getResult(value); mService.startProtoDump(protoDump, source, where); } /** Loading core/java/android/util/imetracing/ImeTracingClientImpl.java +1 −6 Original line number Diff line number Diff line Loading @@ -24,9 +24,6 @@ import android.util.Log; import android.util.proto.ProtoOutputStream; import android.view.inputmethod.InputMethodManager; import com.android.internal.inputmethod.Completable; import com.android.internal.inputmethod.ResultCallbacks; import java.io.PrintWriter; /** Loading @@ -34,9 +31,7 @@ import java.io.PrintWriter; */ class ImeTracingClientImpl extends ImeTracing { ImeTracingClientImpl() throws ServiceNotFoundException, RemoteException { final Completable.Boolean value = Completable.createBoolean(); mService.isImeTraceEnabled(ResultCallbacks.of(value)); sEnabled = Completable.getResult(value); sEnabled = mService.isImeTraceEnabled(); } @Override Loading core/java/android/view/inputmethod/InputMethodManager.java +34 −104 Original line number Diff line number Diff line Loading @@ -88,10 +88,8 @@ import android.view.WindowManager.LayoutParams.SoftInputModeFlags; import android.view.autofill.AutofillManager; import com.android.internal.annotations.GuardedBy; import com.android.internal.inputmethod.Completable; import com.android.internal.inputmethod.InputMethodDebug; import com.android.internal.inputmethod.InputMethodPrivilegedOperationsRegistry; import com.android.internal.inputmethod.ResultCallbacks; import com.android.internal.inputmethod.SoftInputShowHideReason; import com.android.internal.inputmethod.StartInputFlags; import com.android.internal.inputmethod.StartInputReason; Loading Loading @@ -265,14 +263,6 @@ public final class InputMethodManager { private static final int NOT_A_SUBTYPE_ID = -1; /** * {@code true} to try to avoid blocking apps' UI thread by sending * {@link StartInputReason#WINDOW_FOCUS_GAIN_REPORT_WITH_CONNECTION} and * {@link StartInputReason#WINDOW_FOCUS_GAIN_REPORT_WITHOUT_CONNECTION} in a truly asynchronous * way. {@code false} to go back to the previous synchronous semantics. */ private static final boolean USE_REPORT_WINDOW_GAINED_FOCUS_ASYNC = true; /** * A constant that represents Voice IME. * Loading Loading @@ -686,17 +676,10 @@ public final class InputMethodManager { + ", nextFocusIsServedView=" + nextFocusHasConnection); } if (USE_REPORT_WINDOW_GAINED_FOCUS_ASYNC) { mService.reportWindowGainedFocusAsync( nextFocusHasConnection, mClient, focusedView.getWindowToken(), startInputFlags, softInputMode, windowFlags, mCurRootView.mContext.getApplicationInfo().targetSdkVersion); } else { final int startInputReason = nextFocusHasConnection ? WINDOW_FOCUS_GAIN_REPORT_WITH_CONNECTION : WINDOW_FOCUS_GAIN_REPORT_WITHOUT_CONNECTION; final Completable.InputBindResult value = Completable.createInputBindResult(); // ignore the result mService.startInputOrWindowGainedFocus( startInputReason, mClient, focusedView.getWindowToken(), startInputFlags, softInputMode, Loading @@ -704,10 +687,7 @@ public final class InputMethodManager { null, null, 0 /* missingMethodFlags */, mCurRootView.mContext.getApplicationInfo().targetSdkVersion, ResultCallbacks.of(value)); Completable.getResult(value); // ignore the result } mCurRootView.mContext.getApplicationInfo().targetSdkVersion); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -1249,9 +1229,7 @@ public final class InputMethodManager { // We intentionally do not use UserHandle.getCallingUserId() here because for system // services InputMethodManagerInternal.getInputMethodListAsUser() should be used // instead. final Completable.InputMethodInfoList value = Completable.createInputMethodInfoList(); mService.getInputMethodList(UserHandle.myUserId(), ResultCallbacks.of(value)); return Completable.getResult(value); return mService.getInputMethodList(UserHandle.myUserId()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -1269,9 +1247,7 @@ public final class InputMethodManager { @NonNull public List<InputMethodInfo> getInputMethodListAsUser(@UserIdInt int userId) { try { final Completable.InputMethodInfoList value = Completable.createInputMethodInfoList(); mService.getInputMethodList(userId, ResultCallbacks.of(value)); return Completable.getResult(value); return mService.getInputMethodList(userId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -1289,9 +1265,7 @@ public final class InputMethodManager { // We intentionally do not use UserHandle.getCallingUserId() here because for system // services InputMethodManagerInternal.getEnabledInputMethodListAsUser() should be used // instead. final Completable.InputMethodInfoList value = Completable.createInputMethodInfoList(); mService.getEnabledInputMethodList(UserHandle.myUserId(), ResultCallbacks.of(value)); return Completable.getResult(value); return mService.getEnabledInputMethodList(UserHandle.myUserId()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -1307,9 +1281,7 @@ public final class InputMethodManager { @RequiresPermission(INTERACT_ACROSS_USERS_FULL) public List<InputMethodInfo> getEnabledInputMethodListAsUser(@UserIdInt int userId) { try { final Completable.InputMethodInfoList value = Completable.createInputMethodInfoList(); mService.getEnabledInputMethodList(userId, ResultCallbacks.of(value)); return Completable.getResult(value); return mService.getEnabledInputMethodList(userId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -1328,13 +1300,9 @@ public final class InputMethodManager { public List<InputMethodSubtype> getEnabledInputMethodSubtypeList(InputMethodInfo imi, boolean allowsImplicitlySelectedSubtypes) { try { final Completable.InputMethodSubtypeList value = Completable.createInputMethodSubtypeList(); mService.getEnabledInputMethodSubtypeList( return mService.getEnabledInputMethodSubtypeList( imi == null ? null : imi.getId(), allowsImplicitlySelectedSubtypes, ResultCallbacks.of(value)); return Completable.getResult(value); allowsImplicitlySelectedSubtypes); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -1669,15 +1637,12 @@ public final class InputMethodManager { try { Log.d(TAG, "showSoftInput() view=" + view + " flags=" + flags + " reason=" + InputMethodDebug.softInputDisplayReasonToString(reason)); final Completable.Boolean value = Completable.createBoolean(); mService.showSoftInput( return mService.showSoftInput( mClient, view.getWindowToken(), flags, resultReceiver, reason, ResultCallbacks.of(value)); return Completable.getResult(value); reason); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -1704,15 +1669,12 @@ public final class InputMethodManager { Log.w(TAG, "No current root view, ignoring showSoftInputUnchecked()"); return; } final Completable.Boolean value = Completable.createBoolean(); mService.showSoftInput( mClient, mCurRootView.getView().getWindowToken(), flags, resultReceiver, SoftInputShowHideReason.SHOW_SOFT_INPUT, ResultCallbacks.of(value)); Completable.getResult(value); // ignore the result SoftInputShowHideReason.SHOW_SOFT_INPUT); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -1791,10 +1753,7 @@ public final class InputMethodManager { } try { final Completable.Boolean value = Completable.createBoolean(); mService.hideSoftInput(mClient, windowToken, flags, resultReceiver, reason, ResultCallbacks.of(value)); return Completable.getResult(value); return mService.hideSoftInput(mClient, windowToken, flags, resultReceiver, reason); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -2030,13 +1989,10 @@ public final class InputMethodManager { + InputMethodDebug.startInputFlagsToString(startInputFlags)); } try { final Completable.InputBindResult value = Completable.createInputBindResult(); mService.startInputOrWindowGainedFocus( res = mService.startInputOrWindowGainedFocus( startInputReason, mClient, windowGainingFocus, startInputFlags, softInputMode, windowFlags, tba, servedContext, missingMethodFlags, view.getContext().getApplicationInfo().targetSdkVersion, ResultCallbacks.of(value)); res = Completable.getResult(value); view.getContext().getApplicationInfo().targetSdkVersion); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -2144,15 +2100,12 @@ public final class InputMethodManager { return; } try { final Completable.Boolean value = Completable.createBoolean(); mService.hideSoftInput( mClient, mCurRootView.getView().getWindowToken(), HIDE_NOT_ALWAYS, null, SoftInputShowHideReason.HIDE_SOFT_INPUT, ResultCallbacks.of(value)); Completable.getResult(value); // ignore the result SoftInputShowHideReason.HIDE_SOFT_INPUT); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -2832,10 +2785,7 @@ public final class InputMethodManager { ? SHOW_IM_PICKER_MODE_INCLUDE_AUXILIARY_SUBTYPES : SHOW_IM_PICKER_MODE_EXCLUDE_AUXILIARY_SUBTYPES; try { final Completable.Void value = Completable.createVoid(); mService.showInputMethodPickerFromSystem( mClient, mode, displayId, ResultCallbacks.of(value)); Completable.getResult(value); mService.showInputMethodPickerFromSystem(mClient, mode, displayId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -2843,10 +2793,7 @@ public final class InputMethodManager { private void showInputMethodPickerLocked() { try { final Completable.Void value = Completable.createVoid(); mService.showInputMethodPickerFromClient( mClient, SHOW_IM_PICKER_MODE_AUTO, ResultCallbacks.of(value)); Completable.getResult(value); mService.showInputMethodPickerFromClient(mClient, SHOW_IM_PICKER_MODE_AUTO); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -2866,9 +2813,7 @@ public final class InputMethodManager { @TestApi public boolean isInputMethodPickerShown() { try { final Completable.Boolean value = Completable.createBoolean(); mService.isInputMethodPickerShownForTest(ResultCallbacks.of(value)); return Completable.getResult(value); return mService.isInputMethodPickerShownForTest(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -2882,10 +2827,7 @@ public final class InputMethodManager { */ public void showInputMethodAndSubtypeEnabler(String imiId) { try { final Completable.Void value = Completable.createVoid(); mService.showInputMethodAndSubtypeEnablerFromClient( mClient, imiId, ResultCallbacks.of(value)); Completable.getResult(value); mService.showInputMethodAndSubtypeEnablerFromClient(mClient, imiId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -2898,9 +2840,7 @@ public final class InputMethodManager { */ public InputMethodSubtype getCurrentInputMethodSubtype() { try { final Completable.InputMethodSubtype value = Completable.createInputMethodSubtype(); mService.getCurrentInputMethodSubtype(ResultCallbacks.of(value)); return Completable.getResult(value); return mService.getCurrentInputMethodSubtype(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -2949,11 +2889,7 @@ public final class InputMethodManager { } final List<InputMethodSubtype> enabledSubtypes; try { final Completable.InputMethodSubtypeList value = Completable.createInputMethodSubtypeList(); mService.getEnabledInputMethodSubtypeList( imeId, true, ResultCallbacks.of(value)); enabledSubtypes = Completable.getResult(value); enabledSubtypes = mService.getEnabledInputMethodSubtypeList(imeId, true); } catch (RemoteException e) { return false; } Loading Loading @@ -3021,9 +2957,7 @@ public final class InputMethodManager { @UnsupportedAppUsage public int getInputMethodWindowVisibleHeight() { try { final Completable.Int value = Completable.createInt(); mService.getInputMethodWindowVisibleHeight(ResultCallbacks.of(value)); return Completable.getIntResult(value); return mService.getInputMethodWindowVisibleHeight(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -3118,9 +3052,7 @@ public final class InputMethodManager { @Deprecated public void setAdditionalInputMethodSubtypes(String imiId, InputMethodSubtype[] subtypes) { try { final Completable.Void value = Completable.createVoid(); mService.setAdditionalInputMethodSubtypes(imiId, subtypes, ResultCallbacks.of(value)); Completable.getResult(value); mService.setAdditionalInputMethodSubtypes(imiId, subtypes); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -3128,9 +3060,7 @@ public final class InputMethodManager { public InputMethodSubtype getLastInputMethodSubtype() { try { final Completable.InputMethodSubtype value = Completable.createInputMethodSubtype(); mService.getLastInputMethodSubtype(ResultCallbacks.of(value)); return Completable.getResult(value); return mService.getLastInputMethodSubtype(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading core/java/com/android/internal/view/IInputMethodManager.aidl +25 −45 Original line number Diff line number Diff line Loading @@ -24,13 +24,6 @@ import android.view.inputmethod.EditorInfo; import com.android.internal.view.InputBindResult; import com.android.internal.view.IInputContext; import com.android.internal.view.IInputMethodClient; import com.android.internal.inputmethod.IBooleanResultCallback; import com.android.internal.inputmethod.IInputBindResultResultCallback; import com.android.internal.inputmethod.IInputMethodInfoListResultCallback; import com.android.internal.inputmethod.IInputMethodSubtypeResultCallback; import com.android.internal.inputmethod.IInputMethodSubtypeListResultCallback; import com.android.internal.inputmethod.IIntResultCallback; import com.android.internal.inputmethod.IVoidResultCallback; /** * Public interface to the global input method manager, used by all client Loading @@ -41,64 +34,51 @@ interface IInputMethodManager { int untrustedDisplayId); // TODO: Use ParceledListSlice instead oneway void getInputMethodList(int userId, in IInputMethodInfoListResultCallback resultCallback); List<InputMethodInfo> getInputMethodList(int userId); // TODO: Use ParceledListSlice instead oneway void getEnabledInputMethodList(int userId, in IInputMethodInfoListResultCallback resultCallback); oneway void getEnabledInputMethodSubtypeList(in String imiId, boolean allowsImplicitlySelectedSubtypes, in IInputMethodSubtypeListResultCallback resultCallback); oneway void getLastInputMethodSubtype(in IInputMethodSubtypeResultCallback resultCallback); List<InputMethodInfo> getEnabledInputMethodList(int userId); List<InputMethodSubtype> getEnabledInputMethodSubtypeList(in String imiId, boolean allowsImplicitlySelectedSubtypes); InputMethodSubtype getLastInputMethodSubtype(); oneway void showSoftInput(in IInputMethodClient client, IBinder windowToken, int flags, in ResultReceiver resultReceiver, int reason, in IBooleanResultCallback resultCallback); oneway void hideSoftInput(in IInputMethodClient client, IBinder windowToken, int flags, in ResultReceiver resultReceiver, int reason, in IBooleanResultCallback resultCallback); boolean showSoftInput(in IInputMethodClient client, IBinder windowToken, int flags, in ResultReceiver resultReceiver, int reason); boolean hideSoftInput(in IInputMethodClient client, IBinder windowToken, int flags, in ResultReceiver resultReceiver, int reason); // If windowToken is null, this just does startInput(). Otherwise this reports that a window // has gained focus, and if 'attribute' is non-null then also does startInput. // @NonNull oneway void startInputOrWindowGainedFocus( InputBindResult startInputOrWindowGainedFocus( /* @StartInputReason */ int startInputReason, in IInputMethodClient client, in IBinder windowToken, /* @StartInputFlags */ int startInputFlags, /* @android.view.WindowManager.LayoutParams.SoftInputModeFlags */ int softInputMode, int windowFlags, in EditorInfo attribute, IInputContext inputContext, /* @InputConnectionInspector.MissingMethodFlags */ int missingMethodFlags, int unverifiedTargetSdkVersion, in IInputBindResultResultCallback inputBindResult); int unverifiedTargetSdkVersion); oneway void reportWindowGainedFocusAsync( boolean nextFocusHasConnection, in IInputMethodClient client, in IBinder windowToken, /* @StartInputFlags */ int startInputFlags, /* @android.view.WindowManager.LayoutParams.SoftInputModeFlags */ int softInputMode, int windowFlags, int unverifiedTargetSdkVersion); oneway void showInputMethodPickerFromClient(in IInputMethodClient client, int auxiliarySubtypeMode, in IVoidResultCallback resultCallback); oneway void showInputMethodPickerFromSystem(in IInputMethodClient client, int auxiliarySubtypeMode, int displayId, in IVoidResultCallback resultCallback); oneway void showInputMethodAndSubtypeEnablerFromClient(in IInputMethodClient client, String topId, in IVoidResultCallback resultCallback); oneway void isInputMethodPickerShownForTest(in IBooleanResultCallback resultCallback); oneway void getCurrentInputMethodSubtype(in IInputMethodSubtypeResultCallback resultCallback); oneway void setAdditionalInputMethodSubtypes(String id, in InputMethodSubtype[] subtypes, in IVoidResultCallback resultCallback); void showInputMethodPickerFromClient(in IInputMethodClient client, int auxiliarySubtypeMode); void showInputMethodPickerFromSystem(in IInputMethodClient client, int auxiliarySubtypeMode, int displayId); void showInputMethodAndSubtypeEnablerFromClient(in IInputMethodClient client, String topId); boolean isInputMethodPickerShownForTest(); InputMethodSubtype getCurrentInputMethodSubtype(); void setAdditionalInputMethodSubtypes(String id, in InputMethodSubtype[] subtypes); // This is kept due to @UnsupportedAppUsage. // TODO(Bug 113914148): Consider removing this. oneway void getInputMethodWindowVisibleHeight(IIntResultCallback resultCallback); int getInputMethodWindowVisibleHeight(); oneway void reportPerceptibleAsync(in IBinder windowToken, boolean perceptible); /** Remove the IME surface. Requires INTERNAL_SYSTEM_WINDOW permission. */ oneway void removeImeSurface(in IVoidResultCallback resultCallback); void removeImeSurface(); /** Remove the IME surface. Requires passing the currently focused window. */ oneway void removeImeSurfaceFromWindowAsync(in IBinder windowToken); oneway void startProtoDump(in byte[] protoDump, int source, String where, in IVoidResultCallback resultCallback); oneway void isImeTraceEnabled(in IBooleanResultCallback resultCallback); void startProtoDump(in byte[] protoDump, int source, String where); boolean isImeTraceEnabled(); // Starts an ime trace. oneway void startImeTrace(in IVoidResultCallback resultCallback); void startImeTrace(); // Stops an ime trace. oneway void stopImeTrace(in IVoidResultCallback resultCallback); void stopImeTrace(); } libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayImeController.java +1 −5 Original line number Diff line number Diff line Loading @@ -42,8 +42,6 @@ import android.view.animation.PathInterpolator; import androidx.annotation.BinderThread; import androidx.annotation.VisibleForTesting; import com.android.internal.inputmethod.Completable; import com.android.internal.inputmethod.ResultCallbacks; import com.android.internal.view.IInputMethodManager; import java.util.ArrayList; Loading Loading @@ -540,9 +538,7 @@ public class DisplayImeController implements DisplayController.OnDisplaysChanged try { // Remove the IME surface to make the insets invisible for // non-client controlled insets. final Completable.Void value = Completable.createVoid(); imms.removeImeSurface(ResultCallbacks.of(value)); Completable.getResult(value); imms.removeImeSurface(); } catch (RemoteException e) { Slog.e(TAG, "Failed to remove IME surface.", e); } Loading Loading
core/java/android/util/imetracing/ImeTracing.java +1 −5 Original line number Diff line number Diff line Loading @@ -27,8 +27,6 @@ import android.util.Log; import android.util.proto.ProtoOutputStream; import android.view.inputmethod.InputMethodManager; import com.android.internal.inputmethod.Completable; import com.android.internal.inputmethod.ResultCallbacks; import com.android.internal.view.IInputMethodManager; import java.io.PrintWriter; Loading Loading @@ -92,9 +90,7 @@ public abstract class ImeTracing { * @param where */ public void sendToService(byte[] protoDump, int source, String where) throws RemoteException { final Completable.Void value = Completable.createVoid(); mService.startProtoDump(protoDump, source, where, ResultCallbacks.of(value)); Completable.getResult(value); mService.startProtoDump(protoDump, source, where); } /** Loading
core/java/android/util/imetracing/ImeTracingClientImpl.java +1 −6 Original line number Diff line number Diff line Loading @@ -24,9 +24,6 @@ import android.util.Log; import android.util.proto.ProtoOutputStream; import android.view.inputmethod.InputMethodManager; import com.android.internal.inputmethod.Completable; import com.android.internal.inputmethod.ResultCallbacks; import java.io.PrintWriter; /** Loading @@ -34,9 +31,7 @@ import java.io.PrintWriter; */ class ImeTracingClientImpl extends ImeTracing { ImeTracingClientImpl() throws ServiceNotFoundException, RemoteException { final Completable.Boolean value = Completable.createBoolean(); mService.isImeTraceEnabled(ResultCallbacks.of(value)); sEnabled = Completable.getResult(value); sEnabled = mService.isImeTraceEnabled(); } @Override Loading
core/java/android/view/inputmethod/InputMethodManager.java +34 −104 Original line number Diff line number Diff line Loading @@ -88,10 +88,8 @@ import android.view.WindowManager.LayoutParams.SoftInputModeFlags; import android.view.autofill.AutofillManager; import com.android.internal.annotations.GuardedBy; import com.android.internal.inputmethod.Completable; import com.android.internal.inputmethod.InputMethodDebug; import com.android.internal.inputmethod.InputMethodPrivilegedOperationsRegistry; import com.android.internal.inputmethod.ResultCallbacks; import com.android.internal.inputmethod.SoftInputShowHideReason; import com.android.internal.inputmethod.StartInputFlags; import com.android.internal.inputmethod.StartInputReason; Loading Loading @@ -265,14 +263,6 @@ public final class InputMethodManager { private static final int NOT_A_SUBTYPE_ID = -1; /** * {@code true} to try to avoid blocking apps' UI thread by sending * {@link StartInputReason#WINDOW_FOCUS_GAIN_REPORT_WITH_CONNECTION} and * {@link StartInputReason#WINDOW_FOCUS_GAIN_REPORT_WITHOUT_CONNECTION} in a truly asynchronous * way. {@code false} to go back to the previous synchronous semantics. */ private static final boolean USE_REPORT_WINDOW_GAINED_FOCUS_ASYNC = true; /** * A constant that represents Voice IME. * Loading Loading @@ -686,17 +676,10 @@ public final class InputMethodManager { + ", nextFocusIsServedView=" + nextFocusHasConnection); } if (USE_REPORT_WINDOW_GAINED_FOCUS_ASYNC) { mService.reportWindowGainedFocusAsync( nextFocusHasConnection, mClient, focusedView.getWindowToken(), startInputFlags, softInputMode, windowFlags, mCurRootView.mContext.getApplicationInfo().targetSdkVersion); } else { final int startInputReason = nextFocusHasConnection ? WINDOW_FOCUS_GAIN_REPORT_WITH_CONNECTION : WINDOW_FOCUS_GAIN_REPORT_WITHOUT_CONNECTION; final Completable.InputBindResult value = Completable.createInputBindResult(); // ignore the result mService.startInputOrWindowGainedFocus( startInputReason, mClient, focusedView.getWindowToken(), startInputFlags, softInputMode, Loading @@ -704,10 +687,7 @@ public final class InputMethodManager { null, null, 0 /* missingMethodFlags */, mCurRootView.mContext.getApplicationInfo().targetSdkVersion, ResultCallbacks.of(value)); Completable.getResult(value); // ignore the result } mCurRootView.mContext.getApplicationInfo().targetSdkVersion); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -1249,9 +1229,7 @@ public final class InputMethodManager { // We intentionally do not use UserHandle.getCallingUserId() here because for system // services InputMethodManagerInternal.getInputMethodListAsUser() should be used // instead. final Completable.InputMethodInfoList value = Completable.createInputMethodInfoList(); mService.getInputMethodList(UserHandle.myUserId(), ResultCallbacks.of(value)); return Completable.getResult(value); return mService.getInputMethodList(UserHandle.myUserId()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -1269,9 +1247,7 @@ public final class InputMethodManager { @NonNull public List<InputMethodInfo> getInputMethodListAsUser(@UserIdInt int userId) { try { final Completable.InputMethodInfoList value = Completable.createInputMethodInfoList(); mService.getInputMethodList(userId, ResultCallbacks.of(value)); return Completable.getResult(value); return mService.getInputMethodList(userId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -1289,9 +1265,7 @@ public final class InputMethodManager { // We intentionally do not use UserHandle.getCallingUserId() here because for system // services InputMethodManagerInternal.getEnabledInputMethodListAsUser() should be used // instead. final Completable.InputMethodInfoList value = Completable.createInputMethodInfoList(); mService.getEnabledInputMethodList(UserHandle.myUserId(), ResultCallbacks.of(value)); return Completable.getResult(value); return mService.getEnabledInputMethodList(UserHandle.myUserId()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -1307,9 +1281,7 @@ public final class InputMethodManager { @RequiresPermission(INTERACT_ACROSS_USERS_FULL) public List<InputMethodInfo> getEnabledInputMethodListAsUser(@UserIdInt int userId) { try { final Completable.InputMethodInfoList value = Completable.createInputMethodInfoList(); mService.getEnabledInputMethodList(userId, ResultCallbacks.of(value)); return Completable.getResult(value); return mService.getEnabledInputMethodList(userId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -1328,13 +1300,9 @@ public final class InputMethodManager { public List<InputMethodSubtype> getEnabledInputMethodSubtypeList(InputMethodInfo imi, boolean allowsImplicitlySelectedSubtypes) { try { final Completable.InputMethodSubtypeList value = Completable.createInputMethodSubtypeList(); mService.getEnabledInputMethodSubtypeList( return mService.getEnabledInputMethodSubtypeList( imi == null ? null : imi.getId(), allowsImplicitlySelectedSubtypes, ResultCallbacks.of(value)); return Completable.getResult(value); allowsImplicitlySelectedSubtypes); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -1669,15 +1637,12 @@ public final class InputMethodManager { try { Log.d(TAG, "showSoftInput() view=" + view + " flags=" + flags + " reason=" + InputMethodDebug.softInputDisplayReasonToString(reason)); final Completable.Boolean value = Completable.createBoolean(); mService.showSoftInput( return mService.showSoftInput( mClient, view.getWindowToken(), flags, resultReceiver, reason, ResultCallbacks.of(value)); return Completable.getResult(value); reason); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -1704,15 +1669,12 @@ public final class InputMethodManager { Log.w(TAG, "No current root view, ignoring showSoftInputUnchecked()"); return; } final Completable.Boolean value = Completable.createBoolean(); mService.showSoftInput( mClient, mCurRootView.getView().getWindowToken(), flags, resultReceiver, SoftInputShowHideReason.SHOW_SOFT_INPUT, ResultCallbacks.of(value)); Completable.getResult(value); // ignore the result SoftInputShowHideReason.SHOW_SOFT_INPUT); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -1791,10 +1753,7 @@ public final class InputMethodManager { } try { final Completable.Boolean value = Completable.createBoolean(); mService.hideSoftInput(mClient, windowToken, flags, resultReceiver, reason, ResultCallbacks.of(value)); return Completable.getResult(value); return mService.hideSoftInput(mClient, windowToken, flags, resultReceiver, reason); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -2030,13 +1989,10 @@ public final class InputMethodManager { + InputMethodDebug.startInputFlagsToString(startInputFlags)); } try { final Completable.InputBindResult value = Completable.createInputBindResult(); mService.startInputOrWindowGainedFocus( res = mService.startInputOrWindowGainedFocus( startInputReason, mClient, windowGainingFocus, startInputFlags, softInputMode, windowFlags, tba, servedContext, missingMethodFlags, view.getContext().getApplicationInfo().targetSdkVersion, ResultCallbacks.of(value)); res = Completable.getResult(value); view.getContext().getApplicationInfo().targetSdkVersion); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -2144,15 +2100,12 @@ public final class InputMethodManager { return; } try { final Completable.Boolean value = Completable.createBoolean(); mService.hideSoftInput( mClient, mCurRootView.getView().getWindowToken(), HIDE_NOT_ALWAYS, null, SoftInputShowHideReason.HIDE_SOFT_INPUT, ResultCallbacks.of(value)); Completable.getResult(value); // ignore the result SoftInputShowHideReason.HIDE_SOFT_INPUT); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -2832,10 +2785,7 @@ public final class InputMethodManager { ? SHOW_IM_PICKER_MODE_INCLUDE_AUXILIARY_SUBTYPES : SHOW_IM_PICKER_MODE_EXCLUDE_AUXILIARY_SUBTYPES; try { final Completable.Void value = Completable.createVoid(); mService.showInputMethodPickerFromSystem( mClient, mode, displayId, ResultCallbacks.of(value)); Completable.getResult(value); mService.showInputMethodPickerFromSystem(mClient, mode, displayId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -2843,10 +2793,7 @@ public final class InputMethodManager { private void showInputMethodPickerLocked() { try { final Completable.Void value = Completable.createVoid(); mService.showInputMethodPickerFromClient( mClient, SHOW_IM_PICKER_MODE_AUTO, ResultCallbacks.of(value)); Completable.getResult(value); mService.showInputMethodPickerFromClient(mClient, SHOW_IM_PICKER_MODE_AUTO); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -2866,9 +2813,7 @@ public final class InputMethodManager { @TestApi public boolean isInputMethodPickerShown() { try { final Completable.Boolean value = Completable.createBoolean(); mService.isInputMethodPickerShownForTest(ResultCallbacks.of(value)); return Completable.getResult(value); return mService.isInputMethodPickerShownForTest(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -2882,10 +2827,7 @@ public final class InputMethodManager { */ public void showInputMethodAndSubtypeEnabler(String imiId) { try { final Completable.Void value = Completable.createVoid(); mService.showInputMethodAndSubtypeEnablerFromClient( mClient, imiId, ResultCallbacks.of(value)); Completable.getResult(value); mService.showInputMethodAndSubtypeEnablerFromClient(mClient, imiId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -2898,9 +2840,7 @@ public final class InputMethodManager { */ public InputMethodSubtype getCurrentInputMethodSubtype() { try { final Completable.InputMethodSubtype value = Completable.createInputMethodSubtype(); mService.getCurrentInputMethodSubtype(ResultCallbacks.of(value)); return Completable.getResult(value); return mService.getCurrentInputMethodSubtype(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -2949,11 +2889,7 @@ public final class InputMethodManager { } final List<InputMethodSubtype> enabledSubtypes; try { final Completable.InputMethodSubtypeList value = Completable.createInputMethodSubtypeList(); mService.getEnabledInputMethodSubtypeList( imeId, true, ResultCallbacks.of(value)); enabledSubtypes = Completable.getResult(value); enabledSubtypes = mService.getEnabledInputMethodSubtypeList(imeId, true); } catch (RemoteException e) { return false; } Loading Loading @@ -3021,9 +2957,7 @@ public final class InputMethodManager { @UnsupportedAppUsage public int getInputMethodWindowVisibleHeight() { try { final Completable.Int value = Completable.createInt(); mService.getInputMethodWindowVisibleHeight(ResultCallbacks.of(value)); return Completable.getIntResult(value); return mService.getInputMethodWindowVisibleHeight(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -3118,9 +3052,7 @@ public final class InputMethodManager { @Deprecated public void setAdditionalInputMethodSubtypes(String imiId, InputMethodSubtype[] subtypes) { try { final Completable.Void value = Completable.createVoid(); mService.setAdditionalInputMethodSubtypes(imiId, subtypes, ResultCallbacks.of(value)); Completable.getResult(value); mService.setAdditionalInputMethodSubtypes(imiId, subtypes); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -3128,9 +3060,7 @@ public final class InputMethodManager { public InputMethodSubtype getLastInputMethodSubtype() { try { final Completable.InputMethodSubtype value = Completable.createInputMethodSubtype(); mService.getLastInputMethodSubtype(ResultCallbacks.of(value)); return Completable.getResult(value); return mService.getLastInputMethodSubtype(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading
core/java/com/android/internal/view/IInputMethodManager.aidl +25 −45 Original line number Diff line number Diff line Loading @@ -24,13 +24,6 @@ import android.view.inputmethod.EditorInfo; import com.android.internal.view.InputBindResult; import com.android.internal.view.IInputContext; import com.android.internal.view.IInputMethodClient; import com.android.internal.inputmethod.IBooleanResultCallback; import com.android.internal.inputmethod.IInputBindResultResultCallback; import com.android.internal.inputmethod.IInputMethodInfoListResultCallback; import com.android.internal.inputmethod.IInputMethodSubtypeResultCallback; import com.android.internal.inputmethod.IInputMethodSubtypeListResultCallback; import com.android.internal.inputmethod.IIntResultCallback; import com.android.internal.inputmethod.IVoidResultCallback; /** * Public interface to the global input method manager, used by all client Loading @@ -41,64 +34,51 @@ interface IInputMethodManager { int untrustedDisplayId); // TODO: Use ParceledListSlice instead oneway void getInputMethodList(int userId, in IInputMethodInfoListResultCallback resultCallback); List<InputMethodInfo> getInputMethodList(int userId); // TODO: Use ParceledListSlice instead oneway void getEnabledInputMethodList(int userId, in IInputMethodInfoListResultCallback resultCallback); oneway void getEnabledInputMethodSubtypeList(in String imiId, boolean allowsImplicitlySelectedSubtypes, in IInputMethodSubtypeListResultCallback resultCallback); oneway void getLastInputMethodSubtype(in IInputMethodSubtypeResultCallback resultCallback); List<InputMethodInfo> getEnabledInputMethodList(int userId); List<InputMethodSubtype> getEnabledInputMethodSubtypeList(in String imiId, boolean allowsImplicitlySelectedSubtypes); InputMethodSubtype getLastInputMethodSubtype(); oneway void showSoftInput(in IInputMethodClient client, IBinder windowToken, int flags, in ResultReceiver resultReceiver, int reason, in IBooleanResultCallback resultCallback); oneway void hideSoftInput(in IInputMethodClient client, IBinder windowToken, int flags, in ResultReceiver resultReceiver, int reason, in IBooleanResultCallback resultCallback); boolean showSoftInput(in IInputMethodClient client, IBinder windowToken, int flags, in ResultReceiver resultReceiver, int reason); boolean hideSoftInput(in IInputMethodClient client, IBinder windowToken, int flags, in ResultReceiver resultReceiver, int reason); // If windowToken is null, this just does startInput(). Otherwise this reports that a window // has gained focus, and if 'attribute' is non-null then also does startInput. // @NonNull oneway void startInputOrWindowGainedFocus( InputBindResult startInputOrWindowGainedFocus( /* @StartInputReason */ int startInputReason, in IInputMethodClient client, in IBinder windowToken, /* @StartInputFlags */ int startInputFlags, /* @android.view.WindowManager.LayoutParams.SoftInputModeFlags */ int softInputMode, int windowFlags, in EditorInfo attribute, IInputContext inputContext, /* @InputConnectionInspector.MissingMethodFlags */ int missingMethodFlags, int unverifiedTargetSdkVersion, in IInputBindResultResultCallback inputBindResult); int unverifiedTargetSdkVersion); oneway void reportWindowGainedFocusAsync( boolean nextFocusHasConnection, in IInputMethodClient client, in IBinder windowToken, /* @StartInputFlags */ int startInputFlags, /* @android.view.WindowManager.LayoutParams.SoftInputModeFlags */ int softInputMode, int windowFlags, int unverifiedTargetSdkVersion); oneway void showInputMethodPickerFromClient(in IInputMethodClient client, int auxiliarySubtypeMode, in IVoidResultCallback resultCallback); oneway void showInputMethodPickerFromSystem(in IInputMethodClient client, int auxiliarySubtypeMode, int displayId, in IVoidResultCallback resultCallback); oneway void showInputMethodAndSubtypeEnablerFromClient(in IInputMethodClient client, String topId, in IVoidResultCallback resultCallback); oneway void isInputMethodPickerShownForTest(in IBooleanResultCallback resultCallback); oneway void getCurrentInputMethodSubtype(in IInputMethodSubtypeResultCallback resultCallback); oneway void setAdditionalInputMethodSubtypes(String id, in InputMethodSubtype[] subtypes, in IVoidResultCallback resultCallback); void showInputMethodPickerFromClient(in IInputMethodClient client, int auxiliarySubtypeMode); void showInputMethodPickerFromSystem(in IInputMethodClient client, int auxiliarySubtypeMode, int displayId); void showInputMethodAndSubtypeEnablerFromClient(in IInputMethodClient client, String topId); boolean isInputMethodPickerShownForTest(); InputMethodSubtype getCurrentInputMethodSubtype(); void setAdditionalInputMethodSubtypes(String id, in InputMethodSubtype[] subtypes); // This is kept due to @UnsupportedAppUsage. // TODO(Bug 113914148): Consider removing this. oneway void getInputMethodWindowVisibleHeight(IIntResultCallback resultCallback); int getInputMethodWindowVisibleHeight(); oneway void reportPerceptibleAsync(in IBinder windowToken, boolean perceptible); /** Remove the IME surface. Requires INTERNAL_SYSTEM_WINDOW permission. */ oneway void removeImeSurface(in IVoidResultCallback resultCallback); void removeImeSurface(); /** Remove the IME surface. Requires passing the currently focused window. */ oneway void removeImeSurfaceFromWindowAsync(in IBinder windowToken); oneway void startProtoDump(in byte[] protoDump, int source, String where, in IVoidResultCallback resultCallback); oneway void isImeTraceEnabled(in IBooleanResultCallback resultCallback); void startProtoDump(in byte[] protoDump, int source, String where); boolean isImeTraceEnabled(); // Starts an ime trace. oneway void startImeTrace(in IVoidResultCallback resultCallback); void startImeTrace(); // Stops an ime trace. oneway void stopImeTrace(in IVoidResultCallback resultCallback); void stopImeTrace(); }
libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayImeController.java +1 −5 Original line number Diff line number Diff line Loading @@ -42,8 +42,6 @@ import android.view.animation.PathInterpolator; import androidx.annotation.BinderThread; import androidx.annotation.VisibleForTesting; import com.android.internal.inputmethod.Completable; import com.android.internal.inputmethod.ResultCallbacks; import com.android.internal.view.IInputMethodManager; import java.util.ArrayList; Loading Loading @@ -540,9 +538,7 @@ public class DisplayImeController implements DisplayController.OnDisplaysChanged try { // Remove the IME surface to make the insets invisible for // non-client controlled insets. final Completable.Void value = Completable.createVoid(); imms.removeImeSurface(ResultCallbacks.of(value)); Completable.getResult(value); imms.removeImeSurface(); } catch (RemoteException e) { Slog.e(TAG, "Failed to remove IME surface.", e); } Loading