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

Commit 313b5590 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[Predictive Back] Clean up flags" into main

parents a68e4fe0 1f25f640
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ import static android.content.ClipDescription.MIMETYPE_TEXT_INTENT;
import static android.view.WindowInsets.Type.navigationBars;
import static android.view.WindowInsets.Type.statusBars;

import static com.android.launcher3.Flags.enablePredictiveBackGesture;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;

@@ -170,11 +169,6 @@ public class WidgetPickerActivity extends BaseActivity {

    @Override
    protected void registerBackDispatcher() {
        if (!enablePredictiveBackGesture()) {
            super.registerBackDispatcher();
            return;
        }

        getOnBackInvokedDispatcher().registerOnBackInvokedCallback(
                OnBackInvokedDispatcher.PRIORITY_DEFAULT,
                new BackAnimationCallback());
+11 −16
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@
package com.android.launcher3.taskbar.allapps;

import static com.android.app.animation.Interpolators.EMPHASIZED;
import static com.android.launcher3.Flags.enablePredictiveBackGesture;
import static com.android.launcher3.touch.AllAppsSwipeController.ALL_APPS_FADE_MANUAL;
import static com.android.launcher3.touch.AllAppsSwipeController.SCRIM_FADE_MANUAL;

@@ -193,7 +192,6 @@ public class TaskbarAllAppsSlideInView extends AbstractSlideInView<TaskbarOverla
    protected void onAttachedToWindow() {
        super.onAttachedToWindow();
        mActivityContext.addOnDeviceProfileChangeListener(this);
        if (enablePredictiveBackGesture()) {
        mAppsView.getAppsRecyclerViewContainer().setOutlineProvider(mViewOutlineProvider);
        mAppsView.getAppsRecyclerViewContainer().setClipToOutline(true);
        OnBackInvokedDispatcher dispatcher = findOnBackInvokedDispatcher();
@@ -202,13 +200,11 @@ public class TaskbarAllAppsSlideInView extends AbstractSlideInView<TaskbarOverla
                    OnBackInvokedDispatcher.PRIORITY_DEFAULT, this);
        }
    }
    }

    @Override
    protected void onDetachedFromWindow() {
        super.onDetachedFromWindow();
        mActivityContext.removeOnDeviceProfileChangeListener(this);
        if (enablePredictiveBackGesture()) {
        mAppsView.getAppsRecyclerViewContainer().setOutlineProvider(null);
        mAppsView.getAppsRecyclerViewContainer().setClipToOutline(false);
        OnBackInvokedDispatcher dispatcher = findOnBackInvokedDispatcher();
@@ -216,7 +212,6 @@ public class TaskbarAllAppsSlideInView extends AbstractSlideInView<TaskbarOverla
            dispatcher.unregisterOnBackInvokedCallback(this);
        }
    }
    }

    @Override
    protected void dispatchDraw(Canvas canvas) {
+2 −10
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ import static android.view.accessibility.AccessibilityEvent.TYPE_VIEW_FOCUSED;

import static com.android.app.animation.Interpolators.EMPHASIZED;
import static com.android.internal.jank.Cuj.CUJ_LAUNCHER_LAUNCH_APP_PAIR_FROM_WORKSPACE;
import static com.android.launcher3.Flags.enablePredictiveBackGesture;
import static com.android.launcher3.Flags.enableUnfoldStateAnimation;
import static com.android.launcher3.LauncherConstants.SavedInstanceKeys.PENDING_SPLIT_SELECT_INFO;
import static com.android.launcher3.LauncherConstants.SavedInstanceKeys.RUNTIME_STATE;
@@ -696,9 +695,7 @@ public class QuickstepLauncher extends Launcher implements RecentsViewContainer,
        // Back dispatcher is registered in {@link BaseActivity#onCreate}. For predictive back to
        // work, we must opt-in BEFORE registering back dispatcher. So we need to call
        // setEnableOnBackInvokedCallback() before super.onCreate()
        if (Utilities.ATLEAST_U && enablePredictiveBackGesture()) {
        getApplicationInfo().setEnableOnBackInvokedCallback(true);
        }
        super.onCreate(savedInstanceState);
        if (savedInstanceState != null) {
            mPendingSplitSelectInfo = ObjectWrapper.unwrap(
@@ -910,8 +907,7 @@ public class QuickstepLauncher extends Launcher implements RecentsViewContainer,
        // event won't go through ViewRootImpl#InputStage#onProcess.
        // So when receive back key, try to do the same check thing in
        // ViewRootImpl#NativePreImeInputStage#onProcess
        if (!Utilities.ATLEAST_U || !enablePredictiveBackGesture()
                || event.getKeyCode() != KeyEvent.KEYCODE_BACK
        if (event.getKeyCode() != KeyEvent.KEYCODE_BACK
                || event.getAction() != KeyEvent.ACTION_UP || event.isCanceled()) {
            return false;
        }
@@ -922,10 +918,6 @@ public class QuickstepLauncher extends Launcher implements RecentsViewContainer,

    @Override
    protected void registerBackDispatcher() {
        if (!enablePredictiveBackGesture()) {
            super.registerBackDispatcher();
            return;
        }
        getOnBackInvokedDispatcher().registerOnBackInvokedCallback(
                OnBackInvokedDispatcher.PRIORITY_DEFAULT,
                new OnBackAnimationCallback() {