diff --git a/src/anbox/graphics/density.h b/src/anbox/graphics/density.h new file mode 100644 index 0000000..5965321 --- /dev/null +++ b/src/anbox/graphics/density.h @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2016 Simon Fels + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 3, as published + * by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranties of + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + * + */ + +#ifndef ANBOX_GRAPHICS_DENSITY_H_ +#define ANBOX_GRAPHICS_DENSITY_H_ + +namespace anbox { +namespace graphics { +/** + * @brief Defines different types of density being used in an Android system. See the + * documentation in frameworks/base/core/java/android/util/DisplayMetrics.java + * of the Android source tree which defines the different types. + */ +enum class DensityType { + low = 120, + medium = 160, + tv = 213, + high = 240, + xhigh = 360, + xxhigh = 480, +}; +} // namespace graphics +} // namespace anbox + +#endif diff --git a/src/anbox/qemu/boot_properties_message_processor.cpp b/src/anbox/qemu/boot_properties_message_processor.cpp index d6390ff..27cf1b2 100644 --- a/src/anbox/qemu/boot_properties_message_processor.cpp +++ b/src/anbox/qemu/boot_properties_message_processor.cpp @@ -16,7 +16,8 @@ */ #include "anbox/qemu//boot_properties_message_processor.h" -#include "anbox/logger.h" +#include "anbox/graphics/density.h" +#include "anbox/utils.h" namespace anbox { namespace qemu { @@ -31,8 +32,6 @@ BootPropertiesMessageProcessor::~BootPropertiesMessageProcessor() { void BootPropertiesMessageProcessor::handle_command(const std::string &command) { if (command == "list") list_properties(); - else - DEBUG("Unknown command '%s'", command); } void BootPropertiesMessageProcessor::list_properties() { @@ -55,7 +54,7 @@ void BootPropertiesMessageProcessor::list_properties() { // TODO(morphis): Using HDPI here for now but should be adjusted to the device // we're running on. - "ro.sf.lcd_density=200", + utils::string_format("ro.sf.lcd_density=%d", static_cast(graphics::DensityType::high)), // libhwui detects that we support certain GLESv3 extensions which // we don't yet support in our host channel so we have to disable @@ -65,6 +64,10 @@ void BootPropertiesMessageProcessor::list_properties() { // This will give us a virtual on screen navigation area at the bottom // of the screen we really need to navigate through the system. "qemu.hw.mainkeys=0", + + // To let surfaceflinger load our hwcomposer implementation we specify + // the correct subkey of the module here. + // "ro.hardware.hwcomposer=anbox", }; for (const auto &prop : properties) {