Fix sim-eng build and simplify previous lcd-density related patch

This commit is contained in:
David 'Digit' Turner
2009-06-19 04:41:12 +02:00
parent 5502f04c1d
commit 3c08a446c5

View File

@@ -189,16 +189,13 @@ void DisplayHardware::init(uint32_t dpy)
char property[PROPERTY_VALUE_MAX];
if (property_get("ro.sf.lcd_density", property, NULL) <= 0) {
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);
/* Read density from build-specific ro.sf.lcd_density property
* except if it is overriden by qemu.sf.lcd_density.
*/
if (property_get("qemu.sf.lcd_density", property, NULL) <= 0) {
if (property_get("ro.sf.lcd_density", property, NULL) <= 0) {
LOGW("ro.sf.lcd_density not defined, using 160 dpi by default.");
strcpy(property, "160");
}
}
mDensity = atoi(property) * (1.0f/160.0f);