Loading cmds/installd/InstalldNativeService.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -1894,7 +1894,7 @@ binder::Status InstalldNativeService::dexopt(const std::string& apkPath, int32_t int32_t dexoptNeeded, const std::unique_ptr<std::string>& outputPath, int32_t dexFlags, const std::string& compilerFilter, const std::unique_ptr<std::string>& uuid, const std::unique_ptr<std::string>& classLoaderContext, const std::unique_ptr<std::string>& seInfo, bool downgrade) { const std::unique_ptr<std::string>& seInfo, bool downgrade, int32_t targetSdkVersion) { ENFORCE_UID(AID_SYSTEM); CHECK_ARGUMENT_UUID(uuid); if (packageName && *packageName != "*") { Loading @@ -1912,7 +1912,7 @@ binder::Status InstalldNativeService::dexopt(const std::string& apkPath, int32_t const char* se_info = seInfo ? seInfo->c_str() : nullptr; int res = android::installd::dexopt(apk_path, uid, pkgname, instruction_set, dexoptNeeded, oat_dir, dexFlags, compiler_filter, volume_uuid, class_loader_context, se_info, downgrade); downgrade, targetSdkVersion); return res ? error(res, "Failed to dexopt") : ok(); } Loading cmds/installd/InstalldNativeService.h +2 −1 Original line number Diff line number Diff line Loading @@ -84,7 +84,8 @@ public: int32_t dexoptNeeded, const std::unique_ptr<std::string>& outputPath, int32_t dexFlags, const std::string& compilerFilter, const std::unique_ptr<std::string>& uuid, const std::unique_ptr<std::string>& classLoaderContext, const std::unique_ptr<std::string>& seInfo, bool downgrade); const std::unique_ptr<std::string>& seInfo, bool downgrade, int32_t targetSdkVersion); binder::Status rmdex(const std::string& codePath, const std::string& instructionSet); Loading cmds/installd/binder/android/os/IInstalld.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ interface IInstalld { @nullable @utf8InCpp String outputPath, int dexFlags, @utf8InCpp String compilerFilter, @nullable @utf8InCpp String uuid, @nullable @utf8InCpp String sharedLibraries, @nullable @utf8InCpp String seInfo, boolean downgrade); @nullable @utf8InCpp String seInfo, boolean downgrade, int targetSdkVersion); void rmdex(@utf8InCpp String codePath, @utf8InCpp String instructionSet); Loading cmds/installd/dexopt.cpp +12 −4 Original line number Diff line number Diff line Loading @@ -212,7 +212,7 @@ static void run_dex2oat(int zip_fd, int oat_fd, int input_vdex_fd, int output_vd const char* input_file_name, const char* output_file_name, int swap_fd, const char* instruction_set, const char* compiler_filter, bool debuggable, bool post_bootcomplete, bool background_job_compile, int profile_fd, const char* class_loader_context) { const char* class_loader_context, int target_sdk_version) { static const unsigned int MAX_INSTRUCTION_SET_LEN = 7; if (strlen(instruction_set) >= MAX_INSTRUCTION_SET_LEN) { Loading Loading @@ -323,6 +323,7 @@ static void run_dex2oat(int zip_fd, int oat_fd, int input_vdex_fd, int output_vd bool have_dex2oat_image_fd = false; char dex2oat_image_fd[arraysize("--app-image-fd=") + MAX_INT_LEN]; size_t class_loader_context_size = arraysize("--class-loader-context=") + PKG_PATH_MAX; char target_sdk_version_arg[arraysize("-Xtarget-sdk-version:") + MAX_INT_LEN]; char class_loader_context_arg[class_loader_context_size]; if (class_loader_context != nullptr) { snprintf(class_loader_context_arg, class_loader_context_size, "--class-loader-context=%s", Loading Loading @@ -353,6 +354,7 @@ static void run_dex2oat(int zip_fd, int oat_fd, int input_vdex_fd, int output_vd if (have_dex2oat_Xmx_flag) { sprintf(dex2oat_Xmx_arg, "-Xmx%s", dex2oat_Xmx_flag); } sprintf(target_sdk_version_arg, "-Xtarget-sdk-version:%d", target_sdk_version); // Compute compiler filter. Loading Loading @@ -435,7 +437,8 @@ static void run_dex2oat(int zip_fd, int oat_fd, int input_vdex_fd, int output_vd + (has_base_dir ? 1 : 0) + (have_dex2oat_large_app_threshold ? 1 : 0) + (disable_cdex ? 1 : 0) + (generate_minidebug_info ? 1 : 0)]; + (generate_minidebug_info ? 1 : 0) + (target_sdk_version != 0 ? 2 : 0)]; int i = 0; argv[i++] = dex2oat_bin; argv[i++] = zip_fd_arg; Loading Loading @@ -505,6 +508,10 @@ static void run_dex2oat(int zip_fd, int oat_fd, int input_vdex_fd, int output_vd if (disable_cdex) { argv[i++] = kDisableCompactDexFlag; } if (target_sdk_version != 0) { argv[i++] = RUNTIME_ARG; argv[i++] = target_sdk_version_arg; } // Do not add after dex2oat_flags, they should override others for debugging. argv[i] = NULL; Loading Loading @@ -1767,7 +1774,7 @@ static bool process_secondary_dex_dexopt(const std::string& dex_path, const char int dexopt(const char* dex_path, uid_t uid, const char* pkgname, const char* instruction_set, int dexopt_needed, const char* oat_dir, int dexopt_flags, const char* compiler_filter, const char* volume_uuid, const char* class_loader_context, const char* se_info, bool downgrade) { bool downgrade, int target_sdk_version) { CHECK(pkgname != nullptr); CHECK(pkgname[0] != 0); if ((dexopt_flags & ~DEXOPT_MASK) != 0) { Loading Loading @@ -1884,7 +1891,8 @@ int dexopt(const char* dex_path, uid_t uid, const char* pkgname, const char* ins boot_complete, background_job_compile, reference_profile_fd.get(), class_loader_context); class_loader_context, target_sdk_version); _exit(68); /* only get here on exec failure */ } else { int res = wait_child(pid); Loading cmds/installd/dexopt.h +1 −1 Original line number Diff line number Diff line Loading @@ -78,7 +78,7 @@ bool reconcile_secondary_dex_file(const std::string& dex_path, int dexopt(const char *apk_path, uid_t uid, const char *pkgName, const char *instruction_set, int dexopt_needed, const char* oat_dir, int dexopt_flags, const char* compiler_filter, const char* volume_uuid, const char* class_loader_context, const char* se_info, bool downgrade); bool downgrade, int target_sdk_version); bool calculate_oat_file_path_default(char path[PKG_PATH_MAX], const char *oat_dir, const char *apk_path, const char *instruction_set); Loading Loading
cmds/installd/InstalldNativeService.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -1894,7 +1894,7 @@ binder::Status InstalldNativeService::dexopt(const std::string& apkPath, int32_t int32_t dexoptNeeded, const std::unique_ptr<std::string>& outputPath, int32_t dexFlags, const std::string& compilerFilter, const std::unique_ptr<std::string>& uuid, const std::unique_ptr<std::string>& classLoaderContext, const std::unique_ptr<std::string>& seInfo, bool downgrade) { const std::unique_ptr<std::string>& seInfo, bool downgrade, int32_t targetSdkVersion) { ENFORCE_UID(AID_SYSTEM); CHECK_ARGUMENT_UUID(uuid); if (packageName && *packageName != "*") { Loading @@ -1912,7 +1912,7 @@ binder::Status InstalldNativeService::dexopt(const std::string& apkPath, int32_t const char* se_info = seInfo ? seInfo->c_str() : nullptr; int res = android::installd::dexopt(apk_path, uid, pkgname, instruction_set, dexoptNeeded, oat_dir, dexFlags, compiler_filter, volume_uuid, class_loader_context, se_info, downgrade); downgrade, targetSdkVersion); return res ? error(res, "Failed to dexopt") : ok(); } Loading
cmds/installd/InstalldNativeService.h +2 −1 Original line number Diff line number Diff line Loading @@ -84,7 +84,8 @@ public: int32_t dexoptNeeded, const std::unique_ptr<std::string>& outputPath, int32_t dexFlags, const std::string& compilerFilter, const std::unique_ptr<std::string>& uuid, const std::unique_ptr<std::string>& classLoaderContext, const std::unique_ptr<std::string>& seInfo, bool downgrade); const std::unique_ptr<std::string>& seInfo, bool downgrade, int32_t targetSdkVersion); binder::Status rmdex(const std::string& codePath, const std::string& instructionSet); Loading
cmds/installd/binder/android/os/IInstalld.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ interface IInstalld { @nullable @utf8InCpp String outputPath, int dexFlags, @utf8InCpp String compilerFilter, @nullable @utf8InCpp String uuid, @nullable @utf8InCpp String sharedLibraries, @nullable @utf8InCpp String seInfo, boolean downgrade); @nullable @utf8InCpp String seInfo, boolean downgrade, int targetSdkVersion); void rmdex(@utf8InCpp String codePath, @utf8InCpp String instructionSet); Loading
cmds/installd/dexopt.cpp +12 −4 Original line number Diff line number Diff line Loading @@ -212,7 +212,7 @@ static void run_dex2oat(int zip_fd, int oat_fd, int input_vdex_fd, int output_vd const char* input_file_name, const char* output_file_name, int swap_fd, const char* instruction_set, const char* compiler_filter, bool debuggable, bool post_bootcomplete, bool background_job_compile, int profile_fd, const char* class_loader_context) { const char* class_loader_context, int target_sdk_version) { static const unsigned int MAX_INSTRUCTION_SET_LEN = 7; if (strlen(instruction_set) >= MAX_INSTRUCTION_SET_LEN) { Loading Loading @@ -323,6 +323,7 @@ static void run_dex2oat(int zip_fd, int oat_fd, int input_vdex_fd, int output_vd bool have_dex2oat_image_fd = false; char dex2oat_image_fd[arraysize("--app-image-fd=") + MAX_INT_LEN]; size_t class_loader_context_size = arraysize("--class-loader-context=") + PKG_PATH_MAX; char target_sdk_version_arg[arraysize("-Xtarget-sdk-version:") + MAX_INT_LEN]; char class_loader_context_arg[class_loader_context_size]; if (class_loader_context != nullptr) { snprintf(class_loader_context_arg, class_loader_context_size, "--class-loader-context=%s", Loading Loading @@ -353,6 +354,7 @@ static void run_dex2oat(int zip_fd, int oat_fd, int input_vdex_fd, int output_vd if (have_dex2oat_Xmx_flag) { sprintf(dex2oat_Xmx_arg, "-Xmx%s", dex2oat_Xmx_flag); } sprintf(target_sdk_version_arg, "-Xtarget-sdk-version:%d", target_sdk_version); // Compute compiler filter. Loading Loading @@ -435,7 +437,8 @@ static void run_dex2oat(int zip_fd, int oat_fd, int input_vdex_fd, int output_vd + (has_base_dir ? 1 : 0) + (have_dex2oat_large_app_threshold ? 1 : 0) + (disable_cdex ? 1 : 0) + (generate_minidebug_info ? 1 : 0)]; + (generate_minidebug_info ? 1 : 0) + (target_sdk_version != 0 ? 2 : 0)]; int i = 0; argv[i++] = dex2oat_bin; argv[i++] = zip_fd_arg; Loading Loading @@ -505,6 +508,10 @@ static void run_dex2oat(int zip_fd, int oat_fd, int input_vdex_fd, int output_vd if (disable_cdex) { argv[i++] = kDisableCompactDexFlag; } if (target_sdk_version != 0) { argv[i++] = RUNTIME_ARG; argv[i++] = target_sdk_version_arg; } // Do not add after dex2oat_flags, they should override others for debugging. argv[i] = NULL; Loading Loading @@ -1767,7 +1774,7 @@ static bool process_secondary_dex_dexopt(const std::string& dex_path, const char int dexopt(const char* dex_path, uid_t uid, const char* pkgname, const char* instruction_set, int dexopt_needed, const char* oat_dir, int dexopt_flags, const char* compiler_filter, const char* volume_uuid, const char* class_loader_context, const char* se_info, bool downgrade) { bool downgrade, int target_sdk_version) { CHECK(pkgname != nullptr); CHECK(pkgname[0] != 0); if ((dexopt_flags & ~DEXOPT_MASK) != 0) { Loading Loading @@ -1884,7 +1891,8 @@ int dexopt(const char* dex_path, uid_t uid, const char* pkgname, const char* ins boot_complete, background_job_compile, reference_profile_fd.get(), class_loader_context); class_loader_context, target_sdk_version); _exit(68); /* only get here on exec failure */ } else { int res = wait_child(pid); Loading
cmds/installd/dexopt.h +1 −1 Original line number Diff line number Diff line Loading @@ -78,7 +78,7 @@ bool reconcile_secondary_dex_file(const std::string& dex_path, int dexopt(const char *apk_path, uid_t uid, const char *pkgName, const char *instruction_set, int dexopt_needed, const char* oat_dir, int dexopt_flags, const char* compiler_filter, const char* volume_uuid, const char* class_loader_context, const char* se_info, bool downgrade); bool downgrade, int target_sdk_version); bool calculate_oat_file_path_default(char path[PKG_PATH_MAX], const char *oat_dir, const char *apk_path, const char *instruction_set); Loading