From 7f1cdf94a0134d733a6e499298d8ade03137895e Mon Sep 17 00:00:00 2001 From: Simon Fels Date: Thu, 16 Aug 2018 07:45:24 +0200 Subject: [PATCH 01/12] container: bring back support for lxc 2.x under a feature flag Some of our users (Ubports) are still using an older version of liblxc (2.x as in Ubuntu 16.04) and we still want to support them. Support for LXC 2.x is now available again and auto detected at configuration time. --- CMakeLists.txt | 6 ++ src/anbox/container/lxc_container.cpp | 84 ++++++++++++++++++--------- 2 files changed, 64 insertions(+), 26 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c1a98c5..cf25449 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,6 +69,12 @@ pkg_check_modules(DBUS dbus-1 REQUIRED) pkg_check_modules(LXC lxc REQUIRED) pkg_check_modules(PROPERTIES_CPP properties-cpp REQUIRED) +message(STATUS "LXC version: ${LXC_VERSION}") +if (${LXC_VERSION} VERSION_LESS 3.0) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DENABLE_LXC2_SUPPORT") + message(STATUS "Building with LXC 2.x compatibility support") +endif() + option(ANBOX_ENABLE_WAYLAND "Enable wayland support" ON) if (ANBOX_ENABLE_WAYLAND) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWAYLAND_SUPPORT") diff --git a/src/anbox/container/lxc_container.cpp b/src/anbox/container/lxc_container.cpp index ca83141..e3be6c1 100644 --- a/src/anbox/container/lxc_container.cpp +++ b/src/anbox/container/lxc_container.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -45,7 +46,36 @@ constexpr const char *default_container_ip_address{"192.168.250.2"}; constexpr const std::uint32_t default_container_ip_prefix_length{24}; constexpr const char *default_host_ip_address{"192.168.250.1"}; constexpr const char *default_dns_server{"8.8.8.8"}; -constexpr const char *default_console_buffer_size{"256KB"}; + +#ifdef ENABLE_LXC2_SUPPORT +constexpr const char *lxc_config_idmap_key{"lxc.id_map"}; +constexpr const char *lxc_config_net_type_key{"lxc.network.type"}; +constexpr const char *lxc_config_net_flags_key{"lxc.network.flags"}; +constexpr const char *lxc_config_net_link_key{"lxc.network.link"}; +constexpr const char *lxc_config_pty_max_key{"lxc.pts"}; +constexpr const char *lxc_config_tty_max_key{"lxc.tty"}; +constexpr const char *lxc_config_uts_name_key{"lxc.utsname"}; +constexpr const char *lxc_config_tty_dir_key{"lxc.devttydir"}; +constexpr const char *lxc_config_init_cmd_key{"lxc.init_cmd"}; +constexpr const char *lxc_config_rootfs_path_key{"lxc.rootfs"}; +constexpr const char *lxc_config_log_level_key{"lxc.loglevel"}; +constexpr const char *lxc_config_log_file_key{"lxc.logfile"}; +constexpr const char *lxc_config_apparmor_profile_key{"lxc.aa_profile"}; +#else +constexpr const char *lxc_config_idmap_key{"lxc.idmap"}; +constexpr const char *lxc_config_net_type_key{"lxc.net.0.type"}; +constexpr const char *lxc_config_net_flags_key{"lxc.net.0.flags"}; +constexpr const char *lxc_config_net_link_key{"lxc.net.0.link"}; +constexpr const char *lxc_config_pty_max_key{"lxc.pty.max"}; +constexpr const char *lxc_config_tty_max_key{"lxc.tty.max"}; +constexpr const char *lxc_config_uts_name_key{"lxc.uts.name"}; +constexpr const char *lxc_config_tty_dir_key{"lxc.tty.dir"}; +constexpr const char *lxc_config_init_cmd_key{"lxc.init.cmd"}; +constexpr const char *lxc_config_rootfs_path_key{"lxc.rootfs.path"}; +constexpr const char *lxc_config_log_level_key{"lxc.log.level"}; +constexpr const char *lxc_config_log_file_key{"lxc.log.file"}; +constexpr const char *lxc_config_apparmor_profile_key{"lxc.apparmor.profile"}; +#endif constexpr int device_major(__dev_t dev) { return int(((dev >> 8) & 0xfff) | ((dev >> 32) & (0xfffff000))); @@ -80,19 +110,19 @@ void LxcContainer::setup_id_map() { const auto base_id = unprivileged_uid; const auto max_id = 65536; - set_config_item("lxc.idmap", utils::string_format("u 0 %d %d", base_id, android_system_uid - 1)); - set_config_item("lxc.idmap", utils::string_format("g 0 %d %d", base_id, android_system_uid - 1)); + set_config_item(lxc_config_idmap_key, utils::string_format("u 0 %d %d", base_id, android_system_uid - 1)); + set_config_item(lxc_config_idmap_key, utils::string_format("g 0 %d %d", base_id, android_system_uid - 1)); // We need to bind the user id for the one running the client side // process as he is the owner of various socket files we bind mount // into the container. - set_config_item("lxc.idmap", utils::string_format("u %d %d 1", android_system_uid, creds_.uid())); - set_config_item("lxc.idmap", utils::string_format("g %d %d 1", android_system_uid, creds_.gid())); + set_config_item(lxc_config_idmap_key, utils::string_format("u %d %d 1", android_system_uid, creds_.uid())); + set_config_item(lxc_config_idmap_key, utils::string_format("g %d %d 1", android_system_uid, creds_.gid())); - set_config_item("lxc.idmap", utils::string_format("u %d %d %d", android_system_uid + 1, + set_config_item(lxc_config_idmap_key, utils::string_format("u %d %d %d", android_system_uid + 1, base_id + android_system_uid + 1, max_id - creds_.uid() - 1)); - set_config_item("lxc.idmap", utils::string_format("g %d %d %d", android_system_uid + 1, + set_config_item(lxc_config_idmap_key, utils::string_format("g %d %d %d", android_system_uid + 1, base_id + android_system_uid + 1, max_id - creds_.gid() - 1)); } @@ -103,9 +133,9 @@ void LxcContainer::setup_network() { return; } - set_config_item("lxc.net.0.type", "veth"); - set_config_item("lxc.net.0.flags", "up"); - set_config_item("lxc.net.0.link", "anbox0"); + set_config_item(lxc_config_net_type_key, "veth"); + set_config_item(lxc_config_net_flags_key, "up"); + set_config_item(lxc_config_net_link_key, "anbox0"); // Instead of relying on DHCP we will give Android a static IP configuration // for the virtual ethernet interface LXC creates for us. This will be bridged @@ -251,22 +281,21 @@ void LxcContainer::start(const Configuration &configuration) { set_config_item("lxc.mount.auto", "proc:mixed sys:mixed cgroup:mixed"); set_config_item("lxc.autodev", "1"); - set_config_item("lxc.pty.max", "1024"); - set_config_item("lxc.tty.max", "0"); - set_config_item("lxc.uts.name", "anbox"); + set_config_item(lxc_config_pty_max_key, "1024"); + set_config_item(lxc_config_tty_max_key, "0"); + set_config_item(lxc_config_uts_name_key, "anbox"); set_config_item("lxc.group.devices.deny", ""); set_config_item("lxc.group.devices.allow", ""); // We can't move bind-mounts, so don't use /dev/lxc/ - set_config_item("lxc.tty.dir", ""); + set_config_item(lxc_config_tty_dir_key, ""); - set_config_item("lxc.environment", - "PATH=/system/bin:/system/sbin:/system/xbin"); + set_config_item("lxc.environment", "PATH=/system/bin:/system/sbin:/system/xbin"); - set_config_item("lxc.init.cmd", "/anbox-init.sh"); + set_config_item(lxc_config_init_cmd_key, "/anbox-init.sh"); -#if ENABLE_SNAP_CONFINEMENT +#ifdef ENABLE_SNAP_CONFINEMENT // If we're running inside the snap environment snap-confine already created a // cgroup for us we need to use as otherwise presevering a namespace wont help. if (utils::is_env_set("SNAP")) @@ -278,25 +307,28 @@ void LxcContainer::start(const Configuration &configuration) { rootfs_path = SystemConfiguration::instance().combined_rootfs_dir(); DEBUG("Using rootfs path %s", rootfs_path); - set_config_item("lxc.rootfs.path", rootfs_path); + set_config_item(lxc_config_rootfs_path_key, rootfs_path); - set_config_item("lxc.log.level", "0"); + set_config_item(lxc_config_log_level_key, "0"); const auto log_path = SystemConfiguration::instance().log_dir(); - set_config_item("lxc.log.file", utils::string_format("%s/container.log", log_path).c_str()); + set_config_item(lxc_config_log_file_key, utils::string_format("%s/container.log", log_path).c_str()); + +#ifndef ENABLE_LXC2_SUPPORT + // Dump the console output to disk to have a chance to debug early boot problems + set_config_item("lxc.console.logfile", utils::string_format("%s/console.log", log_path).c_str()); + set_config_item("lxc.console.rotate", "1"); +#endif - // Dump the console output to disk to have a chance to debug early boot problems - set_config_item("lxc.console.logfile", utils::string_format("%s/console.log", log_path).c_str()); - set_config_item("lxc.console.rotate", "1"); setup_network(); -#if ENABLE_SNAP_CONFINEMENT +#ifdef ENABLE_SNAP_CONFINEMENT // We take the AppArmor profile snapd has defined for us as part of the // anbox-support interface. The container manager itself runs within a // child profile snap.anbox.container-manager//lxc too. set_config_item("lxc.apparmor.profile", "snap.anbox.container-manager//container"); #else - set_config_item("lxc.apparmor.profile", "unconfined"); + set_config_item(lxc_config_apparmor_profile_key, "unconfined"); #endif if (!privileged_) From 202241a1c41ccf540dc1909d8451b63eca65e808 Mon Sep 17 00:00:00 2001 From: nvschilleman <32854433+nvschilleman@users.noreply.github.com> Date: Sat, 8 Sep 2018 00:38:39 +0200 Subject: [PATCH 02/12] Update check_features.cpp --- src/anbox/cmds/check_features.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/anbox/cmds/check_features.cpp b/src/anbox/cmds/check_features.cpp index 309d59f..d045897 100644 --- a/src/anbox/cmds/check_features.cpp +++ b/src/anbox/cmds/check_features.cpp @@ -36,6 +36,9 @@ std::vector cpu_whitelist = { "M 460", // Intel Celeron N2840 "N2840", + // Intel Pentium T4500 + "T4500", + }; } // namespace From aceed15472f1ca5b4a2e62ff8d8fea4160cb0762 Mon Sep 17 00:00:00 2001 From: Pal Lockheart Date: Sat, 8 Sep 2018 20:35:54 +0800 Subject: [PATCH 03/12] Update check_features.cpp - Added override for Core i7-720QM --- src/anbox/cmds/check_features.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/anbox/cmds/check_features.cpp b/src/anbox/cmds/check_features.cpp index 309d59f..5d9ea6e 100644 --- a/src/anbox/cmds/check_features.cpp +++ b/src/anbox/cmds/check_features.cpp @@ -36,6 +36,8 @@ std::vector cpu_whitelist = { "M 460", // Intel Celeron N2840 "N2840", + // Intel Core i7 Q720 + "Q 720", }; } // namespace From 2d76da96050b3ac80e889202c637ab963c098891 Mon Sep 17 00:00:00 2001 From: nvschilleman <32854433+nvschilleman@users.noreply.github.com> Date: Sun, 9 Sep 2018 12:58:57 +0200 Subject: [PATCH 04/12] Update check_features.cpp --- src/anbox/cmds/check_features.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/anbox/cmds/check_features.cpp b/src/anbox/cmds/check_features.cpp index d045897..17d7ed9 100644 --- a/src/anbox/cmds/check_features.cpp +++ b/src/anbox/cmds/check_features.cpp @@ -37,8 +37,7 @@ std::vector cpu_whitelist = { // Intel Celeron N2840 "N2840", // Intel Pentium T4500 - "T4500", - + "T4500", }; } // namespace From 25c44527b1954801c0fac181fcb74a621996ced1 Mon Sep 17 00:00:00 2001 From: Marius Gripsgard Date: Sun, 9 Sep 2018 21:09:43 +0200 Subject: [PATCH 05/12] Add option to disable sdl window hit test with envar value --- src/anbox/platform/sdl/window.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/anbox/platform/sdl/window.cpp b/src/anbox/platform/sdl/window.cpp index a5806a9..752b13c 100644 --- a/src/anbox/platform/sdl/window.cpp +++ b/src/anbox/platform/sdl/window.cpp @@ -72,8 +72,9 @@ Window::Window(const std::shared_ptr &renderer, BOOST_THROW_EXCEPTION(std::runtime_error(message)); } - if (SDL_SetWindowHitTest(window_, &Window::on_window_hit, this) < 0) - BOOST_THROW_EXCEPTION(std::runtime_error("Failed to register for window hit test")); + if (utils::get_env_value("ANBOX_NO_SDL_WINDOW_HIT_TEST", "false") == "false") + if (SDL_SetWindowHitTest(window_, &Window::on_window_hit, this) < 0) + BOOST_THROW_EXCEPTION(std::runtime_error("Failed to register for window hit test")); SDL_SysWMinfo info; SDL_VERSION(&info.version); From 85107c46adf278915772ee8a2c14d91fa23a4729 Mon Sep 17 00:00:00 2001 From: fatihbalsoy Date: Mon, 10 Sep 2018 19:16:35 -0500 Subject: [PATCH 06/12] Update check_features.cpp - Added override for Core i7-720QM and Xeon E5520 I also get the same SSE error on a virtual machine with an Intel Xeon Processor: The CPU of your computer (Intel(R) Xeon(R) CPU E5520 @ 2.27GHz) does not support all features Anbox requires. It is missing support for the following features: SSE 4.1, SSE 4.2, SSSE 3 but checking /proc/cpuinfo reveals that it supports the features: ... model name : Intel(R) Xeon(R) CPU E5520 @ 2.27GHz ... flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid pni ssse3 sse4_1 sse4_2 x2apic hypervisor lahf_lm pti I hope adding the following code into the array in check_features.cpp could fix the problem: // Intel Xeon Processor E5520 "E5520" --- src/anbox/cmds/check_features.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/anbox/cmds/check_features.cpp b/src/anbox/cmds/check_features.cpp index d6c06d8..c5df3bc 100644 --- a/src/anbox/cmds/check_features.cpp +++ b/src/anbox/cmds/check_features.cpp @@ -38,6 +38,10 @@ std::vector cpu_whitelist = { "N2840", // Intel Pentium T4500 "T4500", + // Intel Core i7 Q720 + "Q 720", + // Intel Xeon E5520 + "E5520" }; } // namespace From 54bbd82120e42efdbb47d8b7a0a052fe8159c7b3 Mon Sep 17 00:00:00 2001 From: fatihbalsoy Date: Mon, 10 Sep 2018 19:50:10 -0500 Subject: [PATCH 07/12] Removed i7 from pull request, already exists. --- src/anbox/cmds/check_features.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/anbox/cmds/check_features.cpp b/src/anbox/cmds/check_features.cpp index c5df3bc..71490d4 100644 --- a/src/anbox/cmds/check_features.cpp +++ b/src/anbox/cmds/check_features.cpp @@ -38,8 +38,6 @@ std::vector cpu_whitelist = { "N2840", // Intel Pentium T4500 "T4500", - // Intel Core i7 Q720 - "Q 720", // Intel Xeon E5520 "E5520" }; From 40f190c5e2257d01c891f15c332b5ec4b9c7bd80 Mon Sep 17 00:00:00 2001 From: fatihbalsoy Date: Mon, 10 Sep 2018 20:01:47 -0500 Subject: [PATCH 08/12] Added back i7 Q720 to prevent merge conflicts. --- src/anbox/cmds/check_features.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/anbox/cmds/check_features.cpp b/src/anbox/cmds/check_features.cpp index 71490d4..c5df3bc 100644 --- a/src/anbox/cmds/check_features.cpp +++ b/src/anbox/cmds/check_features.cpp @@ -38,6 +38,8 @@ std::vector cpu_whitelist = { "N2840", // Intel Pentium T4500 "T4500", + // Intel Core i7 Q720 + "Q 720", // Intel Xeon E5520 "E5520" }; From ae8cefb77028ea3f4f3e8aeb5abf722cae6dca87 Mon Sep 17 00:00:00 2001 From: Simon Fels Date: Tue, 11 Sep 2018 19:40:56 +0200 Subject: [PATCH 09/12] cmds: implement CPU feature sanity check via builtin compiler functions To prevent our whilelist from growing much more we know do an additional sanity check via compiler builtin functions if we cannot detect all mandatory CPU features via the cpu_features libray and if the CPU isn't whitelisted. This should cover more or less all remaining cases unless the compiler is unable to detect the features properly. --- src/anbox/cmds/check_features.cpp | 33 +++++++++++++++++++++++++++++-- src/anbox/cmds/check_features.h | 3 +++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/anbox/cmds/check_features.cpp b/src/anbox/cmds/check_features.cpp index a1e1943..4b6f448 100644 --- a/src/anbox/cmds/check_features.cpp +++ b/src/anbox/cmds/check_features.cpp @@ -52,7 +52,7 @@ anbox::cmds::CheckFeatures::CheckFeatures() cli::Name{"check-features"}, cli::Usage{"check-features"}, cli::Description{"Check that the host system supports all necessary features"}} { - action([](const cli::Command::Context&) { + action([this](const cli::Command::Context&) { #if defined(CPU_FEATURES_ARCH_X86) const auto info = cpu_features::GetX86Info(); std::vector missing_features; @@ -78,7 +78,7 @@ anbox::cmds::CheckFeatures::CheckFeatures() } } - if (missing_features.size() > 0 && !is_whitelisted) { + if (missing_features.size() > 0 && !is_whitelisted && !sanity_check_for_features()) { std::cerr << "The CPU of your computer (" << brand_string << ") does not support all" << std::endl << "features Anbox requires." << std::endl << "It is missing support for the following features: "; @@ -105,3 +105,32 @@ anbox::cmds::CheckFeatures::CheckFeatures() #endif }); } + +// In case that the CPU supports AVX we take the decision as from our analysis +// of the output from the cpu_features library. If it does not we have to check +// further via the compiler builtins if we the CPU supports all mandatory features +// or not. In case that any is missing we will fail the test. +// +// This uses the compiler builtin function __builtin_cpu_supports which allows us +// to detect certain CPU features. +// See https://gcc.gnu.org/onlinedocs/gcc/x86-Built-in-Functions.html +bool anbox::cmds::CheckFeatures::sanity_check_for_features() { +#if defined(CPU_FEATURES_ARCH_X86) + if (__builtin_cpu_supports("avx")) + return true; + + std::vector missing_features; + +#define CHECK_FEATURE(name) \ + if (!__builtin_cpu_supports(name)) \ + missing_features.push_back(name); + + CHECK_FEATURE("sse4.1"); + CHECK_FEATURE("sse4.2"); + CHECK_FEATURE("ssse3"); + + return missing_features.empty(); +#else + return true; +#endif +} diff --git a/src/anbox/cmds/check_features.h b/src/anbox/cmds/check_features.h index e6c6ff7..8402ca6 100644 --- a/src/anbox/cmds/check_features.h +++ b/src/anbox/cmds/check_features.h @@ -29,6 +29,9 @@ namespace cmds { class CheckFeatures : public cli::CommandWithFlagsAndAction { public: CheckFeatures(); + + private: + bool sanity_check_for_features(); }; } // namespace cmds } // namespace anbox From 8d0faeb5d659203dea417c772b7468baff09e484 Mon Sep 17 00:00:00 2001 From: Marcel Partap Date: Thu, 13 Sep 2018 09:48:08 +0200 Subject: [PATCH 10/12] Moved the media codecs list to android/media/ as it also contains audio codecs. --- android/{camera => media}/media_codecs.xml | 0 android/{camera => media}/media_profiles.xml | 0 products/anbox.mk | 4 ++-- 3 files changed, 2 insertions(+), 2 deletions(-) rename android/{camera => media}/media_codecs.xml (100%) rename android/{camera => media}/media_profiles.xml (100%) diff --git a/android/camera/media_codecs.xml b/android/media/media_codecs.xml similarity index 100% rename from android/camera/media_codecs.xml rename to android/media/media_codecs.xml diff --git a/android/camera/media_profiles.xml b/android/media/media_profiles.xml similarity index 100% rename from android/camera/media_profiles.xml rename to android/media/media_profiles.xml diff --git a/products/anbox.mk b/products/anbox.mk index 73fd1a9..109634d 100644 --- a/products/anbox.mk +++ b/products/anbox.mk @@ -43,8 +43,8 @@ PRODUCT_COPY_FILES += \ vendor/anbox/android/init.goldfish.rc:root/init.goldfish.rc \ vendor/anbox/android/init.goldfish.sh:system/etc/init.goldfish.sh \ vendor/anbox/android/ueventd.goldfish.rc:root/ueventd.goldfish.rc \ - vendor/anbox/android/camera/media_profiles.xml:system/etc/media_profiles.xml \ - vendor/anbox/android/camera/media_codecs.xml:system/etc/media_codecs.xml \ + vendor/anbox/android/media/media_profiles.xml:system/etc/media_profiles.xml \ + vendor/anbox/android/media/media_codecs.xml:system/etc/media_codecs.xml \ hardware/libhardware_legacy/audio/audio_policy.conf:system/etc/audio_policy.conf PRODUCT_CHARACTERISTICS := emulator From c98fe4b3a23ad39597f7e6ad2b8da0ed217c609f Mon Sep 17 00:00:00 2001 From: Marcel Partap Date: Thu, 13 Sep 2018 10:02:38 +0200 Subject: [PATCH 11/12] Added missing media_codecs_google_*.xml from frameworks/av libstagefright (tree 6b14452cfef637b9b987c0a6a690bda7067afe49). Upstream location is https://android.googlesource.com/platform/frameworks/av/+/master/media/libstagefright/data --- android/media/media_codecs_google_audio.xml | 97 ++++++++++++++ .../media/media_codecs_google_telephony.xml | 25 ++++ android/media/media_codecs_google_video.xml | 122 ++++++++++++++++++ products/anbox.mk | 3 + 4 files changed, 247 insertions(+) create mode 100644 android/media/media_codecs_google_audio.xml create mode 100644 android/media/media_codecs_google_telephony.xml create mode 100644 android/media/media_codecs_google_video.xml diff --git a/android/media/media_codecs_google_audio.xml b/android/media/media_codecs_google_audio.xml new file mode 100644 index 0000000..632088a --- /dev/null +++ b/android/media/media_codecs_google_audio.xml @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/media/media_codecs_google_telephony.xml b/android/media/media_codecs_google_telephony.xml new file mode 100644 index 0000000..5ad90d9 --- /dev/null +++ b/android/media/media_codecs_google_telephony.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + diff --git a/android/media/media_codecs_google_video.xml b/android/media/media_codecs_google_video.xml new file mode 100644 index 0000000..829f403 --- /dev/null +++ b/android/media/media_codecs_google_video.xml @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/products/anbox.mk b/products/anbox.mk index 109634d..9a2d7c5 100644 --- a/products/anbox.mk +++ b/products/anbox.mk @@ -45,6 +45,9 @@ PRODUCT_COPY_FILES += \ vendor/anbox/android/ueventd.goldfish.rc:root/ueventd.goldfish.rc \ vendor/anbox/android/media/media_profiles.xml:system/etc/media_profiles.xml \ vendor/anbox/android/media/media_codecs.xml:system/etc/media_codecs.xml \ + vendor/anbox/android/media/media_codecs_google_audio.xml:system/etc/media_codecs_google_audio.xml \ + vendor/anbox/android/media/media_codecs_google_telephony.xml:system/etc/media_codecs_google_telephony.xml \ + vendor/anbox/android/media/media_codecs_google_video.xml:system/etc/media_codecs_google_video.xml \ hardware/libhardware_legacy/audio/audio_policy.conf:system/etc/audio_policy.conf PRODUCT_CHARACTERISTICS := emulator From 05cb1a608e6c690ca393858ab786d780a4d62a82 Mon Sep 17 00:00:00 2001 From: Marcel Partap Date: Thu, 13 Sep 2018 10:04:04 +0200 Subject: [PATCH 12/12] Also add mpeg2 support. (frameworks/av commit c83d228e85b187e3112f10003282c8270d18ef71 moved this from media_codecs_google_video.xml to new file media_codecs_google_tv.xml for reasons not given.) --- android/media/media_codecs.xml | 1 + android/media/media_codecs_google_tv.xml | 29 ++++++++++++++++++++++++ products/anbox.mk | 1 + 3 files changed, 31 insertions(+) create mode 100644 android/media/media_codecs_google_tv.xml diff --git a/android/media/media_codecs.xml b/android/media/media_codecs.xml index 87d11f2..ee846da 100644 --- a/android/media/media_codecs.xml +++ b/android/media/media_codecs.xml @@ -80,5 +80,6 @@ Only the three quirks included above are recognized at this point: + diff --git a/android/media/media_codecs_google_tv.xml b/android/media/media_codecs_google_tv.xml new file mode 100644 index 0000000..330c6fb --- /dev/null +++ b/android/media/media_codecs_google_tv.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + diff --git a/products/anbox.mk b/products/anbox.mk index 9a2d7c5..6ab2330 100644 --- a/products/anbox.mk +++ b/products/anbox.mk @@ -47,6 +47,7 @@ PRODUCT_COPY_FILES += \ vendor/anbox/android/media/media_codecs.xml:system/etc/media_codecs.xml \ vendor/anbox/android/media/media_codecs_google_audio.xml:system/etc/media_codecs_google_audio.xml \ vendor/anbox/android/media/media_codecs_google_telephony.xml:system/etc/media_codecs_google_telephony.xml \ + vendor/anbox/android/media/media_codecs_google_tv.xml:system/etc/media_codecs_google_tv.xml \ vendor/anbox/android/media/media_codecs_google_video.xml:system/etc/media_codecs_google_video.xml \ hardware/libhardware_legacy/audio/audio_policy.conf:system/etc/audio_policy.conf