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

Commit 31469e10 authored by David 'Digit' Turner's avatar David 'Digit' Turner
Browse files

Reset the mDpiX and mDpiY values when qemu.sf.lcd_density is defined.

This will make android.view.Display return corresponding values for
the screen's DPI.
parent dccff969
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -197,6 +197,9 @@ void DisplayHardware::init(uint32_t dpy)
            LOGW("ro.sf.lcd_density not defined, using 160 dpi by default.");
            strcpy(property, "160");
        }
    } else {
        /* for the emulator case, reset the dpi values too */
        mDpiX = mDpiY = atoi(property);
    }
    mDensity = atoi(property) * (1.0f/160.0f);