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

Commit b0b75ec8 authored by Matthew Ng's avatar Matthew Ng Committed by android-build-merger
Browse files

Merge "Tapping overview button when quickstep enabled shows overview" into pi-dev am: 8b4b8698

am: 06ce1e6c

Change-Id: Ie7fc3baef34ea0d3bbf2c7e852bff6aa06630409
parents 467d4cd6 06ce1e6c
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -65,4 +65,19 @@ oneway interface IOverviewProxy {
     * Sent for each movement over the nav bar while the user is scrubbing it to switch tasks.
     */
    void onQuickScrubProgress(float progress);

    /**
     * Sent when overview button is pressed to toggle show/hide of overview.
     */
    void onOverviewToggle();

    /**
     * Sent when overview is to be shown.
     */
    void onOverviewShown(boolean triggeredFromAltTab);

    /**
     * Sent when overview is to be hidden.
     */
    void onOverviewHidden(boolean triggeredFromAltTab, boolean triggeredFromHomeKey);
}
+2 −1
Original line number Diff line number Diff line
@@ -22,12 +22,13 @@ import java.lang.annotation.RetentionPolicy;

public class NavigationBarCompat {
    @Retention(RetentionPolicy.SOURCE)
    @IntDef({HIT_TARGET_NONE, HIT_TARGET_BACK, HIT_TARGET_HOME})
    @IntDef({HIT_TARGET_NONE, HIT_TARGET_BACK, HIT_TARGET_HOME, HIT_TARGET_OVERVIEW})
    public @interface HitTarget{}

    public static final int HIT_TARGET_NONE = 0;
    public static final int HIT_TARGET_BACK = 1;
    public static final int HIT_TARGET_HOME = 2;
    public static final int HIT_TARGET_OVERVIEW = 3;

    @Retention(RetentionPolicy.SOURCE)
    @IntDef({FLAG_DISABLE_SWIPE_UP,
+22 −9
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ import com.android.systemui.EventLogTags;
import com.android.systemui.OverviewProxyService;
import com.android.systemui.R;
import com.android.systemui.RecentsComponent;
import com.android.systemui.shared.recents.IOverviewProxy;
import com.android.systemui.SystemUI;
import com.android.systemui.recents.events.EventBus;
import com.android.systemui.recents.events.activity.ConfigurationChangedEvent;
@@ -252,10 +253,13 @@ public class Recents extends SystemUI
            return;
        }

        if (mOverviewProxyService.getProxy() != null) {
            // TODO: Proxy to Launcher
            if (!triggeredFromAltTab) {
        IOverviewProxy overviewProxy = mOverviewProxyService.getProxy();
        if (overviewProxy != null) {
            try {
                overviewProxy.onOverviewShown(triggeredFromAltTab);
                return;
            } catch (RemoteException e) {
                Log.e(TAG, "Failed to send overview show event to launcher.", e);
            }
        }

@@ -294,10 +298,13 @@ public class Recents extends SystemUI
            return;
        }

        if (mOverviewProxyService.getProxy() != null) {
            // TODO: Proxy to Launcher
            if (!triggeredFromAltTab) {
        IOverviewProxy overviewProxy = mOverviewProxyService.getProxy();
        if (overviewProxy != null) {
            try {
                overviewProxy.onOverviewHidden(triggeredFromAltTab, triggeredFromHomeKey);
                return;
            } catch (RemoteException e) {
                Log.e(TAG, "Failed to send overview hide event to launcher.", e);
            }
        }

@@ -332,9 +339,15 @@ public class Recents extends SystemUI
            return;
        }

        if (mOverviewProxyService.getProxy() != null) {
            // TODO: Proxy to Launcher
        // If connected to launcher service, let it handle the toggle logic
        IOverviewProxy overviewProxy = mOverviewProxyService.getProxy();
        if (overviewProxy != null) {
            try {
                overviewProxy.onOverviewToggle();
                return;
            } catch (RemoteException e) {
                Log.e(TAG, "Cannot send toggle recents through proxy service.", e);
            }
        }

        int growTarget = getComponent(Divider.class).getView().growsRecents();
+5 −0
Original line number Diff line number Diff line
@@ -79,6 +79,7 @@ import static com.android.systemui.shared.system.NavigationBarCompat.FLAG_DISABL
import static com.android.systemui.shared.system.NavigationBarCompat.FLAG_DISABLE_SWIPE_UP;
import static com.android.systemui.shared.system.NavigationBarCompat.FLAG_HIDE_BACK_BUTTON;
import static com.android.systemui.shared.system.NavigationBarCompat.FLAG_SHOW_OVERVIEW_BUTTON;
import static com.android.systemui.shared.system.NavigationBarCompat.HIT_TARGET_OVERVIEW;

public class NavigationBarView extends FrameLayout implements PluginListener<NavGesture> {
    final static boolean DEBUG = false;
@@ -106,6 +107,7 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav
    private @NavigationBarCompat.HitTarget int mDownHitTarget = HIT_TARGET_NONE;
    private Rect mHomeButtonBounds = new Rect();
    private Rect mBackButtonBounds = new Rect();
    private Rect mRecentsButtonBounds = new Rect();
    private int[] mTmpPosition = new int[2];

    private KeyButtonDrawable mBackIcon, mBackLandIcon, mBackAltIcon, mBackAltLandIcon;
@@ -306,6 +308,8 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav
                    mDownHitTarget = HIT_TARGET_BACK;
                } else if (mHomeButtonBounds.contains(x, y)) {
                    mDownHitTarget = HIT_TARGET_HOME;
                } else if (mRecentsButtonBounds.contains(x, y)) {
                    mDownHitTarget = HIT_TARGET_OVERVIEW;
                }
                break;
        }
@@ -823,6 +827,7 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav
        super.onLayout(changed, left, top, right, bottom);
        updateButtonLocationOnScreen(getBackButton(), mBackButtonBounds);
        updateButtonLocationOnScreen(getHomeButton(), mHomeButtonBounds);
        updateButtonLocationOnScreen(getRecentsButton(), mRecentsButtonBounds);
        mGestureHelper.onLayout(changed, left, top, right, bottom);
    }