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

Commit 17a02442 authored by Winson Chung's avatar Winson Chung
Browse files

Remove path to provide Launcher with the nav bar surface

- It's not currently being used at all, and with the taskbar/navbar
  unification we will likely not need it going forward as well

Fixes: 318651465
Test: Builds
Change-Id: Ida8cb64c7c913ff739e65cf93cf441f7164b9556
parent 54debd28
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ import android.graphics.Rect;
import android.graphics.Region;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.SurfaceControl;
import com.android.systemui.shared.recents.ISystemUiProxy;

// Next ID: 29
@@ -98,11 +97,6 @@ oneway interface IOverviewProxy {
     */
    void enterStageSplitFromRunningApp(boolean leftOrTop) = 25;

    /**
     * Sent when the surface for navigation bar is created or changed
     */
    void onNavigationBarSurface(in SurfaceControl surface) = 26;

    /**
     * Sent when the task bar stash state is toggled.
     */
+0 −36
Original line number Diff line number Diff line
@@ -504,24 +504,6 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
                }
            };

    private final ViewRootImpl.SurfaceChangedCallback mSurfaceChangedCallback =
            new SurfaceChangedCallback() {
            @Override
            public void surfaceCreated(Transaction t) {
                notifyNavigationBarSurface();
            }

            @Override
            public void surfaceDestroyed() {
                notifyNavigationBarSurface();
            }

            @Override
            public void surfaceReplaced(Transaction t) {
                notifyNavigationBarSurface();
            }
    };

    private boolean mScreenPinningActive = false;
    private final TaskStackChangeListener mTaskStackListener = new TaskStackChangeListener() {
        @Override
@@ -787,8 +769,6 @@ public class NavigationBar extends ViewController<NavigationBarView> implements

        mView.getViewTreeObserver().addOnComputeInternalInsetsListener(
                mOnComputeInternalInsetsListener);
        mView.getViewRootImpl().addSurfaceChangedCallback(mSurfaceChangedCallback);
        notifyNavigationBarSurface();

        mPipOptional.ifPresent(mView::addPipExclusionBoundsChangeListener);
        mBackAnimation.ifPresent(mView::registerBackAnimation);
@@ -860,13 +840,8 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
        mHandler.removeCallbacks(mEnableLayoutTransitions);
        mNavBarHelper.removeNavTaskStateUpdater(mNavbarTaskbarStateUpdater);
        mPipOptional.ifPresent(mView::removePipExclusionBoundsChangeListener);
        ViewRootImpl viewRoot = mView.getViewRootImpl();
        if (viewRoot != null) {
            viewRoot.removeSurfaceChangedCallback(mSurfaceChangedCallback);
        }
        mFrame = null;
        mOrientationHandle = null;
        notifyNavigationBarSurface();
    }

    // TODO: Remove this when we update nav bar recreation
@@ -1026,17 +1001,6 @@ public class NavigationBar extends ViewController<NavigationBarView> implements
        }
    }

    private void notifyNavigationBarSurface() {
        ViewRootImpl viewRoot = mView.getViewRootImpl();
        SurfaceControl surface = mView.getParent() != null 
                && viewRoot != null
                && viewRoot.getSurfaceControl() != null
                && viewRoot.getSurfaceControl().isValid()
                        ? viewRoot.getSurfaceControl()
                        : null;
        mOverviewProxyService.onNavigationBarSurfaceChanged(surface);
    }

    private int deltaRotation(int oldRotation, int newRotation) {
        int delta = newRotation - oldRotation;
        if (delta < 0) delta += 4;
+0 −25
Original line number Diff line number Diff line
@@ -169,7 +169,6 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
    private final DisplayTracker mDisplayTracker;

    private Region mActiveNavBarRegion;
    private SurfaceControl mNavigationBarSurface;

    private IOverviewProxy mOverviewProxy;
    private int mConnectionBackoffAttempts;
@@ -488,7 +487,6 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
                Log.e(TAG_OPS, "Failed to call onInitialize()", e);
            }
            dispatchNavButtonBounds();
            dispatchNavigationBarSurface();

            // Force-update the systemui state flags
            updateSystemUiStateFlags();
@@ -679,28 +677,6 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
                .commitUpdate(mContext.getDisplayId());
    }

    /**
     * Called when the navigation bar surface is created or changed
     */
    public void onNavigationBarSurfaceChanged(SurfaceControl navbarSurface) {
        mNavigationBarSurface = navbarSurface;
        dispatchNavigationBarSurface();
    }

    private void dispatchNavigationBarSurface() {
        try {
            if (mOverviewProxy != null) {
                // Catch all for cases where the surface is no longer valid
                if (mNavigationBarSurface != null && !mNavigationBarSurface.isValid()) {
                    mNavigationBarSurface = null;
                }
                mOverviewProxy.onNavigationBarSurface(mNavigationBarSurface);
            }
        } catch (RemoteException e) {
            Log.e(TAG_OPS, "Failed to notify back action", e);
        }
    }

    private void updateEnabledAndBinding() {
        updateEnabledState();
        startConnectionToCurrentUser();
@@ -1075,7 +1051,6 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
        pw.print("  mInputFocusTransferStartY="); pw.println(mInputFocusTransferStartY);
        pw.print("  mInputFocusTransferStartMillis="); pw.println(mInputFocusTransferStartMillis);
        pw.print("  mActiveNavBarRegion="); pw.println(mActiveNavBarRegion);
        pw.print("  mNavigationBarSurface="); pw.println(mNavigationBarSurface);
        pw.print("  mNavBarMode="); pw.println(mNavBarMode);
        mSysUiState.dump(pw, args);
    }