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

Commit 2b40a048 authored by Chris Göllner's avatar Chris Göllner Committed by Chris Göllner
Browse files

Fix cropping of status bar elements on connected displays

On some devices with cutouts, we use
`status_bar_bottom_aligned_margin_rotation` to have some custom
alignment of the status bar.

This value is ignored for displays that don't have a cutout.
The problem was that SysUICutoutProvider was injecting the default
Context, instead of a @DisplayAware Context.
The default Context was returning a cutout, which is wrong for the
external display.

Test: Connect a virtual display to Comet while unfolded
Fixes: 438425468
Fixes: 438430670
Flag: EXEMPT Dagger only change
Change-Id: Id5a63e17392c2da099538238e2d50c8a2b6c87e2
parent 2a9c700e
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.graphics.Rect
import android.util.RotationUtils
import android.view.Display
import android.view.DisplayCutout
import com.android.systemui.display.dagger.SystemUIDisplaySubcomponent.DisplayAware
import com.android.systemui.display.dagger.SystemUIDisplaySubcomponent.PerDisplaySingleton
import com.android.systemui.display.naturalBounds
import javax.inject.Inject
@@ -40,8 +41,8 @@ interface SysUICutoutProvider {
class SysUICutoutProviderImpl
@Inject
constructor(
    private val context: Context,
    private val cameraProtectionLoader: CameraProtectionLoader,
    @DisplayAware private val context: Context,
    @DisplayAware private val cameraProtectionLoader: CameraProtectionLoader,
) : SysUICutoutProvider {

    private val cameraProtectionList by lazy {