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