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

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

Merge "Do not forward & register IME compat back callback in the app process."...

Merge "Do not forward & register IME compat back callback in the app process." into udc-dev am: 46890aaa

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



Change-Id: I9faa51cdf04c63e1c1a03384775009b5c6ed8d90
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents d15242c9 46890aaa
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -11382,6 +11382,10 @@ public final class ViewRootImpl implements ViewParent,
            sendBackKeyEvent(KeyEvent.ACTION_DOWN);
            sendBackKeyEvent(KeyEvent.ACTION_UP);
        };
        if (mOnBackInvokedDispatcher.hasImeOnBackInvokedDispatcher()) {
            Log.d(TAG, "Skip registering CompatOnBackInvokedCallback on IME dispatcher");
            return;
        }
        mOnBackInvokedDispatcher.registerOnBackInvokedCallback(
                OnBackInvokedDispatcher.PRIORITY_DEFAULT, mCompatOnBackInvokedCallback);
    }
+5 −0
Original line number Diff line number Diff line
@@ -357,6 +357,11 @@ public class WindowOnBackInvokedDispatcher implements OnBackInvokedDispatcher {
        mImeDispatcher = imeDispatcher;
    }

    /** Returns true if a non-null {@link ImeOnBackInvokedDispatcher} has been set. **/
    public boolean hasImeOnBackInvokedDispatcher() {
        return mImeDispatcher != null;
    }

    /**
     * Class used to check whether a callback can be registered or not. This is meant to be
     * shared with {@link ProxyOnBackInvokedDispatcher} which needs to do the same checks.