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

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

Merge changes from topic "centralize-quick-3s" into pi-dev

* changes:
  Fixes crash on navbar using 3rd party launchers
  Revert "Revert "Centralized quick step/scrub/switch logic (1/2)""
parents 265b11ff 22cf5146
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ package com.android.systemui.plugins.statusbar.phone;

import android.graphics.Canvas;
import android.view.MotionEvent;
import android.view.View;

import com.android.systemui.plugins.Plugin;
import com.android.systemui.plugins.annotations.ProvidesInterface;
@@ -42,6 +43,8 @@ public interface NavGesture extends Plugin {

        public void onLayout(boolean changed, int left, int top, int right, int bottom);

        public void onNavigationButtonLongPress(View v);

        public default void destroy() { }
    }

+13 −0
Original line number Diff line number Diff line
@@ -80,4 +80,17 @@ oneway interface IOverviewProxy {
     * Sent when overview is to be hidden.
     */
    void onOverviewHidden(boolean triggeredFromAltTab, boolean triggeredFromHomeKey);

    /**
     * Sent when a user swipes up over the navigation bar to launch overview. Swipe up is determined
     * by passing the touch slop in the direction towards launcher from navigation bar. During and
     * after this event is sent the caller will continue to send motion events. The motion
     * {@param event} passed after the touch slop was exceeded will also be passed after by
     * {@link onMotionEvent}. Since motion events will be sent, motion up or cancel can still be
     * sent to cancel overview regardless the current state of launcher (eg. if overview is already
     * visible, this event will still be sent if user swipes up). When this signal is sent,
     * navigation bar will not handle any gestures such as quick scrub or switch and the home button
     * will cancel (long) press.
     */
    void onQuickStep(in MotionEvent event);
}
+0 −5
Original line number Diff line number Diff line
@@ -35,11 +35,6 @@ interface ISystemUiProxy {
     */
    void startScreenPinning(int taskId) = 1;

    /**
     * Called when the overview service has started the recents animation.
     */
    void onRecentsAnimationStarted() = 2;

    /**
     * Specifies the text to be shown for onboarding the new swipe-up gesture to access recents.
     */
+3 −12
Original line number Diff line number Diff line
@@ -102,15 +102,6 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
            }
        }

        public void onRecentsAnimationStarted() {
            long token = Binder.clearCallingIdentity();
            try {
                mHandler.post(OverviewProxyService.this::notifyRecentsAnimationStarted);
            } finally {
                Binder.restoreCallingIdentity(token);
            }
        }

        public void onSplitScreenInvoked() {
            long token = Binder.clearCallingIdentity();
            try {
@@ -283,9 +274,9 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
        }
    }

    private void notifyRecentsAnimationStarted() {
    public void notifyQuickStepStarted() {
        for (int i = mConnectionCallbacks.size() - 1; i >= 0; --i) {
            mConnectionCallbacks.get(i).onRecentsAnimationStarted();
            mConnectionCallbacks.get(i).onQuickStepStarted();
        }
    }

@@ -300,7 +291,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis

    public interface OverviewProxyListener {
        default void onConnectionChanged(boolean isConnected) {}
        default void onRecentsAnimationStarted() {}
        default void onQuickStepStarted() {}
        default void onInteractionFlagsChanged(@InteractionType int flags) {}
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -189,7 +189,7 @@ public class RecentsOnboarding {
        }
    }

    public void onRecentsAnimationStarted() {
    public void onQuickStepStarted() {
        boolean alreadySeenRecentsOnboarding = Prefs.getBoolean(mContext,
                Prefs.Key.HAS_SEEN_RECENTS_ONBOARDING, false);
        if (!alreadySeenRecentsOnboarding) {
Loading