Loading core/java/android/view/inputmethod/InputConnection.java +8 −3 Original line number Diff line number Diff line Loading @@ -843,9 +843,14 @@ public interface InputConnection { /** * Called back when the connected IME switches between fullscreen and normal modes. * * <p>Note: On {@link android.os.Build.VERSION_CODES#O} and later devices, input methods are no * longer allowed to directly call this method at any time. To signal this event in the target * application, input methods should always call * <p><p><strong>Editor authors:</strong> There is a bug on * {@link android.os.Build.VERSION_CODES#O} and later devices that this method is called back * on the main thread even when {@link #getHandler()} is overridden. This bug is fixed in * {@link android.os.Build.VERSION_CODES#TIRAMISU}.</p> * * <p><p><strong>IME authors:</strong> On {@link android.os.Build.VERSION_CODES#O} and later * devices, input methods are no longer allowed to directly call this method at any time. * To signal this event in the target application, input methods should always call * {@link InputMethodService#updateFullscreenMode()} instead. This approach should work on API * {@link android.os.Build.VERSION_CODES#N_MR1} and prior devices.</p> * Loading core/java/android/view/inputmethod/InputMethodManager.java +3 −3 Original line number Diff line number Diff line Loading @@ -950,15 +950,15 @@ public final class InputMethodManager { } case MSG_REPORT_FULLSCREEN_MODE: { final boolean fullscreen = msg.arg1 != 0; InputConnection ic = null; RemoteInputConnectionImpl ic = null; synchronized (mH) { if (mFullscreenMode != fullscreen && mServedInputConnection != null) { ic = mServedInputConnection.getInputConnection(); ic = mServedInputConnection; mFullscreenMode = fullscreen; } } if (ic != null) { ic.reportFullscreenMode(fullscreen); ic.dispatchReportFullscreenMode(fullscreen); } return; } Loading core/java/com/android/internal/inputmethod/RemoteInputConnectionImpl.java +17 −0 Original line number Diff line number Diff line Loading @@ -169,6 +169,23 @@ public final class RemoteInputConnectionImpl extends IInputContext.Stub { } } /** * Invoke {@link InputConnection#reportFullscreenMode(boolean)} or schedule it on the target * thread associated with {@link InputConnection#getHandler()}. * * @param enabled the parameter to be passed to * {@link InputConnection#reportFullscreenMode(boolean)}. */ public void dispatchReportFullscreenMode(boolean enabled) { dispatch(() -> { final InputConnection ic = getInputConnection(); if (ic == null || !isActive()) { return; } ic.reportFullscreenMode(enabled); }); } @Override public void getTextAfterCursor(int length, int flags, ICharSequenceResultCallback callback) { dispatch(() -> { Loading Loading
core/java/android/view/inputmethod/InputConnection.java +8 −3 Original line number Diff line number Diff line Loading @@ -843,9 +843,14 @@ public interface InputConnection { /** * Called back when the connected IME switches between fullscreen and normal modes. * * <p>Note: On {@link android.os.Build.VERSION_CODES#O} and later devices, input methods are no * longer allowed to directly call this method at any time. To signal this event in the target * application, input methods should always call * <p><p><strong>Editor authors:</strong> There is a bug on * {@link android.os.Build.VERSION_CODES#O} and later devices that this method is called back * on the main thread even when {@link #getHandler()} is overridden. This bug is fixed in * {@link android.os.Build.VERSION_CODES#TIRAMISU}.</p> * * <p><p><strong>IME authors:</strong> On {@link android.os.Build.VERSION_CODES#O} and later * devices, input methods are no longer allowed to directly call this method at any time. * To signal this event in the target application, input methods should always call * {@link InputMethodService#updateFullscreenMode()} instead. This approach should work on API * {@link android.os.Build.VERSION_CODES#N_MR1} and prior devices.</p> * Loading
core/java/android/view/inputmethod/InputMethodManager.java +3 −3 Original line number Diff line number Diff line Loading @@ -950,15 +950,15 @@ public final class InputMethodManager { } case MSG_REPORT_FULLSCREEN_MODE: { final boolean fullscreen = msg.arg1 != 0; InputConnection ic = null; RemoteInputConnectionImpl ic = null; synchronized (mH) { if (mFullscreenMode != fullscreen && mServedInputConnection != null) { ic = mServedInputConnection.getInputConnection(); ic = mServedInputConnection; mFullscreenMode = fullscreen; } } if (ic != null) { ic.reportFullscreenMode(fullscreen); ic.dispatchReportFullscreenMode(fullscreen); } return; } Loading
core/java/com/android/internal/inputmethod/RemoteInputConnectionImpl.java +17 −0 Original line number Diff line number Diff line Loading @@ -169,6 +169,23 @@ public final class RemoteInputConnectionImpl extends IInputContext.Stub { } } /** * Invoke {@link InputConnection#reportFullscreenMode(boolean)} or schedule it on the target * thread associated with {@link InputConnection#getHandler()}. * * @param enabled the parameter to be passed to * {@link InputConnection#reportFullscreenMode(boolean)}. */ public void dispatchReportFullscreenMode(boolean enabled) { dispatch(() -> { final InputConnection ic = getInputConnection(); if (ic == null || !isActive()) { return; } ic.reportFullscreenMode(enabled); }); } @Override public void getTextAfterCursor(int length, int flags, ICharSequenceResultCallback callback) { dispatch(() -> { Loading