Loading quickstep/src/com/android/quickstep/util/SystemWindowManagerProxy.java +8 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.view.Surface; import android.view.WindowManager; import android.view.WindowMetrics; import com.android.internal.policy.SystemBarUtils; import com.android.launcher3.util.WindowBounds; import com.android.launcher3.util.window.CachedDisplayInfo; import com.android.launcher3.util.window.WindowManagerProxy; Loading @@ -44,6 +45,13 @@ public class SystemWindowManagerProxy extends WindowManagerProxy { .getRotation(); } @Override protected int getStatusBarHeight(Context context, boolean isPortrait, int statusBarInset) { // See b/264656380, calculate the status bar height manually as the inset in the system // server might not be updated by this point yet causing extra DeviceProfile updates return SystemBarUtils.getStatusBarHeight(context); } @Override public ArrayMap<CachedDisplayInfo, WindowBounds[]> estimateInternalDisplayBounds( Context displayInfoContext) { Loading src/com/android/launcher3/util/window/WindowManagerProxy.java +14 −4 Original line number Diff line number Diff line Loading @@ -161,12 +161,10 @@ public class WindowManagerProxy implements ResourceBasedOverride { insetsBuilder.setInsetsIgnoringVisibility(WindowInsets.Type.navigationBars(), newNavInsets); Insets statusBarInsets = oldInsets.getInsets(WindowInsets.Type.statusBars()); int statusBarHeight = getDimenByName(systemRes, (isPortrait) ? STATUS_BAR_HEIGHT_PORTRAIT : STATUS_BAR_HEIGHT_LANDSCAPE, STATUS_BAR_HEIGHT); Insets newStatusBarInsets = Insets.of( statusBarInsets.left, Math.max(statusBarInsets.top, statusBarHeight), getStatusBarHeight(context, isPortrait, statusBarInsets.top), statusBarInsets.right, statusBarInsets.bottom); insetsBuilder.setInsets(WindowInsets.Type.statusBars(), newStatusBarInsets); Loading @@ -190,6 +188,15 @@ public class WindowManagerProxy implements ResourceBasedOverride { return result; } protected int getStatusBarHeight(Context context, boolean isPortrait, int statusBarInset) { Resources systemRes = context.getResources(); int statusBarHeight = getDimenByName(systemRes, isPortrait ? STATUS_BAR_HEIGHT_PORTRAIT : STATUS_BAR_HEIGHT_LANDSCAPE, STATUS_BAR_HEIGHT); return Math.max(statusBarInset, statusBarHeight); } /** * Returns a list of possible WindowBounds for the display keyed on the 4 surface rotations */ Loading @@ -212,6 +219,9 @@ public class WindowManagerProxy implements ResourceBasedOverride { boolean isTabletOrGesture = isTablet || (Utilities.ATLEAST_R && isGestureNav(context)); // Use the status bar height resources because current system API to get the status bar // height doesn't allow to do this for an arbitrary display, it returns value only // for the current active display (see com.android.internal.policy.StatusBarUtils) int statusBarHeightPortrait = getDimenByName(systemRes, STATUS_BAR_HEIGHT_PORTRAIT, STATUS_BAR_HEIGHT); int statusBarHeightLandscape = getDimenByName(systemRes, Loading Loading
quickstep/src/com/android/quickstep/util/SystemWindowManagerProxy.java +8 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.view.Surface; import android.view.WindowManager; import android.view.WindowMetrics; import com.android.internal.policy.SystemBarUtils; import com.android.launcher3.util.WindowBounds; import com.android.launcher3.util.window.CachedDisplayInfo; import com.android.launcher3.util.window.WindowManagerProxy; Loading @@ -44,6 +45,13 @@ public class SystemWindowManagerProxy extends WindowManagerProxy { .getRotation(); } @Override protected int getStatusBarHeight(Context context, boolean isPortrait, int statusBarInset) { // See b/264656380, calculate the status bar height manually as the inset in the system // server might not be updated by this point yet causing extra DeviceProfile updates return SystemBarUtils.getStatusBarHeight(context); } @Override public ArrayMap<CachedDisplayInfo, WindowBounds[]> estimateInternalDisplayBounds( Context displayInfoContext) { Loading
src/com/android/launcher3/util/window/WindowManagerProxy.java +14 −4 Original line number Diff line number Diff line Loading @@ -161,12 +161,10 @@ public class WindowManagerProxy implements ResourceBasedOverride { insetsBuilder.setInsetsIgnoringVisibility(WindowInsets.Type.navigationBars(), newNavInsets); Insets statusBarInsets = oldInsets.getInsets(WindowInsets.Type.statusBars()); int statusBarHeight = getDimenByName(systemRes, (isPortrait) ? STATUS_BAR_HEIGHT_PORTRAIT : STATUS_BAR_HEIGHT_LANDSCAPE, STATUS_BAR_HEIGHT); Insets newStatusBarInsets = Insets.of( statusBarInsets.left, Math.max(statusBarInsets.top, statusBarHeight), getStatusBarHeight(context, isPortrait, statusBarInsets.top), statusBarInsets.right, statusBarInsets.bottom); insetsBuilder.setInsets(WindowInsets.Type.statusBars(), newStatusBarInsets); Loading @@ -190,6 +188,15 @@ public class WindowManagerProxy implements ResourceBasedOverride { return result; } protected int getStatusBarHeight(Context context, boolean isPortrait, int statusBarInset) { Resources systemRes = context.getResources(); int statusBarHeight = getDimenByName(systemRes, isPortrait ? STATUS_BAR_HEIGHT_PORTRAIT : STATUS_BAR_HEIGHT_LANDSCAPE, STATUS_BAR_HEIGHT); return Math.max(statusBarInset, statusBarHeight); } /** * Returns a list of possible WindowBounds for the display keyed on the 4 surface rotations */ Loading @@ -212,6 +219,9 @@ public class WindowManagerProxy implements ResourceBasedOverride { boolean isTabletOrGesture = isTablet || (Utilities.ATLEAST_R && isGestureNav(context)); // Use the status bar height resources because current system API to get the status bar // height doesn't allow to do this for an arbitrary display, it returns value only // for the current active display (see com.android.internal.policy.StatusBarUtils) int statusBarHeightPortrait = getDimenByName(systemRes, STATUS_BAR_HEIGHT_PORTRAIT, STATUS_BAR_HEIGHT); int statusBarHeightLandscape = getDimenByName(systemRes, Loading