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

Commit 57568938 authored by Hernan Liatis's avatar Hernan Liatis
Browse files

Add ability to use float densities.

Bug: b/112703496
Change-Id: Ie664db0d860e580b201fa083bda548df7d5f63fc
parent 3db42346
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -777,18 +777,18 @@ status_t SurfaceFlinger::getDisplayConfigs(const sp<IBinder>& displayToken,

    // TODO: Not sure if display density should handled by SF any longer
    class Density {
        static int getDensityFromProperty(char const* propName) {
        static float getDensityFromProperty(char const* propName) {
            char property[PROPERTY_VALUE_MAX];
            int density = 0;
            float density = 0.0f;
            if (property_get(propName, property, nullptr) > 0) {
                density = atoi(property);
                density = strtof(property, nullptr);
            }
            return density;
        }
    public:
        static int getEmuDensity() {
        static float getEmuDensity() {
            return getDensityFromProperty("qemu.sf.lcd_density"); }
        static int getBuildDensity()  {
        static float getBuildDensity()  {
            return getDensityFromProperty("ro.sf.lcd_density"); }
    };