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

Commit 370d68fa authored by Tracy Zhou's avatar Tracy Zhou
Browse files

Cover screen pinning logic around task bar

Fixes: 205280231
Test: manual
Change-Id: I7e34def68dae9045d967f0871729e1988e1fe149
parent 4baae1f7
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -427,6 +427,15 @@ public class NavigationBarController implements
        }
    }

    public boolean isOverviewEnabled(int displayId) {
        final NavigationBarView navBarView = getNavigationBarView(displayId);
        if (navBarView != null) {
            return navBarView.isOverviewEnabled();
        } else {
            return mTaskbarDelegate.isOverviewEnabled();
        }
    }

    /** @return {@link NavigationBar} on the default display. */
    @Nullable
    public NavigationBar getDefaultNavigationBar() {
+4 −0
Original line number Diff line number Diff line
@@ -309,6 +309,10 @@ public class TaskbarDelegate implements CommandQueue.Callbacks,
                .commitUpdate(mDisplayId);
    }

    boolean isOverviewEnabled() {
        return (mSysUiState.getFlags() & View.STATUS_BAR_DISABLE_RECENT) == 0;
    }

    private void updateAssistantAvailability(boolean assistantAvailable) {
        if (mOverviewProxyService.getProxy() == null) {
            return;
+4 −4
Original line number Diff line number Diff line
@@ -271,10 +271,8 @@ public class ScreenPinningRequest implements View.OnClickListener,

            final Optional<CentralSurfaces> centralSurfacesOptional =
                    mCentralSurfacesOptionalLazy.get();
            NavigationBarView navigationBarView =
                    centralSurfacesOptional.map(CentralSurfaces::getNavigationBarView).orElse(null);
            final boolean recentsVisible = navigationBarView != null
                    && navigationBarView.isRecentsButtonVisible();
            boolean recentsVisible =
                    centralSurfacesOptional.map(CentralSurfaces::isOverviewEnabled).orElse(false);
            boolean touchExplorationEnabled = mAccessibilityService.isTouchExplorationEnabled();
            int descriptionStringResId;
            if (QuickStepContract.isGesturalMode(mNavBarMode)) {
@@ -295,6 +293,8 @@ public class ScreenPinningRequest implements View.OnClickListener,
                        : R.string.screen_pinning_description_recents_invisible;
            }

            NavigationBarView navigationBarView =
                    centralSurfacesOptional.map(CentralSurfaces::getNavigationBarView).orElse(null);
            if (navigationBarView != null) {
                ((ImageView) mLayout.findViewById(R.id.screen_pinning_back_icon))
                        .setImageDrawable(navigationBarView.getBackDrawable());
+4 −0
Original line number Diff line number Diff line
@@ -3439,6 +3439,10 @@ public class CentralSurfaces extends CoreStartable implements
        return mNavigationBarController.getNavigationBarView(mDisplayId);
    }

    public boolean isOverviewEnabled() {
        return mNavigationBarController.isOverviewEnabled(mDisplayId);
    }

    public void showPinningEnterExitToast(boolean entering) {
        mNavigationBarController.showPinningEnterExitToast(mDisplayId, entering);
    }