[DO NOT MERGE] Force extra nav bar provide side gesture insets am: a2e8e22971 am: 12bd8024ec am: 6fdacef0ea

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

Change-Id: Iea15813eba7afe49ba8df2be7bd47ae0cd8e1ac8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Yunfan Chen
2022-05-19 13:09:24 +00:00
committed by Automerger Merge Worker

View File

@@ -1247,6 +1247,29 @@ public class DisplayPolicy {
}
inOutFrame.inset(win.mGivenContentInsets);
} : null, imeFrameProvider);
if (mNavigationBar == null && (insetsType == ITYPE_NAVIGATION_BAR
|| insetsType == ITYPE_EXTRA_NAVIGATION_BAR)) {
mDisplayContent.setInsetProvider(ITYPE_LEFT_GESTURES, win,
(displayFrames, windowState, inOutFrame) -> {
final int leftSafeInset =
Math.max(displayFrames.mDisplayCutoutSafe.left,0);
inOutFrame.left = 0;
inOutFrame.top = 0;
inOutFrame.bottom = displayFrames.mDisplayHeight;
inOutFrame.right =
leftSafeInset + mLeftGestureInset;
});
mDisplayContent.setInsetProvider(ITYPE_RIGHT_GESTURES, win,
(displayFrames, windowState, inOutFrame) -> {
final int rightSafeInset =
Math.min(displayFrames.mDisplayCutoutSafe.right,
displayFrames.mUnrestricted.right);
inOutFrame.left = rightSafeInset - mRightGestureInset;
inOutFrame.top = 0;
inOutFrame.bottom = displayFrames.mDisplayHeight;
inOutFrame.right = displayFrames.mDisplayWidth;
});
}
mInsetsSourceWindowsExceptIme.add(win);
}
}