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

Unverified Commit f4c7fb85 authored by LuK1337's avatar LuK1337 Committed by Michael Bestas
Browse files

SystemUI: Make isLargeScreen() use correct API for getting window metrics

getCurrentWindowMetrics() will return invalid size in case current
window is half size, e.g. in Settings.

Change-Id: I958d5a4532fec47b137f180fe1e18bd9e1f06b92
parent 3233111e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -139,7 +139,7 @@ public class Utilities {
    @TargetApi(Build.VERSION_CODES.R)
    public static boolean isLargeScreen(Context context) {
        final WindowManager windowManager = context.getSystemService(WindowManager.class);
        final Rect bounds = windowManager.getCurrentWindowMetrics().getBounds();
        final Rect bounds = windowManager.getMaximumWindowMetrics().getBounds();

        float smallestWidth = dpiFromPx(Math.min(bounds.width(), bounds.height()),
                context.getResources().getConfiguration().densityDpi);