summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Yunfan Chen <yunfanc@google.com> 2022-05-13 08:59:58 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2022-05-13 08:59:58 +0000
commit9d783ffbe8c475a40a9cdc95613308db1c26f03c (patch)
tree2597dc8ab8b77a30eabc24e0b20f5ba7d2034d80
parent90bc9a17ac6e91f5b97f4569d73a685f01148b72 (diff)
parent08d79c8f4dd32a8f3ef0a8943fa99845ef75e107 (diff)
Merge "Do not override insets frame if not set" into tm-dev am: bfa7c5d24b am: 08d79c8f4d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18331263 Change-Id: Iaaeecf8f0e9945eeca913b041b08558e0689aa6a Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--services/core/java/com/android/server/wm/DisplayPolicy.java28
1 files changed, 15 insertions, 13 deletions
diff --git a/services/core/java/com/android/server/wm/DisplayPolicy.java b/services/core/java/com/android/server/wm/DisplayPolicy.java
index 9033dcc64be0..daeba967ec76 100644
--- a/services/core/java/com/android/server/wm/DisplayPolicy.java
+++ b/services/core/java/com/android/server/wm/DisplayPolicy.java
@@ -1206,7 +1206,8 @@ public class DisplayPolicy {
if (attrs.providesInsetsTypes != null) {
for (@InternalInsetsType int insetsType : attrs.providesInsetsTypes) {
final TriConsumer<DisplayFrames, WindowContainer, Rect> imeFrameProvider =
- (displayFrames, windowContainer, inOutFrame) -> {
+ win.getAttrs().providedInternalImeInsets != null
+ ? (displayFrames, windowContainer, inOutFrame) -> {
final Insets[] providedInternalImeInsets =
win.getLayoutingAttrs(displayFrames.mRotation)
.providedInternalImeInsets;
@@ -1215,7 +1216,7 @@ public class DisplayPolicy {
&& providedInternalImeInsets[insetsType] != null) {
inOutFrame.inset(providedInternalImeInsets[insetsType]);
}
- };
+ } : null;
switch (insetsType) {
case ITYPE_STATUS_BAR:
mStatusBarAlt = win;
@@ -1234,17 +1235,18 @@ public class DisplayPolicy {
mExtraNavBarAltPosition = getAltBarPosition(attrs);
break;
}
- mDisplayContent.setInsetProvider(insetsType, win, (displayFrames,
- windowContainer, inOutFrame) -> {
- final Insets[] providedInternalInsets = win.getLayoutingAttrs(
- displayFrames.mRotation).providedInternalInsets;
- if (providedInternalInsets != null
- && providedInternalInsets.length > insetsType
- && providedInternalInsets[insetsType] != null) {
- inOutFrame.inset(providedInternalInsets[insetsType]);
- }
- inOutFrame.inset(win.mGivenContentInsets);
- }, imeFrameProvider);
+ mDisplayContent.setInsetProvider(insetsType, win,
+ win.getAttrs().providedInternalInsets != null ? (displayFrames,
+ windowContainer, inOutFrame) -> {
+ final Insets[] providedInternalInsets = win.getLayoutingAttrs(
+ displayFrames.mRotation).providedInternalInsets;
+ if (providedInternalInsets != null
+ && providedInternalInsets.length > insetsType
+ && providedInternalInsets[insetsType] != null) {
+ inOutFrame.inset(providedInternalInsets[insetsType]);
+ }
+ inOutFrame.inset(win.mGivenContentInsets);
+ } : null, imeFrameProvider);
mInsetsSourceWindowsExceptIme.add(win);
}
}