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

Commit 16440ee3 authored by Yunfan Chen's avatar Yunfan Chen Committed by Android (Google) Code Review
Browse files

Merge "Always use system config insets types for insets frame" into 24D1-dev

parents f5452ad8 b2fecc4e
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -8942,8 +8942,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
                : mDisplayContent.getDisplayInfo();
        final Task task = getTask();
        task.calculateInsetFrames(mTmpBounds /* outNonDecorBounds */,
                outStableBounds /* outStableBounds */, parentBounds /* bounds */, di,
                true /* useLegacyInsetsForStableBounds */);
                outStableBounds /* outStableBounds */, parentBounds /* bounds */, di);
        final int orientationWithInsets = outStableBounds.height() >= outStableBounds.width()
                ? ORIENTATION_PORTRAIT : ORIENTATION_LANDSCAPE;
        // If orientation does not match the orientation with insets applied, then a
+3 −10
Original line number Diff line number Diff line
@@ -2331,8 +2331,7 @@ class TaskFragment extends WindowContainer<WindowContainer> {
                // area, i.e. the screen area without the system bars.
                // The non decor inset are areas that could never be removed in Honeycomb. See
                // {@link WindowManagerPolicy#getNonDecorInsetsLw}.
                calculateInsetFrames(mTmpNonDecorBounds, mTmpStableBounds, mTmpFullBounds, di,
                        false /* useLegacyInsetsForStableBounds */);
                calculateInsetFrames(mTmpNonDecorBounds, mTmpStableBounds, mTmpFullBounds, di);
            } else {
                // Apply the given non-decor and stable insets to calculate the corresponding bounds
                // for screen size of configuration.
@@ -2430,11 +2429,9 @@ class TaskFragment extends WindowContainer<WindowContainer> {
     * @param outNonDecorBounds where to place bounds with non-decor insets applied.
     * @param outStableBounds where to place bounds with stable insets applied.
     * @param bounds the bounds to inset.
     * @param useLegacyInsetsForStableBounds {@code true} if we need to use the legacy insets frame
     *                for apps targeting U or before when calculating stable bounds.
     */
    void calculateInsetFrames(Rect outNonDecorBounds, Rect outStableBounds, Rect bounds,
            DisplayInfo displayInfo, boolean useLegacyInsetsForStableBounds) {
            DisplayInfo displayInfo) {
        outNonDecorBounds.set(bounds);
        outStableBounds.set(bounds);
        if (mDisplayContent == null) {
@@ -2446,11 +2443,7 @@ class TaskFragment extends WindowContainer<WindowContainer> {
        final DisplayPolicy.DecorInsets.Info info = policy.getDecorInsetsInfo(
                displayInfo.rotation, displayInfo.logicalWidth, displayInfo.logicalHeight);
        intersectWithInsetsIfFits(outNonDecorBounds, mTmpBounds, info.mNonDecorInsets);
        if (!useLegacyInsetsForStableBounds) {
        intersectWithInsetsIfFits(outStableBounds, mTmpBounds, info.mConfigInsets);
        } else {
            intersectWithInsetsIfFits(outStableBounds, mTmpBounds, info.mOverrideConfigInsets);
        }
    }

    /**