summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2009-06-18 04:30:32 +0200
committerDavid 'Digit' Turner <digit@google.com>2009-06-19 00:17:31 +0200
commit2a578ae518ff3d8a2d4768b3d190e4702509e82c (patch)
tree9275c473a3caee6f985a9abd2d7b33ff54c21b40 /libs
parent4ebd855bb7362d45833dc811f2622fcc788dec17 (diff)
downloadframeworks_base-2a578ae518ff3d8a2d4768b3d190e4702509e82c.zip
frameworks_base-2a578ae518ff3d8a2d4768b3d190e4702509e82c.tar.gz
frameworks_base-2a578ae518ff3d8a2d4768b3d190e4702509e82c.tar.bz2
Allow the qemu.sf.lcd_density property to override the value of ro.sf.lcd_density
ro.sf.lcd_density is usually defined in the build.prop file which is parsed by init before anything else. Since its name begins with "ro.", this property is write-once and cannot later be modified, e.g. in /system/etc/init.goldfish.sh. In other words, you cannot use "emulator -prop ro.sf.lcd_density=<value>", since it is impossible to override the value defined in build.prop This patch modifies the system to recognize "qemu.sf.lcd_density" as an override value, which can be set with "emulator -prop qemu.sf.lcd_density=<value>", forcing a specific density. A later patch will allow the emulator to automatically set this property depending on AVD hardware configuration settings.
Diffstat (limited to 'libs')
-rw-r--r--libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp b/libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp
index f14d7e9..971189f 100644
--- a/libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp
+++ b/libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp
@@ -193,6 +193,14 @@ void DisplayHardware::init(uint32_t dpy)
LOGW("ro.sf.lcd_density not defined, using 160 dpi by default.");
strcpy(property, "160");
}
+
+ /* Override the property value if qemu.sf.lcd_density is defined. */
+ {
+ char qemu_property[PROPERTY_VALUE_MAX];
+ if (property_get("qemu.sf.lcd_density", qemu_property, NULL) > 0) {
+ strlcpy(property, qemu_property, sizeof property);
+ }
+ }
mDensity = atoi(property) * (1.0f/160.0f);