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

Commit b4d43538 authored by louis_chang's avatar louis_chang Committed by Craig Mautner
Browse files

Resume home activity can skip resume and cause ANR. DO NOT MERGE

Symptom:
In some scenario, there might have two home tasks
in the home stack. If the top home task was finishing
and expected to return to home stack, no activity
will resume.

Root Cause:
Unable to perform resumeHomeStackTask() because the
resumeTopActivityLocked() has been prevented to invoke
recursively.

Solution:
Just resume the next activity if already in home stack

Change-Id: I24ecbcac6cee4ddbd90cdd27c4f4915cffb9b354
parent 088bf3a3
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -1525,14 +1525,14 @@ final class ActivityStack {
                // Now the task above it has to return to the home task instead.
                final int taskNdx = mTaskHistory.indexOf(prevTask) + 1;
                mTaskHistory.get(taskNdx).setTaskToReturnTo(HOME_ACTIVITY_TYPE);
            } else {
                if (DEBUG_STATES && isOnHomeDisplay()) Slog.d(TAG,
            } else if (!isOnHomeDisplay()) {
                return false;
            } else if (!isHomeStack()){
                if (DEBUG_STATES) Slog.d(TAG,
                        "resumeTopActivityLocked: Launching home next");
                // Only resume home if on home display
                final int returnTaskType = prevTask == null || !prevTask.isOverHomeStack() ?
                        HOME_ACTIVITY_TYPE : prevTask.getTaskToReturnTo();
                return isOnHomeDisplay() &&
                        mStackSupervisor.resumeHomeStackTask(returnTaskType, prev);
                return mStackSupervisor.resumeHomeStackTask(returnTaskType, prev);
            }
        }