Loading core/api/test-current.txt +8 −0 Original line number Diff line number Diff line Loading @@ -839,6 +839,14 @@ package android.hardware.soundtrigger { } package android.inputmethodservice { public class InputMethodService extends android.inputmethodservice.AbstractInputMethodService { field public static final long FINISH_INPUT_NO_FALLBACK_CONNECTION = 156215187L; // 0x94fa793L } } package android.location { public final class GnssClock implements android.os.Parcelable { Loading core/java/android/inputmethodservice/IInputMethodSessionWrapper.java +10 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,8 @@ class IInputMethodSessionWrapper extends IInputMethodSession.Stub private static final int DO_VIEW_CLICKED = 115; private static final int DO_NOTIFY_IME_HIDDEN = 120; private static final int DO_REMOVE_IME_SURFACE = 130; private static final int DO_FINISH_INPUT = 140; @UnsupportedAppUsage HandlerCaller mCaller; Loading Loading @@ -141,6 +143,10 @@ class IInputMethodSessionWrapper extends IInputMethodSession.Stub mInputMethodSession.removeImeSurface(); return; } case DO_FINISH_INPUT: { mInputMethodSession.finishInput(); return; } } Log.w(TAG, "Unhandled message code: " + msg.what); } Loading Loading @@ -222,6 +228,10 @@ class IInputMethodSessionWrapper extends IInputMethodSession.Stub mCaller.executeOrSendMessage(mCaller.obtainMessage(DO_FINISH_SESSION)); } @Override public void finishInput() { mCaller.executeOrSendMessage(mCaller.obtainMessage(DO_FINISH_INPUT)); } private final class ImeInputEventReceiver extends InputEventReceiver implements InputMethodSession.EventCallback { private final SparseArray<InputEvent> mPendingEvents = new SparseArray<InputEvent>(); Loading core/java/android/inputmethodservice/InputMethodService.java +27 −2 Original line number Diff line number Diff line Loading @@ -62,9 +62,12 @@ import android.annotation.IntDef; import android.annotation.MainThread; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.TestApi; import android.annotation.UiContext; import android.app.ActivityManager; import android.app.Dialog; import android.compat.annotation.ChangeId; import android.compat.annotation.EnabledSince; import android.compat.annotation.UnsupportedAppUsage; import android.content.Context; import android.content.pm.PackageManager; Loading Loading @@ -413,6 +416,28 @@ public class InputMethodService extends AbstractInputMethodService { @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) int mTheme = 0; /** * Finish the {@link InputConnection} when the device becomes * {@link android.os.PowerManager#isInteractive non-interactive}. * * <p> * If enabled by the current {@link InputMethodService input method}, the current input * connection will be {@link InputMethodService#onFinishInput finished} whenever the devices * becomes non-interactive. * * <p> * If not enabled, the current input connection will instead be silently deactivated when the * devices becomes non-interactive, and an {@link InputMethodService#onFinishInput * onFinishInput()} {@link InputMethodService#onStartInput onStartInput()} pair is dispatched * when the device becomes interactive again. * * @hide */ @TestApi @ChangeId @EnabledSince(targetSdkVersion = Build.VERSION_CODES.S) public static final long FINISH_INPUT_NO_FALLBACK_CONNECTION = 156215187L; // This is a bug id. LayoutInflater mInflater; TypedArray mThemeAttrs; @UnsupportedAppUsage Loading Loading @@ -2352,7 +2377,7 @@ public class InputMethodService extends AbstractInputMethodService { } void doStartInput(InputConnection ic, EditorInfo attribute, boolean restarting) { if (!restarting) { if (!restarting && mInputStarted) { doFinishInput(); } ImeTracing.getInstance().triggerServiceDump("InputMethodService#doStartInput", this, Loading core/java/android/inputmethodservice/MultiClientInputMethodClientCallbackAdaptor.java +8 −1 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.os.Bundle; import android.os.Debug; import android.os.Handler; import android.os.Looper; import android.os.RemoteException; import android.os.ResultReceiver; import android.util.Log; import android.view.InputChannel; Loading @@ -38,8 +39,8 @@ import android.view.inputmethod.EditorInfo; import android.view.inputmethod.ExtractedText; import com.android.internal.annotations.GuardedBy; import com.android.internal.inputmethod.IMultiClientInputMethodSession; import com.android.internal.inputmethod.CancellationGroup; import com.android.internal.inputmethod.IMultiClientInputMethodSession; import com.android.internal.os.SomeArgs; import com.android.internal.util.function.pooled.PooledLambda; import com.android.internal.view.IInputContext; Loading Loading @@ -303,6 +304,12 @@ final class MultiClientInputMethodClientCallbackAdaptor { // no-op for multi-session reportNotSupported(); } @Override public void finishInput() throws RemoteException { // no-op for multi-session reportNotSupported(); } } private static final class MultiClientInputMethodSessionImpl Loading core/java/android/view/ImeFocusController.java +20 −0 Original line number Diff line number Diff line Loading @@ -221,6 +221,25 @@ public final class ImeFocusController { mHasImeFocus = false; } /** * To handle the lifecycle of the input connection when the device interactivity state changed. * (i.e. Calling IMS#onFinishInput when the device screen-off and Calling IMS#onStartInput * when the device screen-on again). */ @UiThread public void onInteractiveChanged(boolean interactive) { final InputMethodManagerDelegate immDelegate = getImmDelegate(); if (!immDelegate.isCurrentRootView(mViewRootImpl)) { return; } if (interactive) { final View focusedView = mViewRootImpl.mView.findFocus(); onViewFocusChanged(focusedView, focusedView != null); } else { mDelegate.finishInputAndReportToIme(); } } /** * @param windowAttribute {@link WindowManager.LayoutParams} to be checked. * @return Whether the window is in local focus mode or not. Loading Loading @@ -256,6 +275,7 @@ public final class ImeFocusController { @WindowManager.LayoutParams.SoftInputModeFlags int softInputMode, int windowFlags, boolean forceNewFocus); void finishInput(); void finishInputAndReportToIme(); void closeCurrentIme(); void finishComposingText(); void setCurrentRootView(ViewRootImpl rootView); Loading Loading
core/api/test-current.txt +8 −0 Original line number Diff line number Diff line Loading @@ -839,6 +839,14 @@ package android.hardware.soundtrigger { } package android.inputmethodservice { public class InputMethodService extends android.inputmethodservice.AbstractInputMethodService { field public static final long FINISH_INPUT_NO_FALLBACK_CONNECTION = 156215187L; // 0x94fa793L } } package android.location { public final class GnssClock implements android.os.Parcelable { Loading
core/java/android/inputmethodservice/IInputMethodSessionWrapper.java +10 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,8 @@ class IInputMethodSessionWrapper extends IInputMethodSession.Stub private static final int DO_VIEW_CLICKED = 115; private static final int DO_NOTIFY_IME_HIDDEN = 120; private static final int DO_REMOVE_IME_SURFACE = 130; private static final int DO_FINISH_INPUT = 140; @UnsupportedAppUsage HandlerCaller mCaller; Loading Loading @@ -141,6 +143,10 @@ class IInputMethodSessionWrapper extends IInputMethodSession.Stub mInputMethodSession.removeImeSurface(); return; } case DO_FINISH_INPUT: { mInputMethodSession.finishInput(); return; } } Log.w(TAG, "Unhandled message code: " + msg.what); } Loading Loading @@ -222,6 +228,10 @@ class IInputMethodSessionWrapper extends IInputMethodSession.Stub mCaller.executeOrSendMessage(mCaller.obtainMessage(DO_FINISH_SESSION)); } @Override public void finishInput() { mCaller.executeOrSendMessage(mCaller.obtainMessage(DO_FINISH_INPUT)); } private final class ImeInputEventReceiver extends InputEventReceiver implements InputMethodSession.EventCallback { private final SparseArray<InputEvent> mPendingEvents = new SparseArray<InputEvent>(); Loading
core/java/android/inputmethodservice/InputMethodService.java +27 −2 Original line number Diff line number Diff line Loading @@ -62,9 +62,12 @@ import android.annotation.IntDef; import android.annotation.MainThread; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.TestApi; import android.annotation.UiContext; import android.app.ActivityManager; import android.app.Dialog; import android.compat.annotation.ChangeId; import android.compat.annotation.EnabledSince; import android.compat.annotation.UnsupportedAppUsage; import android.content.Context; import android.content.pm.PackageManager; Loading Loading @@ -413,6 +416,28 @@ public class InputMethodService extends AbstractInputMethodService { @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) int mTheme = 0; /** * Finish the {@link InputConnection} when the device becomes * {@link android.os.PowerManager#isInteractive non-interactive}. * * <p> * If enabled by the current {@link InputMethodService input method}, the current input * connection will be {@link InputMethodService#onFinishInput finished} whenever the devices * becomes non-interactive. * * <p> * If not enabled, the current input connection will instead be silently deactivated when the * devices becomes non-interactive, and an {@link InputMethodService#onFinishInput * onFinishInput()} {@link InputMethodService#onStartInput onStartInput()} pair is dispatched * when the device becomes interactive again. * * @hide */ @TestApi @ChangeId @EnabledSince(targetSdkVersion = Build.VERSION_CODES.S) public static final long FINISH_INPUT_NO_FALLBACK_CONNECTION = 156215187L; // This is a bug id. LayoutInflater mInflater; TypedArray mThemeAttrs; @UnsupportedAppUsage Loading Loading @@ -2352,7 +2377,7 @@ public class InputMethodService extends AbstractInputMethodService { } void doStartInput(InputConnection ic, EditorInfo attribute, boolean restarting) { if (!restarting) { if (!restarting && mInputStarted) { doFinishInput(); } ImeTracing.getInstance().triggerServiceDump("InputMethodService#doStartInput", this, Loading
core/java/android/inputmethodservice/MultiClientInputMethodClientCallbackAdaptor.java +8 −1 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.os.Bundle; import android.os.Debug; import android.os.Handler; import android.os.Looper; import android.os.RemoteException; import android.os.ResultReceiver; import android.util.Log; import android.view.InputChannel; Loading @@ -38,8 +39,8 @@ import android.view.inputmethod.EditorInfo; import android.view.inputmethod.ExtractedText; import com.android.internal.annotations.GuardedBy; import com.android.internal.inputmethod.IMultiClientInputMethodSession; import com.android.internal.inputmethod.CancellationGroup; import com.android.internal.inputmethod.IMultiClientInputMethodSession; import com.android.internal.os.SomeArgs; import com.android.internal.util.function.pooled.PooledLambda; import com.android.internal.view.IInputContext; Loading Loading @@ -303,6 +304,12 @@ final class MultiClientInputMethodClientCallbackAdaptor { // no-op for multi-session reportNotSupported(); } @Override public void finishInput() throws RemoteException { // no-op for multi-session reportNotSupported(); } } private static final class MultiClientInputMethodSessionImpl Loading
core/java/android/view/ImeFocusController.java +20 −0 Original line number Diff line number Diff line Loading @@ -221,6 +221,25 @@ public final class ImeFocusController { mHasImeFocus = false; } /** * To handle the lifecycle of the input connection when the device interactivity state changed. * (i.e. Calling IMS#onFinishInput when the device screen-off and Calling IMS#onStartInput * when the device screen-on again). */ @UiThread public void onInteractiveChanged(boolean interactive) { final InputMethodManagerDelegate immDelegate = getImmDelegate(); if (!immDelegate.isCurrentRootView(mViewRootImpl)) { return; } if (interactive) { final View focusedView = mViewRootImpl.mView.findFocus(); onViewFocusChanged(focusedView, focusedView != null); } else { mDelegate.finishInputAndReportToIme(); } } /** * @param windowAttribute {@link WindowManager.LayoutParams} to be checked. * @return Whether the window is in local focus mode or not. Loading Loading @@ -256,6 +275,7 @@ public final class ImeFocusController { @WindowManager.LayoutParams.SoftInputModeFlags int softInputMode, int windowFlags, boolean forceNewFocus); void finishInput(); void finishInputAndReportToIme(); void closeCurrentIme(); void finishComposingText(); void setCurrentRootView(ViewRootImpl rootView); Loading