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

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

Merge changes I7261cf87,Icabfcf47,I09e6b032,I252cf139,If85ade73, ... into nyc-dev

* changes:
  Revert "Death to synchronous transactions (2/2)"
  Fix a few weird state issues from race-conditions
  Fix lifecycle bug in when calling positionTask
  Animation fixes when task is not resumed
  Keep stack from mReuseTask
  Final fixes for growing recents transition
parents da3cd339 3b6e05a2
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -202,8 +202,8 @@ public class RecentsViewTouchHandler {
     * Handles dragging touch events
     */
    private void handleTouchEvent(MotionEvent ev) {
        int action = ev.getAction();
        switch (action & MotionEvent.ACTION_MASK) {
        int action = ev.getActionMasked();
        switch (action) {
            case MotionEvent.ACTION_DOWN:
                mDownPos.set((int) ev.getX(), (int) ev.getY());
                break;
@@ -258,7 +258,7 @@ public class RecentsViewTouchHandler {
            case MotionEvent.ACTION_CANCEL: {
                if (mDragRequested) {
                    EventBus.getDefault().send(new DragEndEvent(mDragTask, mTaskView,
                            mLastDropTarget));
                            action == MotionEvent.ACTION_UP ? mLastDropTarget : null));
                    break;
                }
            }
+14 −1
Original line number Diff line number Diff line
@@ -116,6 +116,7 @@ import android.os.UserHandle;
import android.service.voice.IVoiceInteractionSession;
import android.util.ArraySet;
import android.util.EventLog;
import android.util.Log;
import android.util.Slog;
import android.view.Display;

@@ -3431,8 +3432,10 @@ final class ActivityStack {
                mWindowManager.prepareAppTransition(transit, false);
                mWindowManager.setAppVisibility(r.appToken, false);
                mWindowManager.executeAppTransition();
                mStackSupervisor.mWaitingVisibleActivities.add(r);
            }
            return finishCurrentActivityLocked(r, FINISH_AFTER_PAUSE, oomAdj) == null;
            return finishCurrentActivityLocked(r,
                    r.visible ? FINISH_AFTER_VISIBLE : FINISH_AFTER_PAUSE, oomAdj) == null;
        } else {
            if (DEBUG_PAUSE) Slog.v(TAG_PAUSE, "Finish waiting for pause of: " + r);
        }
@@ -5023,10 +5026,20 @@ final class ActivityStack {
    }

    void positionTask(final TaskRecord task, int position) {
        final ActivityRecord topRunningActivity = task.topRunningActivityLocked();
        final boolean wasResumed = topRunningActivity == task.stack.mResumedActivity;
        final ActivityStack prevStack = preAddTask(task, "positionTask");
        task.stack = this;
        insertTaskAtPosition(task, position);
        postAddTask(task, prevStack);
        if (wasResumed) {
            if (mResumedActivity != null) {
                Log.wtf(TAG, "mResumedActivity was already set when moving mResumedActivity from"
                        + " other stack to this stack mResumedActivity=" + mResumedActivity
                        + " other mResumedActivity=" + topRunningActivity);
            }
            mResumedActivity = topRunningActivity;
        }
    }

    private ActivityStack preAddTask(TaskRecord task, String reason) {
+13 −2
Original line number Diff line number Diff line
@@ -527,8 +527,13 @@ class ActivityStarter {

        doPendingActivityLaunchesLocked(false);

        err = startActivityUnchecked(
                r, sourceRecord, voiceSession, voiceInteractor, startFlags, true, options, inTask);
        try {
            mService.mWindowManager.deferSurfaceLayout();
            err = startActivityUnchecked(r, sourceRecord, voiceSession, voiceInteractor, startFlags,
                    true, options, inTask);
        } finally {
            mService.mWindowManager.continueSurfaceLayout();
        }
        postStartActivityUncheckedProcessing(r, err, stack.mStackId);
        return err;
    }
@@ -1853,6 +1858,12 @@ class ActivityStarter {

    private ActivityStack getLaunchStack(ActivityRecord r, int launchFlags, TaskRecord task,
            ActivityOptions aOptions) {

        // We are reusing a task, keep the stack!
        if (mReuseTask != null) {
            return mReuseTask.stack;
        }

        final int launchStackId =
                (aOptions != null) ? aOptions.getLaunchStackId() : INVALID_STACK_ID;

+8 −0
Original line number Diff line number Diff line
@@ -1914,6 +1914,14 @@ public class AppTransition implements Dump {
                setAppTransition(transit);
            }
        }
        if (transit != TRANSIT_DOCK_TASK_FROM_RECENTS
                && mNextAppTransition == TRANSIT_DOCK_TASK_FROM_RECENTS) {

            // Somebody is trying to start another transition while we are waiting for the docking
            // window to be drawn. Because TRANSIT_DOCK_TASK_FROM_RECENTS starts prolonged
            // animations, we need to override it or our prolonged animations will never be ended.
            setAppTransition(transit);
        }
        boolean prepared = prepare();
        if (isTransitionSet()) {
            mService.mH.removeMessages(H.APP_TRANSITION_TIMEOUT);
+1 −1
Original line number Diff line number Diff line
@@ -433,7 +433,7 @@ public class AppWindowAnimator {
            WindowStateAnimator winAnimator = mAllAppWinAnimators.get(i);
            if (DEBUG_VISIBILITY) Slog.v(TAG, "performing show on: " + winAnimator);
            winAnimator.performShowLocked();
            isAnimating |= winAnimator.isAnimating();
            isAnimating |= winAnimator.isAnimationSet();
        }
        return isAnimating;
    }
Loading