From 7fe7f68627e9c58239c52d1d75e9d5163490b8f1 Mon Sep 17 00:00:00 2001 From: Tiger Huang Date: Sat, 26 Oct 2019 01:11:23 +0800 Subject: [PATCH] Sends the correct content insets to status bar This CL ensures the content and visible frames of status bar won't be overlapped with the stable insets. So that it can prevent the content of status bar from being obscured by navigation bar. Fix: 141661670 Test: manually test with the immersive show-when-locked app Change-Id: I91e7c694fb21371e3513a9e61159f488e0aa783e --- .../java/com/android/server/wm/DisplayPolicy.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/services/core/java/com/android/server/wm/DisplayPolicy.java b/services/core/java/com/android/server/wm/DisplayPolicy.java index a783ee9d4e445..6e238b33d8dd6 100644 --- a/services/core/java/com/android/server/wm/DisplayPolicy.java +++ b/services/core/java/com/android/server/wm/DisplayPolicy.java @@ -1920,10 +1920,18 @@ public class DisplayPolicy { vf.set(displayFrames.mStable); if (adjust == SOFT_INPUT_ADJUST_RESIZE) { - cf.bottom = displayFrames.mContent.bottom; + // cf.bottom should not be below the stable bottom, or the content might be obscured + // by the navigation bar. + if (cf.bottom > displayFrames.mContent.bottom) { + cf.bottom = displayFrames.mContent.bottom; + } } else { - cf.bottom = displayFrames.mDock.bottom; - vf.bottom = displayFrames.mContent.bottom; + if (cf.bottom > displayFrames.mDock.bottom) { + cf.bottom = displayFrames.mDock.bottom; + } + if (vf.bottom > displayFrames.mContent.bottom) { + vf.bottom = displayFrames.mContent.bottom; + } } } else { dcf.set(displayFrames.mSystem);