Loading api/test-current.txt +8 −0 Original line number Diff line number Diff line Loading @@ -1056,6 +1056,14 @@ package android.view.autofill { } package android.view.inputmethod { public final class InputMethodManager { method public boolean isInputMethodPickerShown(); } } package android.widget { public abstract class AbsListView extends android.widget.AdapterView implements android.widget.Filter.FilterListener android.text.TextWatcher android.view.ViewTreeObserver.OnGlobalLayoutListener android.view.ViewTreeObserver.OnTouchModeChangeListener { Loading core/java/android/view/inputmethod/InputMethodManager.java +21 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.annotation.SystemService; import android.annotation.TestApi; import android.content.Context; import android.graphics.Rect; import android.inputmethodservice.InputMethodService; Loading Loading @@ -2136,6 +2137,26 @@ public final class InputMethodManager { } } /** * A test API for CTS to make sure that {@link #showInputMethodPicker()} works as expected. * * <p>When customizing the implementation of {@link #showInputMethodPicker()} API, make sure * that this test API returns when and only while and only while * {@link #showInputMethodPicker()} is showing UI. Otherwise your OS implementation may not * pass CTS.</p> * * @return {@code true} while and only while {@link #showInputMethodPicker()} is showing UI. * @hide */ @TestApi public boolean isInputMethodPickerShown() { try { return mService.isInputMethodPickerShownForTest(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Show the settings for enabling subtypes of the specified input method. * @param imiId An input method, whose subtypes settings will be shown. If imiId is null, Loading core/java/com/android/internal/view/IInputMethodManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,7 @@ interface IInputMethodManager { void showInputMethodPickerFromClient(in IInputMethodClient client, int auxiliarySubtypeMode); void showInputMethodAndSubtypeEnablerFromClient(in IInputMethodClient client, String topId); boolean isInputMethodPickerShownForTest(); void setInputMethod(in IBinder token, String id); void setInputMethodAndSubtype(in IBinder token, String id, in InputMethodSubtype subtype); void hideMySoftInput(in IBinder token, int flags); Loading services/core/java/com/android/server/InputMethodManagerService.java +13 −3 Original line number Diff line number Diff line Loading @@ -59,6 +59,7 @@ import android.annotation.MainThread; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.annotation.TestApi; import android.annotation.UserIdInt; import android.app.ActivityManager; import android.app.ActivityManagerInternal; Loading Loading @@ -468,7 +469,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub int mCurFocusedWindowSoftInputMode; /** * The client by which {@link #mCurFocusedWindow} was reported. Used only for debugging. * The client by which {@link #mCurFocusedWindow} was reported. */ ClientState mCurFocusedWindowClient; Loading Loading @@ -2989,8 +2990,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub final int uid = Binder.getCallingUid(); if (UserHandle.getAppId(uid) == Process.SYSTEM_UID) { return true; } else if (mCurClient != null && client != null && mCurClient.client.asBinder() == client.asBinder()) { } else if (mCurFocusedWindowClient != null && client != null && mCurFocusedWindowClient.client.asBinder() == client.asBinder()) { return true; } else if (mCurIntent != null && InputMethodUtils.checkIfPackageBelongsToUid( mAppOpsManager, Loading Loading @@ -3026,6 +3027,15 @@ public class InputMethodManagerService extends IInputMethodManager.Stub } } public boolean isInputMethodPickerShownForTest() { synchronized(mMethodMap) { if (mSwitchingDialog == null) { return false; } return mSwitchingDialog.isShowing(); } } @Override public void setInputMethod(IBinder token, String id) { if (!calledFromValidUser()) { Loading Loading
api/test-current.txt +8 −0 Original line number Diff line number Diff line Loading @@ -1056,6 +1056,14 @@ package android.view.autofill { } package android.view.inputmethod { public final class InputMethodManager { method public boolean isInputMethodPickerShown(); } } package android.widget { public abstract class AbsListView extends android.widget.AdapterView implements android.widget.Filter.FilterListener android.text.TextWatcher android.view.ViewTreeObserver.OnGlobalLayoutListener android.view.ViewTreeObserver.OnTouchModeChangeListener { Loading
core/java/android/view/inputmethod/InputMethodManager.java +21 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.annotation.SystemService; import android.annotation.TestApi; import android.content.Context; import android.graphics.Rect; import android.inputmethodservice.InputMethodService; Loading Loading @@ -2136,6 +2137,26 @@ public final class InputMethodManager { } } /** * A test API for CTS to make sure that {@link #showInputMethodPicker()} works as expected. * * <p>When customizing the implementation of {@link #showInputMethodPicker()} API, make sure * that this test API returns when and only while and only while * {@link #showInputMethodPicker()} is showing UI. Otherwise your OS implementation may not * pass CTS.</p> * * @return {@code true} while and only while {@link #showInputMethodPicker()} is showing UI. * @hide */ @TestApi public boolean isInputMethodPickerShown() { try { return mService.isInputMethodPickerShownForTest(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Show the settings for enabling subtypes of the specified input method. * @param imiId An input method, whose subtypes settings will be shown. If imiId is null, Loading
core/java/com/android/internal/view/IInputMethodManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,7 @@ interface IInputMethodManager { void showInputMethodPickerFromClient(in IInputMethodClient client, int auxiliarySubtypeMode); void showInputMethodAndSubtypeEnablerFromClient(in IInputMethodClient client, String topId); boolean isInputMethodPickerShownForTest(); void setInputMethod(in IBinder token, String id); void setInputMethodAndSubtype(in IBinder token, String id, in InputMethodSubtype subtype); void hideMySoftInput(in IBinder token, int flags); Loading
services/core/java/com/android/server/InputMethodManagerService.java +13 −3 Original line number Diff line number Diff line Loading @@ -59,6 +59,7 @@ import android.annotation.MainThread; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.annotation.TestApi; import android.annotation.UserIdInt; import android.app.ActivityManager; import android.app.ActivityManagerInternal; Loading Loading @@ -468,7 +469,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub int mCurFocusedWindowSoftInputMode; /** * The client by which {@link #mCurFocusedWindow} was reported. Used only for debugging. * The client by which {@link #mCurFocusedWindow} was reported. */ ClientState mCurFocusedWindowClient; Loading Loading @@ -2989,8 +2990,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub final int uid = Binder.getCallingUid(); if (UserHandle.getAppId(uid) == Process.SYSTEM_UID) { return true; } else if (mCurClient != null && client != null && mCurClient.client.asBinder() == client.asBinder()) { } else if (mCurFocusedWindowClient != null && client != null && mCurFocusedWindowClient.client.asBinder() == client.asBinder()) { return true; } else if (mCurIntent != null && InputMethodUtils.checkIfPackageBelongsToUid( mAppOpsManager, Loading Loading @@ -3026,6 +3027,15 @@ public class InputMethodManagerService extends IInputMethodManager.Stub } } public boolean isInputMethodPickerShownForTest() { synchronized(mMethodMap) { if (mSwitchingDialog == null) { return false; } return mSwitchingDialog.isShowing(); } } @Override public void setInputMethod(IBinder token, String id) { if (!calledFromValidUser()) { Loading