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

Commit 41c0f353 authored by Craig Mautner's avatar Craig Mautner
Browse files

Replace mFocusedStack with getFocusedStack()

mFocusedStack should not be used directly as it may be null. Added
a note to the declaration to remind future self of that.

Fixes bug 9165949.

Change-Id: I8fad428d93b50909be9e7ec51df81149c11313b3
parent e0e1af0a
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -127,7 +127,8 @@ public class ActivityStackSupervisor {
    private ActivityStack mHomeStack;

    /** The non-home stack currently receiving input or launching the next activity. If home is
     * in front then mHomeStack overrides mFocusedStack. */
     * in front then mHomeStack overrides mFocusedStack.
     * DO NOT ACCESS DIRECTLY - It may be null, use getFocusedStack() */
    private ActivityStack mFocusedStack;

    /** All the non-launcher stacks */
@@ -326,7 +327,7 @@ public class ActivityStackSupervisor {
            final int stackId = stack.mStackId;
            final int nextStackId = mWindowManager.removeStack(stackId);
            // TODO: Perhaps we need to let the ActivityManager determine the next focus...
            if (mFocusedStack.mStackId == stackId) {
            if (getFocusedStack().mStackId == stackId) {
                // If this is the last app stack, set mFocusedStack to null.
                mFocusedStack = nextStackId == HOME_STACK_ID ? null : getStack(nextStackId);
            }