Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad8e4733 authored by Shan Huang's avatar Shan Huang Committed by Automerger Merge Worker
Browse files

Merge "Fix IME callback not being re-registered on screen off / on." into...

Merge "Fix IME callback not being re-registered on screen off / on." into tm-dev am: bd7ac0c6 am: 19220d85

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18310689



Change-Id: I81f376c57805da0a4412bba8c852b607dc5cf04d
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 56d3315b 19220d85
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1625,7 +1625,6 @@ public class InputMethodService extends AbstractInputMethodService {
            // when IME developers are doing something unsupported.
            InputMethodPrivilegedOperationsRegistry.remove(mToken);
        }
        unregisterCompatOnBackInvokedCallback();
        mImeDispatcher = null;
    }

@@ -2788,6 +2787,11 @@ public class InputMethodService extends AbstractInputMethodService {
        if (mInkWindow != null) {
            finishStylusHandwriting();
        }
        // Back callback is typically unregistered in {@link #hideWindow()}, but it's possible
        // for {@link #doFinishInput()} to be called without {@link #hideWindow()} so we also
        // unregister here.
        // TODO(b/232341407): Add CTS to verify back behavior after screen on / off.
        unregisterCompatOnBackInvokedCallback();
    }

    void doStartInput(InputConnection ic, EditorInfo attribute, boolean restarting) {
+6 −0
Original line number Diff line number Diff line
@@ -158,6 +158,12 @@ public class ImeOnBackInvokedDispatcher implements OnBackInvokedDispatcher, Parc

    /** Clears all registered callbacks on the instance. */
    public void clear() {
        // Unregister previously registered callbacks if there's any.
        if (getReceivingDispatcher() != null) {
            for (OnBackInvokedCallback callback : mImeCallbackMap.values()) {
                getReceivingDispatcher().unregisterOnBackInvokedCallback(callback);
            }
        }
        mImeCallbackMap.clear();
    }