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

Unverified Commit b3426e6c 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 36e9bcd8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -144,7 +144,7 @@ public class Utilities {

    /** @return whether or not {@param context} represents that of a large screen device or not */
    public static boolean isLargeScreen(WindowManager windowManager, Resources resources) {
        final Rect bounds = windowManager.getCurrentWindowMetrics().getBounds();
        final Rect bounds = windowManager.getMaximumWindowMetrics().getBounds();

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