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

Commit 0ac1c180 authored by Tracy Zhou's avatar Tracy Zhou Committed by Automerger Merge Worker
Browse files

Merge "Animate expansion of notification panel before ACTION_UP" into udc-qpr-dev am: 2ecc896e

parents f1add6e7 2ecc896e
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ interface ISystemUiProxy {
     *
     * Normal gesture: DOWN, MOVE/POINTER_DOWN/POINTER_UP)*, UP or CANCLE
     */
    oneway void onStatusBarMotionEvent(in MotionEvent event) = 9;
    oneway void onStatusBarTouchEvent(in MotionEvent event) = 9;

    /**
     * Proxies the assistant gesture's progress started from navigation bar.
@@ -125,5 +125,15 @@ interface ISystemUiProxy {
     */
    oneway void takeScreenshot(in ScreenshotRequest request) = 51;

    // Next id = 52
    /**
     * Dispatches trackpad status bar motion event to the notification shade. Currently these events
     * are from the input monitor in {@link TouchInteractionService}. This is different from
     * {@link #onStatusBarTouchEvent} above in that, this directly dispatches motion events to the
     * notification shade, while {@link #onStatusBarTouchEvent} relies on setting the launcher
     * window slippery to allow the frameworks to route those events after passing the initial
     * threshold.
     */
    oneway void onStatusBarTrackpadEvent(in MotionEvent event) = 52;

    // Next id = 53
}
+10 −3
Original line number Diff line number Diff line
@@ -200,8 +200,8 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis

        // TODO: change the method signature to use (boolean inputFocusTransferStarted)
        @Override
        public void onStatusBarMotionEvent(MotionEvent event) {
            verifyCallerAndClearCallingIdentity("onStatusBarMotionEvent", () -> {
        public void onStatusBarTouchEvent(MotionEvent event) {
            verifyCallerAndClearCallingIdentity("onStatusBarTouchEvent", () -> {
                // TODO move this logic to message queue
                mCentralSurfacesOptionalLazy.get().ifPresent(centralSurfaces -> {
                    if (event.getActionMasked() == ACTION_DOWN) {
@@ -235,6 +235,13 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
            });
        }

        @Override
        public void onStatusBarTrackpadEvent(MotionEvent event) {
            verifyCallerAndClearCallingIdentityPostMain("onStatusBarTrackpadEvent", () ->
                    mCentralSurfacesOptionalLazy.get().ifPresent(centralSurfaces ->
                            centralSurfaces.onStatusBarTrackpadEvent(event)));
        }

        @Override
        public void onBackPressed() {
            verifyCallerAndClearCallingIdentityPostMain("onBackPressed", () -> {
@@ -345,7 +352,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis

        @Override
        public void expandNotificationPanel() {
            verifyCallerAndClearCallingIdentity("expandNotificationPanel",
            verifyCallerAndClearCallingIdentityPostMain("expandNotificationPanel",
                    () -> mCommandQueue.handleSystemKey(new KeyEvent(KeyEvent.ACTION_DOWN,
                            KeyEvent.KEYCODE_SYSTEM_NAVIGATION_DOWN)));
        }
+14 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import android.os.PowerManager;
import android.os.UserHandle;
import android.service.notification.StatusBarNotification;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.RemoteAnimationAdapter;
import android.view.View;
import android.view.ViewGroup;
@@ -266,8 +267,21 @@ public interface CentralSurfaces extends Dumpable, LifecycleOwner {

    boolean isPanelExpanded();

    /**
     * Used to dispatch initial touch events before crossing the threshold to pull down the
     * notification shade. After that, since the launcher window is set to slippery, input
     * frameworks take care of routing the events to the notification shade.
     */
    void onInputFocusTransfer(boolean start, boolean cancel, float velocity);

    /**
     * Dispatches status bar motion event to the notification shade. This is different from
     * {@link #onInputFocusTransfer(boolean, boolean, float)} as it doesn't rely on setting the
     * launcher window slippery to allow the frameworks to route those events after passing the
     * initial threshold.
     */
    default void onStatusBarTrackpadEvent(MotionEvent event) {}

    void animateCollapseQuickSettings();

    /** */
+7 −0
Original line number Diff line number Diff line
@@ -91,6 +91,7 @@ import android.view.Display;
import android.view.IRemoteAnimationRunner;
import android.view.IWindowManager;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.ThreadedRenderer;
import android.view.View;
import android.view.ViewGroup;
@@ -428,6 +429,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
    public void togglePanel() {
        mCommandQueueCallbacks.togglePanel();
    }

    /**
     * The {@link StatusBarState} of the status bar.
     */
@@ -1991,6 +1993,11 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
        }
    }

    @Override
    public void onStatusBarTrackpadEvent(MotionEvent event) {
        mCentralSurfacesComponent.getNotificationPanelViewController().handleExternalTouch(event);
    }

    @Override
    public void animateCollapseQuickSettings() {
        if (mState == StatusBarState.SHADE) {