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

Commit 4aee64f7 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Swipe down on Pixel Launcher expands Notification Shade Bug: 111839343...

Merge "Swipe down on Pixel Launcher expands Notification Shade Bug: 111839343 Test: make -j31 && vendor/google/tools/flashall"
parents 84f7d7b3 c1647ead
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.systemui.shared.recents;

import android.graphics.Rect;
import android.view.MotionEvent;

/**
 * Temporary callbacks into SystemUI.
@@ -60,4 +61,14 @@ interface ISystemUiProxy {
     * needed from current value
     */
    void setBackButtonAlpha(float alpha, boolean animate) = 8;

    /**
     * Proxies motion events from the homescreen UI to the status bar. Only called when
     * swipe down is detected on WORKSPACE. The sender guarantees the following order of events on
     * the tracking pointer.
     *
     * Normal gesture: DOWN, MOVE/POINTER_DOWN/POINTER_UP)*, UP or CANCLE
     */
    void onStatusBarMotionEvent(in MotionEvent event) = 9;

}
+16 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import android.os.RemoteException;
import android.os.UserHandle;
import android.provider.Settings;
import android.util.Log;
import android.view.MotionEvent;

import com.android.systemui.OverviewProxyService.OverviewProxyListener;
import com.android.systemui.recents.events.EventBus;
@@ -111,6 +112,21 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
            }
        }

        public void onStatusBarMotionEvent(MotionEvent event) {
            long token = Binder.clearCallingIdentity();
            try {
                // TODO move this logic to message queue
                mHandler.post(()->{
                    StatusBar bar = SysUiServiceProvider.getComponent(mContext, StatusBar.class);
                    if (bar != null) {
                        bar.dispatchNotificationsPanelTouchEvent(event);
                    }
                });
            } finally {
                Binder.restoreCallingIdentity(token);
            }
        }

        public void onSplitScreenInvoked() {
            if (!verifyCaller("onSplitScreenInvoked")) {
                return;
+16 −0
Original line number Diff line number Diff line
@@ -2148,6 +2148,22 @@ public class StatusBar extends SystemUI implements DemoMode,
        mStatusBarKeyguardViewManager.readyForKeyguardDone();
    }

    public void dispatchNotificationsPanelTouchEvent(MotionEvent ev) {
        if (!panelsEnabled()) {
            return;
        }
        mNotificationPanel.dispatchTouchEvent(ev);

        int action = ev.getAction();
        if (action == MotionEvent.ACTION_DOWN) {
            // Start ignoring all touch events coming to status bar window.
            // TODO: handle case where ACTION_UP is not sent over the binder
            mStatusBarWindowController.setNotTouchable(true);
        } else if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) {
            mStatusBarWindowController.setNotTouchable(false);
        }
    }

    @Override
    public void animateExpandNotificationsPanel() {
        if (SPEW) Log.d(TAG, "animateExpand: mExpandedVisible=" + mExpandedVisible);
+15 −0
Original line number Diff line number Diff line
@@ -279,6 +279,7 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat
        applyBrightness(state);
        applyHasTopUi(state);
        applySleepToken(state);
        applyNotTouchable(state);
        if (mLp.copyFrom(mLpChanged) != 0) {
            mWindowManager.updateViewLayout(mStatusBarView, mLp);
        }
@@ -330,6 +331,14 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat
        }
    }

    private void applyNotTouchable(State state) {
        if (state.notTouchable) {
            mLpChanged.flags |= LayoutParams.FLAG_NOT_TOUCHABLE;
        } else {
            mLpChanged.flags &= ~LayoutParams.FLAG_NOT_TOUCHABLE;
        }
    }

    public void setKeyguardShowing(boolean showing) {
        mCurrentState.keyguardShowing = showing;
        apply(mCurrentState);
@@ -454,6 +463,11 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat
        apply(mCurrentState);
    }

    public void setNotTouchable(boolean notTouchable) {
        mCurrentState.notTouchable = notTouchable;
        apply(mCurrentState);
    }

    public void setStateListener(OtherwisedCollapsedListener listener) {
        mListener = listener;
    }
@@ -501,6 +515,7 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat
        boolean forceUserActivity;
        boolean backdropShowing;
        boolean wallpaperSupportsAmbientMode;
        boolean notTouchable;

        /**
         * The {@link StatusBar} state from the status bar.