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

Commit abb67140 authored by Antonio Kantek's avatar Antonio Kantek Committed by Android (Google) Code Review
Browse files

Merge "TouchMode (6.1/n) Fully detaching touch mode from focus event"

parents 5aa7fd5d d30cab4e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -96,9 +96,9 @@ oneway interface IWindow {

    /**
     * Tell the window that it is either gaining or losing focus.  Keep it up
     * to date on the current state showing navigational focus (touch mode) too.
     * to date on the current state showing navigational focus too.
     */
    void windowFocusChanged(boolean hasFocus, boolean inTouchMode);
    void windowFocusChanged(boolean hasFocus);

    void closeSystemDialogs(String reason);

+2 −4
Original line number Diff line number Diff line
@@ -139,11 +139,9 @@ public abstract class InputEventReceiver {
     * @param hasFocus if true, the window associated with this input channel has just received
     *                 focus
     *                 if false, the window associated with this input channel has just lost focus
     * @param inTouchMode if true, the device is in touch mode
     *                    if false, the device is not in touch mode
     */
    // Called from native code.
    public void onFocusEvent(boolean hasFocus, boolean inTouchMode) {
    public void onFocusEvent(boolean hasFocus) {
    }

    /**
@@ -175,7 +173,7 @@ public abstract class InputEventReceiver {
     * exited touch mode.
     *
     * @param inTouchMode {@code true} if the display showing the window associated with the
     *                                  input channel entered touch mode.
     *                    input channel entered touch mode or {@code false} if left touch mode
     */
    public void onTouchModeChanged(boolean inTouchMode) {
    }
+5 −7
Original line number Diff line number Diff line
@@ -8705,8 +8705,8 @@ public final class ViewRootImpl implements ViewParent,
        }

        @Override
        public void onFocusEvent(boolean hasFocus, boolean inTouchMode) {
            windowFocusChanged(hasFocus, inTouchMode);
        public void onFocusEvent(boolean hasFocus) {
            windowFocusChanged(hasFocus);
        }

        @Override
@@ -8975,9 +8975,7 @@ public final class ViewRootImpl implements ViewParent,
    /**
     * Notifies this {@link ViewRootImpl} object that window focus has changed.
     */
    public void windowFocusChanged(boolean hasFocus, boolean unusedInTouchMode) {
        // TODO(b/193718270): Remove inTouchMode parameter from this method and update related code
        //     accordingly.
    public void windowFocusChanged(boolean hasFocus) {
        synchronized (this) {
            mWindowFocusChanged = true;
            mUpcomingWindowFocus = hasFocus;
@@ -9732,10 +9730,10 @@ public final class ViewRootImpl implements ViewParent,
        }

        @Override
        public void windowFocusChanged(boolean hasFocus, boolean inTouchMode) {
        public void windowFocusChanged(boolean hasFocus) {
            final ViewRootImpl viewAncestor = mViewAncestor.get();
            if (viewAncestor != null) {
                viewAncestor.windowFocusChanged(hasFocus, inTouchMode);
                viewAncestor.windowFocusChanged(hasFocus);
            }
        }

+1 −1
Original line number Diff line number Diff line
@@ -1842,7 +1842,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
    @Override
    public void setLocalFocus(boolean hasFocus, boolean inTouchMode) {
        ViewRootImpl viewRoot = getViewRootImpl();
        viewRoot.windowFocusChanged(hasFocus, inTouchMode);
        viewRoot.windowFocusChanged(hasFocus);
        viewRoot.touchModeChanged(inTouchMode);
    }

+1 −1
Original line number Diff line number Diff line
@@ -90,7 +90,7 @@ public class BaseIWindow extends IWindow.Stub {
    }

    @Override
    public void windowFocusChanged(boolean hasFocus, boolean touchEnabled) {
    public void windowFocusChanged(boolean hasFocus) {
    }

    @Override
Loading