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

Commit 68002428 authored by Jorim Jaggi's avatar Jorim Jaggi Committed by Automerger Merge Worker
Browse files

Merge "Revert "Revert "Revert "Revert "Make extra navigation bar count towards...

Merge "Revert "Revert "Revert "Revert "Make extra navigation bar count towards non decor frame (3/3)""""" into tm-qpr-dev am: ba3d01f1 am: 96ba8820 am: 1b3f73f0

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21547640



Change-Id: I518e7c84075e52682f3da6b5cd3cf0768c2ebc4a
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 9da7add8 1b3f73f0
Loading
Loading
Loading
Loading
+4 −26
Original line number Diff line number Diff line
@@ -1801,7 +1801,8 @@ public class DisplayPolicy {
                dc.getDisplayPolicy().simulateLayoutDisplay(df);
                final InsetsState insetsState = df.mInsetsState;
                final Rect displayFrame = insetsState.getDisplayFrame();
                final Insets decor = calculateDecorInsetsWithInternalTypes(insetsState);
                final Insets decor = insetsState.calculateInsets(displayFrame, DECOR_TYPES,
                        true /* ignoreVisibility */);
                final Insets statusBar = insetsState.calculateInsets(displayFrame,
                        Type.statusBars(), true /* ignoreVisibility */);
                mNonDecorInsets.set(decor.left, decor.top, decor.right, decor.bottom);
@@ -1833,17 +1834,8 @@ public class DisplayPolicy {
            }
        }

        // TODO (b/235842600): Use public type once we can treat task bar as navigation bar.
        static final int[] INTERNAL_DECOR_TYPES;
        static {
            final ArraySet<Integer> decorTypes = InsetsState.toInternalType(
                    Type.displayCutout() | Type.navigationBars());
            decorTypes.remove(ITYPE_EXTRA_NAVIGATION_BAR);
            INTERNAL_DECOR_TYPES = new int[decorTypes.size()];
            for (int i = 0; i < INTERNAL_DECOR_TYPES.length; i++) {
                INTERNAL_DECOR_TYPES[i] = decorTypes.valueAt(i);
            }
        }

        static final int DECOR_TYPES = Type.displayCutout() | Type.navigationBars();

        private final DisplayContent mDisplayContent;
        private final Info[] mInfoForRotation = new Info[4];
@@ -1870,20 +1862,6 @@ public class DisplayPolicy {
                info.mNeedUpdate = true;
            }
        }

        // TODO (b/235842600): Remove this method once we can treat task bar as navigation bar.
        private static Insets calculateDecorInsetsWithInternalTypes(InsetsState state) {
            final Rect frame = state.getDisplayFrame();
            Insets insets = Insets.NONE;
            for (int i = INTERNAL_DECOR_TYPES.length - 1; i >= 0; i--) {
                final InsetsSource source = state.peekSource(INTERNAL_DECOR_TYPES[i]);
                if (source != null) {
                    insets = Insets.max(source.calculateInsets(frame, true /* ignoreVisibility */),
                            insets);
                }
            }
            return insets;
        }
    }

    /**