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

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

Merge "Fix NullPointerException when the focused window has no activity" into main

parents 1b01d28c 58c3e8fd
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -9444,8 +9444,13 @@ public class WindowManagerService extends IWindowManager.Stub
     * Returns {@code true} if the focused window is changed. Otherwise, returns {@code false}.
     */
    boolean moveFocusToAdjacentEmbeddedWindow(@NonNull WindowState focusedWindow) {
        final ActivityRecord activity = focusedWindow.getActivityRecord();
        if (activity == null) {
            return false;
        }

        final ActivityRecord mostRecentActivityInAdjacent = getMostRecentActivityInAdjacent(
                focusedWindow.getActivityRecord());
                activity);

        moveFocusToActivity(mostRecentActivityInAdjacent);
        return !focusedWindow.isFocused();