Loading cmds/installd/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ cc_defaults { "libprocessgroup", "libselinux", "libutils", "libziparchive", "server_configurable_flags", ], static_libs: [ Loading Loading @@ -267,6 +268,7 @@ cc_binary { "libprocessgroup", "libselinux", "libutils", "libziparchive", "server_configurable_flags", ], } Loading cmds/installd/dexopt.cpp +16 −1 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ #include <server_configurable_flags/get_flags.h> #include <system/thread_defs.h> #include <utils/Mutex.h> #include <ziparchive/zip_archive.h> #include "dexopt.h" #include "dexopt_return_codes.h" Loading Loading @@ -2738,6 +2739,20 @@ bool create_profile_snapshot(int32_t app_id, const std::string& package_name, } } static bool check_profile_exists_in_dexmetadata(const std::string& dex_metadata) { ZipArchiveHandle zip = nullptr; if (OpenArchive(dex_metadata.c_str(), &zip) != 0) { PLOG(ERROR) << "Failed to open dm '" << dex_metadata << "'"; return false; } ZipEntry64 entry; int result = FindEntry(zip, "primary.prof", &entry); CloseArchive(zip); return result != 0 ? false : true; } bool prepare_app_profile(const std::string& package_name, userid_t user_id, appid_t app_id, Loading @@ -2754,7 +2769,7 @@ bool prepare_app_profile(const std::string& package_name, } // Check if we need to install the profile from the dex metadata. if (!dex_metadata) { if (!dex_metadata || !check_profile_exists_in_dexmetadata(dex_metadata->c_str())) { return true; } Loading cmds/installd/tests/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ cc_test { "libasync_safe", "libdiskusage", "libinstalld", "libziparchive", "liblog", "liblogwrap", ], Loading Loading @@ -89,6 +90,7 @@ cc_test { "libasync_safe", "libdiskusage", "libinstalld", "libziparchive", "liblog", "liblogwrap", ], Loading Loading
cmds/installd/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ cc_defaults { "libprocessgroup", "libselinux", "libutils", "libziparchive", "server_configurable_flags", ], static_libs: [ Loading Loading @@ -267,6 +268,7 @@ cc_binary { "libprocessgroup", "libselinux", "libutils", "libziparchive", "server_configurable_flags", ], } Loading
cmds/installd/dexopt.cpp +16 −1 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ #include <server_configurable_flags/get_flags.h> #include <system/thread_defs.h> #include <utils/Mutex.h> #include <ziparchive/zip_archive.h> #include "dexopt.h" #include "dexopt_return_codes.h" Loading Loading @@ -2738,6 +2739,20 @@ bool create_profile_snapshot(int32_t app_id, const std::string& package_name, } } static bool check_profile_exists_in_dexmetadata(const std::string& dex_metadata) { ZipArchiveHandle zip = nullptr; if (OpenArchive(dex_metadata.c_str(), &zip) != 0) { PLOG(ERROR) << "Failed to open dm '" << dex_metadata << "'"; return false; } ZipEntry64 entry; int result = FindEntry(zip, "primary.prof", &entry); CloseArchive(zip); return result != 0 ? false : true; } bool prepare_app_profile(const std::string& package_name, userid_t user_id, appid_t app_id, Loading @@ -2754,7 +2769,7 @@ bool prepare_app_profile(const std::string& package_name, } // Check if we need to install the profile from the dex metadata. if (!dex_metadata) { if (!dex_metadata || !check_profile_exists_in_dexmetadata(dex_metadata->c_str())) { return true; } Loading
cmds/installd/tests/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ cc_test { "libasync_safe", "libdiskusage", "libinstalld", "libziparchive", "liblog", "liblogwrap", ], Loading Loading @@ -89,6 +90,7 @@ cc_test { "libasync_safe", "libdiskusage", "libinstalld", "libziparchive", "liblog", "liblogwrap", ], Loading