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

Commit acda839b authored by Ming-Shin Lu's avatar Ming-Shin Lu Committed by Android (Google) Code Review
Browse files

Merge "Prevent NPEs when no focusable stack."

parents e6c03a07 f6c4a986
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -185,6 +185,10 @@ class ActivityMetricsLogger {

        mWindowState = WINDOW_STATE_INVALID;
        ActivityStack stack = mSupervisor.getFocusedStack();
        if (stack == null) {
            return;
        }

        if (stack.isActivityTypeAssistant()) {
            mWindowState = WINDOW_STATE_ASSISTANT;
            return;
+5 −0
Original line number Diff line number Diff line
@@ -709,6 +709,11 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
        if (!focusCandidate.isFocusable()) {
            // The focus candidate isn't focusable. Move focus to the top stack that is focusable.
            focusCandidate = getNextFocusableStackLocked(focusCandidate, false /* ignoreCurrent */);
            if (focusCandidate == null) {
                Slog.w(TAG,
                        "setFocusStackUnchecked: No focusable stack found, focus home as default");
                focusCandidate = mHomeStack;
            }
        }

        if (focusCandidate != mFocusedStack) {