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

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

Merge "Fix NPE of BaseContainerInterface#calculateTaskSizeInternal" into main

parents 2d73c5ef eef1599c
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ import com.android.launcher3.statehandlers.DesktopVisibilityController;
import com.android.launcher3.statemanager.BaseState;
import com.android.launcher3.taskbar.TaskbarUIController;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.WindowBounds;
import com.android.launcher3.views.ScrimView;
import com.android.quickstep.orientation.RecentsPagedOrientationHandler;
import com.android.quickstep.util.ActivityInitListener;
@@ -51,6 +52,7 @@ import com.android.quickstep.views.RecentsViewContainer;
import com.android.systemui.shared.recents.model.ThumbnailData;

import java.util.HashMap;
import java.util.List;
import java.util.function.Consumer;
import java.util.function.Predicate;

@@ -269,8 +271,11 @@ public abstract class BaseContainerInterface<STATE_TYPE extends BaseState<STATE_
        } else {
            Rect portraitInsets = dp.getInsets();
            DisplayController displayController = DisplayController.INSTANCE.get(context);
            Rect deviceRotationInsets = displayController.getInfo().getCurrentBounds().get(
                    orientationHandler.getRotation()).insets;
            @Nullable List<WindowBounds> windowBounds =
                    displayController.getInfo().getCurrentBounds();
            Rect deviceRotationInsets = windowBounds != null
                    ? windowBounds.get(orientationHandler.getRotation()).insets
                    : new Rect();
            // Obtain the landscape/seascape insets, and rotate it to portrait perspective.
            orientationHandler.rotateInsets(deviceRotationInsets, outRect);
            // Then combine with portrait's insets to leave space for status bar/nav bar in
+3 −3
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ import android.util.Log;
import android.view.Display;

import androidx.annotation.AnyThread;
import androidx.annotation.Nullable;
import androidx.annotation.UiThread;
import androidx.annotation.VisibleForTesting;

@@ -513,9 +514,8 @@ public class DisplayController implements ComponentCallbacks, SafeCloseable {
            return Collections.unmodifiableSet(mPerDisplayBounds.keySet());
        }

        /**
         * Returns all {@link WindowBounds}s for the current display.
         */
        /** Returns all {@link WindowBounds}s for the current display. */
        @Nullable
        public List<WindowBounds> getCurrentBounds() {
            return mPerDisplayBounds.get(normalizedDisplayInfo);
        }