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

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

Merge changes I0c466350,I09a9cd43,I8b2a0819 into pi-dev

* changes:
  Reset dummy stack view tasks after computing transition into Recents
  Don't update onboarding if there is no valid running task.
  Only check screen pinning state on touch down.
parents 8ada330d 4a088432
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -49,6 +49,10 @@ public abstract class AppTransitionAnimationSpecsFuture {
                    mHandler.post(mComposeTask);
                }
                List<AppTransitionAnimationSpecCompat> specs = mComposeTask.get();
                // Clear reference to the compose task this future holds onto the reference to it's
                // implementation (which can leak references to the bitmap it creates for the
                // transition)
                mComposeTask = null;
                if (specs == null) {
                    return null;
                }
+7 −0
Original line number Diff line number Diff line
@@ -276,6 +276,9 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
        }
    };

    // Used to reset the dummy stack view
    private final TaskStack mEmptyTaskStack = new TaskStack();

    public RecentsImpl(Context context) {
        mContext = context;
        mHandler = new Handler();
@@ -1108,6 +1111,10 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
            }
        });
        EventBus.getDefault().send(hideMenuEvent);

        // Once we have launched the activity, reset the dummy stack view tasks so we don't hold
        // onto references to the same tasks consumed by the activity
        mDummyStackView.setTasks(mEmptyTaskStack, false /* notifyStackChanges */);
    }

    /**** OnAnimationFinishedListener Implementation ****/
+3 −0
Original line number Diff line number Diff line
@@ -96,6 +96,9 @@ public class RecentsOnboarding {
        public void onTaskStackChanged() {
            ActivityManager.RunningTaskInfo info = ActivityManagerWrapper.getInstance()
                    .getRunningTask(ACTIVITY_TYPE_UNDEFINED /* ignoreActivityType */);
            if (info == null) {
                return;
            }
            if (mBlacklistedPackages.contains(info.baseActivity.getPackageName())) {
                hide(true);
                return;
+5 −1
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ public class NavigationBarGestureHelper implements TunerService.Tunable, Gesture
    private int mTouchDownY;
    private boolean mDownOnRecents;
    private VelocityTracker mVelocityTracker;
    private boolean mIsInScreenPinning;

    private boolean mDockWindowEnabled;
    private boolean mDockWindowTouchSlopExceeded;
@@ -105,6 +106,9 @@ public class NavigationBarGestureHelper implements TunerService.Tunable, Gesture
    }

    public boolean onInterceptTouchEvent(MotionEvent event) {
        if (event.getActionMasked() == MotionEvent.ACTION_DOWN) {
            mIsInScreenPinning = mNavigationBarView.inScreenPinning();
        }
        if (!canHandleGestures()) {
            return false;
        }
@@ -269,7 +273,7 @@ public class NavigationBarGestureHelper implements TunerService.Tunable, Gesture
    }

    private boolean canHandleGestures() {
        return !mNavigationBarView.inScreenPinning() && !mStatusBar.isKeyguardShowing()
        return !mIsInScreenPinning && !mStatusBar.isKeyguardShowing()
                && mStatusBar.isPresenterFullyCollapsed();
    }