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

Commit c1647ead authored by Hyunyoung Song's avatar Hyunyoung Song
Browse files

Swipe down on Pixel Launcher expands Notification Shade

Bug: 111839343
Test: make -j31 && vendor/google/tools/flashall

-Tested for single touch swipe
-Tested with heads up noti
-Tested for single touch T1, second touch T2
T1 DOWN, T2 DOWN, T2 UP, T1 UP
T1 DOWN, T2 DOWN, T1 UP, T2 UP

Change-Id: I4b392ced07f6a9bece4bfc0a8be46de9b5088f82
parent 2ff71746
Loading
Loading
Loading
Loading
+11 −0
Original line number Original line Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.systemui.shared.recents;
package com.android.systemui.shared.recents;


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


/**
/**
 * Temporary callbacks into SystemUI.
 * Temporary callbacks into SystemUI.
@@ -60,4 +61,14 @@ interface ISystemUiProxy {
     * needed from current value
     * needed from current value
     */
     */
    void setBackButtonAlpha(float alpha, boolean animate) = 8;
    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 Original line Diff line number Diff line
@@ -32,6 +32,7 @@ import android.os.RemoteException;
import android.os.UserHandle;
import android.os.UserHandle;
import android.provider.Settings;
import android.provider.Settings;
import android.util.Log;
import android.util.Log;
import android.view.MotionEvent;


import com.android.systemui.OverviewProxyService.OverviewProxyListener;
import com.android.systemui.OverviewProxyService.OverviewProxyListener;
import com.android.systemui.recents.events.EventBus;
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() {
        public void onSplitScreenInvoked() {
            if (!verifyCaller("onSplitScreenInvoked")) {
            if (!verifyCaller("onSplitScreenInvoked")) {
                return;
                return;
+16 −0
Original line number Original line Diff line number Diff line
@@ -2148,6 +2148,22 @@ public class StatusBar extends SystemUI implements DemoMode,
        mStatusBarKeyguardViewManager.readyForKeyguardDone();
        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
    @Override
    public void animateExpandNotificationsPanel() {
    public void animateExpandNotificationsPanel() {
        if (SPEW) Log.d(TAG, "animateExpand: mExpandedVisible=" + mExpandedVisible);
        if (SPEW) Log.d(TAG, "animateExpand: mExpandedVisible=" + mExpandedVisible);
+15 −0
Original line number Original line Diff line number Diff line
@@ -279,6 +279,7 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat
        applyBrightness(state);
        applyBrightness(state);
        applyHasTopUi(state);
        applyHasTopUi(state);
        applySleepToken(state);
        applySleepToken(state);
        applyNotTouchable(state);
        if (mLp.copyFrom(mLpChanged) != 0) {
        if (mLp.copyFrom(mLpChanged) != 0) {
            mWindowManager.updateViewLayout(mStatusBarView, mLp);
            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) {
    public void setKeyguardShowing(boolean showing) {
        mCurrentState.keyguardShowing = showing;
        mCurrentState.keyguardShowing = showing;
        apply(mCurrentState);
        apply(mCurrentState);
@@ -454,6 +463,11 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat
        apply(mCurrentState);
        apply(mCurrentState);
    }
    }


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

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


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