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

Commit 569439c6 authored by Nicolo' Mazzucato's avatar Nicolo' Mazzucato
Browse files

Fix statusbar paddings related to rounded corners while on external display

The statusbar uses hardcoded padding values to handle rounded corner for each device. The default display values were being applied to the external display as well, resulting in too much left and right padding.

This prevents the usage of the default display rounded corner value for external displays.

Bug: 437082130
Test: StatusBarContentInsetsProviderTest
Flag: com.android.systemui.shared.status_bar_connected_displays
Change-Id: I719c91b35181a786c177fb11b01de576b70196c2
parent 3d7bd542
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -332,7 +332,17 @@ constructor(
        val currentRotation = getExactRotation(context)

        val roundedCornerPadding =
            if (context.displayId == DEFAULT_DISPLAY || !StatusBarConnectedDisplays.isEnabled) {
                rotatedResources.getDimensionPixelSize(R.dimen.rounded_corner_content_padding)
            } else {
                // Currently the padding is hardcoded for each device default display, and there is
                // no mapping between the rounded corner radius (that you could get from
                // Display#getRoundedCorner) and a padding value. The proper way of doing this is
                // using safe insets, that take this into account already.
                // For now, as external displays with corner radius are extremely uncommon, we're
                // just returning zero.
                0
            }
        val minDotPadding =
            if (isPrivacyDotEnabled)
                rotatedResources.getDimensionPixelSize(R.dimen.ongoing_appops_dot_min_padding)