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

Commit cb3141a4 authored by Shawn Lin's avatar Shawn Lin Committed by Android (Google) Code Review
Browse files

Merge "Attach navigation bar to app during quick switching (2/N)" into sc-dev

parents 069895ae 2fe3ffa3
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -142,7 +142,13 @@ interface IRecentsAnimationController {
     *
     * The system reparents the leash of navigation bar to the app when the recents animation starts
     * and Launcher should call this method to let system restore the navigation bar to its
     * original position when the quick switch gesture is finished.
     * original position when the quick switch gesture is finished and will run the fade-in
     * animation If {@param moveHomeToTop} is {@code true}. Otherwise, restore the navigtation bar
     * without animation.
     *
     * @param moveHomeToTop if {@code true}, the home activity should be moved to the top.
     *                      Otherwise, the home activity is hidden and the user is returned to the
     *                      app.
     */
    void detachNavigationBarFromApp();
    void detachNavigationBarFromApp(boolean moveHomeToTop);
}
+8 −0
Original line number Diff line number Diff line
@@ -257,4 +257,12 @@ oneway interface IStatusBar
     * file descriptor passed in.
     */
     void passThroughShellCommand(in String[] args, in ParcelFileDescriptor pfd);

    /**
     * Enables/disables the navigation bar luma sampling.
     *
     * @param displayId the id of the display to notify.
     * @param enable {@code true} if enable, otherwise set to {@code false}.
     */
    void setNavigationBarLumaSamplingEnabled(int displayId, boolean enable);
}
+3 −3
Original line number Diff line number Diff line
@@ -16,11 +16,11 @@

package com.android.systemui.shared.system;

import android.window.TaskSnapshot;
import android.graphics.Rect;
import android.os.RemoteException;
import android.util.Log;
import android.view.IRecentsAnimationController;
import android.window.TaskSnapshot;

import com.android.systemui.shared.recents.model.ThumbnailData;

@@ -141,9 +141,9 @@ public class RecentsAnimationControllerCompat {
    /**
     * @see IRecentsAnimationController#detachNavigationBarFromApp
     */
    public void detachNavigationBarFromApp() {
    public void detachNavigationBarFromApp(boolean moveHomeToTop) {
        try {
            mAnimationController.detachNavigationBarFromApp();
            mAnimationController.detachNavigationBarFromApp(moveHomeToTop);
        } catch (RemoteException e) {
            Log.e(TAG, "Failed to detach the navigation bar from app", e);
        }
+8 −0
Original line number Diff line number Diff line
@@ -212,6 +212,14 @@ public class NavigationBarController implements Callbacks,
        createNavigationBar(display, null /* savedState */, null /* result */);
    }

    @Override
    public void setNavigationBarLumaSamplingEnabled(int displayId, boolean enable) {
        final NavigationBarView navigationBarView = getNavigationBarView(displayId);
        if (navigationBarView != null) {
            navigationBarView.setNavigationBarLumaSamplingEnabled(enable);
        }
    }

    /**
     * Recreates the navigation bar for the given display.
     */
+8 −0
Original line number Diff line number Diff line
@@ -1397,4 +1397,12 @@ public class NavigationBarView extends FrameLayout implements
    private final Consumer<Rect> mPipListener = bounds -> post(() -> {
        mEdgeBackGestureHandler.setPipStashExclusionBounds(bounds);
    });

    void setNavigationBarLumaSamplingEnabled(boolean enable) {
        if (enable) {
            mRegionSamplingHelper.start(mSamplingBounds);
        } else {
            mRegionSamplingHelper.stop();
        }
    }
}
Loading