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

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

Merge "Bringing back assistant on long press home button (1/2)"

parents 09571f89 fee0b5b2
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -580,8 +580,7 @@ public class NavigationBarFragment extends Fragment implements Callbacks {

    private boolean shouldDisableNavbarGestures() {
        return !mStatusBar.isDeviceProvisioned()
                || (mDisabledFlags1 & StatusBarManager.DISABLE_SEARCH) != 0
                || mNavigationBarView.getRecentsButton().getVisibility() != View.VISIBLE;
                || (mDisabledFlags1 & StatusBarManager.DISABLE_SEARCH) != 0;
    }

    private void repositionNavigationBar() {
@@ -600,13 +599,10 @@ public class NavigationBarFragment extends Fragment implements Callbacks {

        // Change the cancel pin gesture to home and back if recents button is invisible
        boolean recentsVisible = mNavigationBarView.isRecentsButtonVisible();
        ButtonDispatcher homeButton = mNavigationBarView.getHomeButton();
        ButtonDispatcher backButton = mNavigationBarView.getBackButton();
        if (recentsVisible) {
            homeButton.setOnLongClickListener(this::onHomeLongClick);
            backButton.setOnLongClickListener(this::onLongPressBackRecents);
        } else {
            homeButton.setOnLongClickListener(this::onLongPressBackHome);
            backButton.setOnLongClickListener(this::onLongPressBackHome);
        }
    }
@@ -629,6 +625,7 @@ public class NavigationBarFragment extends Fragment implements Callbacks {

        ButtonDispatcher homeButton = mNavigationBarView.getHomeButton();
        homeButton.setOnTouchListener(this::onHomeTouch);
        homeButton.setOnLongClickListener(this::onHomeLongClick);

        ButtonDispatcher accessibilityButton = mNavigationBarView.getAccessibilityButton();
        accessibilityButton.setOnClickListener(this::onAccessibilityClick);
@@ -681,6 +678,9 @@ public class NavigationBarFragment extends Fragment implements Callbacks {

    @VisibleForTesting
    boolean onHomeLongClick(View v) {
        if (!mNavigationBarView.isRecentsButtonVisible() && mNavigationBarView.inScreenPinning()) {
            return onLongPressBackHome(v);
        }
        if (shouldDisableNavbarGestures()) {
            return false;
        }
+4 −1
Original line number Diff line number Diff line
@@ -380,7 +380,7 @@ public class QuickScrubController extends GestureDetector.SimpleOnGestureListene
    }

    private void startQuickScrub() {
        if (!mQuickScrubActive) {
        if (!mQuickScrubActive && mDraggingActive) {
            mQuickScrubActive = true;
            mLightTrackColor = mContext.getColor(R.color.quick_step_track_background_light);
            mDarkTrackColor = mContext.getColor(R.color.quick_step_track_background_dark);
@@ -394,6 +394,9 @@ public class QuickScrubController extends GestureDetector.SimpleOnGestureListene
            } catch (RemoteException e) {
                Log.e(TAG, "Failed to send start of quick scrub.", e);
            }
        } else {
            // After long press do not allow quick scrub/switch
            mTouchDownX = -1;
        }
    }