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

Commit 975ce0ec authored by Sunny Shao's avatar Sunny Shao
Browse files

Fix the display problem of the cutout

- Add the WindowInsetsCompat.Type.displayCutout.

Fixes: 332514800
Test: atest com.android.settings.UtilsTest SettingsActivityTest
Change-Id: Ieb4ffb5a18c0babe3dd1c6f3482e8585899237f0
parent 36a00809
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1409,7 +1409,8 @@ public final class Utils extends com.android.settingslib.Utils {
        ViewCompat.setOnApplyWindowInsetsListener(activity.findViewById(android.R.id.content),
                (v, windowInsets) -> {
                    Insets insets = windowInsets.getInsets(
                            WindowInsetsCompat.Type.systemBars() | WindowInsetsCompat.Type.ime());
                            WindowInsetsCompat.Type.systemBars() | WindowInsetsCompat.Type.ime()
                                    | WindowInsetsCompat.Type.displayCutout());
                    int statusBarHeight = activity.getWindow().getDecorView().getRootWindowInsets()
                            .getInsets(WindowInsetsCompat.Type.statusBars()).top;
                    // Apply the insets paddings to the view.