Loading cmds/atrace/Android.bp +0 −2 Original line number Diff line number Diff line Loading @@ -18,8 +18,6 @@ cc_binary { "libcutils", "libz", "libbase", ], static_libs: [ "libpdx_default_transport", ], Loading cmds/installd/Android.bp +24 −0 Original line number Diff line number Diff line Loading @@ -92,4 +92,28 @@ filegroup { ], } // // Static library for otapreopt used in testing // cc_library_static { name: "libotapreoptparameters", cflags: [ "-Wall", "-Werror" ], clang: true, srcs: [ "otapreopt_parameters.cpp"], export_include_dirs: ["."], shared_libs: [ "libbase", "libcutils", "liblog", "libutils", ], } subdirs = ["tests"] cmds/installd/Android.mk +1 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ LOCAL_CFLAGS += -DART_BASE_ADDRESS=$(LIBART_IMG_HOST_BASE_ADDRESS) LOCAL_CFLAGS += -DART_BASE_ADDRESS_MIN_DELTA=$(LOCAL_LIBART_IMG_HOST_MIN_BASE_ADDRESS_DELTA) LOCAL_CFLAGS += -DART_BASE_ADDRESS_MAX_DELTA=$(LOCAL_LIBART_IMG_HOST_MAX_BASE_ADDRESS_DELTA) LOCAL_SRC_FILES := otapreopt.cpp globals.cpp utils.cpp dexopt.cpp LOCAL_SRC_FILES := otapreopt.cpp otapreopt_parameters.cpp globals.cpp utils.cpp dexopt.cpp LOCAL_HEADER_LIBRARIES := dex2oat_headers LOCAL_SHARED_LIBRARIES := \ libbase \ Loading cmds/installd/InstalldNativeService.cpp +16 −10 Original line number Diff line number Diff line Loading @@ -1895,13 +1895,18 @@ binder::Status InstalldNativeService::destroyProfileSnapshot(const std::string& return ok(); } static const char* getCStr(const std::unique_ptr<std::string>& data, const char* default_value = nullptr) { return data == nullptr ? default_value : data->c_str(); } binder::Status InstalldNativeService::dexopt(const std::string& apkPath, int32_t uid, const std::unique_ptr<std::string>& packageName, const std::string& instructionSet, 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, int32_t targetSdkVersion, const std::unique_ptr<std::string>& profileName) { const std::unique_ptr<std::string>& profileName, const std::unique_ptr<std::string>& dexMetadataPath) { ENFORCE_UID(AID_SYSTEM); CHECK_ARGUMENT_UUID(uuid); if (packageName && *packageName != "*") { Loading @@ -1910,17 +1915,18 @@ binder::Status InstalldNativeService::dexopt(const std::string& apkPath, int32_t std::lock_guard<std::recursive_mutex> lock(mLock); const char* apk_path = apkPath.c_str(); const char* pkgname = packageName ? packageName->c_str() : "*"; const char* pkgname = getCStr(packageName, "*"); const char* instruction_set = instructionSet.c_str(); const char* oat_dir = outputPath ? outputPath->c_str() : nullptr; const char* oat_dir = getCStr(outputPath); const char* compiler_filter = compilerFilter.c_str(); const char* volume_uuid = uuid ? uuid->c_str() : nullptr; const char* class_loader_context = classLoaderContext ? classLoaderContext->c_str() : nullptr; const char* se_info = seInfo ? seInfo->c_str() : nullptr; const char* profile_name = profileName ? profileName->c_str() : nullptr; const char* volume_uuid = getCStr(uuid); const char* class_loader_context = getCStr(classLoaderContext); const char* se_info = getCStr(seInfo); const char* profile_name = getCStr(profileName); const char* dm_path = getCStr(dexMetadataPath); 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, targetSdkVersion, profile_name); downgrade, targetSdkVersion, profile_name, dm_path); return res ? error(res, "Failed to dexopt") : ok(); } Loading Loading @@ -2356,8 +2362,8 @@ struct fsverity_root_hash { __u8 root_hash[64]; }; #define FS_IOC_MEASURE_FSVERITY _IOW('f', 2733, struct fsverity_root_hash) #define FS_IOC_SET_FSVERITY _IOW('f', 2734, struct fsverity_set) #define FS_IOC_MEASURE_FSVERITY _IOW('f', 133, struct fsverity_root_hash) #define FS_IOC_SET_FSVERITY _IOW('f', 134, struct fsverity_set) #define FSVERITY_FLAG_ENABLED 0x0001 #endif Loading cmds/installd/InstalldNativeService.h +2 −1 Original line number Diff line number Diff line Loading @@ -85,7 +85,8 @@ public: 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, int32_t targetSdkVersion, const std::unique_ptr<std::string>& profileName); int32_t targetSdkVersion, const std::unique_ptr<std::string>& profileName, const std::unique_ptr<std::string>& dexMetadataPath); binder::Status rmdex(const std::string& codePath, const std::string& instructionSet); Loading Loading
cmds/atrace/Android.bp +0 −2 Original line number Diff line number Diff line Loading @@ -18,8 +18,6 @@ cc_binary { "libcutils", "libz", "libbase", ], static_libs: [ "libpdx_default_transport", ], Loading
cmds/installd/Android.bp +24 −0 Original line number Diff line number Diff line Loading @@ -92,4 +92,28 @@ filegroup { ], } // // Static library for otapreopt used in testing // cc_library_static { name: "libotapreoptparameters", cflags: [ "-Wall", "-Werror" ], clang: true, srcs: [ "otapreopt_parameters.cpp"], export_include_dirs: ["."], shared_libs: [ "libbase", "libcutils", "liblog", "libutils", ], } subdirs = ["tests"]
cmds/installd/Android.mk +1 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ LOCAL_CFLAGS += -DART_BASE_ADDRESS=$(LIBART_IMG_HOST_BASE_ADDRESS) LOCAL_CFLAGS += -DART_BASE_ADDRESS_MIN_DELTA=$(LOCAL_LIBART_IMG_HOST_MIN_BASE_ADDRESS_DELTA) LOCAL_CFLAGS += -DART_BASE_ADDRESS_MAX_DELTA=$(LOCAL_LIBART_IMG_HOST_MAX_BASE_ADDRESS_DELTA) LOCAL_SRC_FILES := otapreopt.cpp globals.cpp utils.cpp dexopt.cpp LOCAL_SRC_FILES := otapreopt.cpp otapreopt_parameters.cpp globals.cpp utils.cpp dexopt.cpp LOCAL_HEADER_LIBRARIES := dex2oat_headers LOCAL_SHARED_LIBRARIES := \ libbase \ Loading
cmds/installd/InstalldNativeService.cpp +16 −10 Original line number Diff line number Diff line Loading @@ -1895,13 +1895,18 @@ binder::Status InstalldNativeService::destroyProfileSnapshot(const std::string& return ok(); } static const char* getCStr(const std::unique_ptr<std::string>& data, const char* default_value = nullptr) { return data == nullptr ? default_value : data->c_str(); } binder::Status InstalldNativeService::dexopt(const std::string& apkPath, int32_t uid, const std::unique_ptr<std::string>& packageName, const std::string& instructionSet, 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, int32_t targetSdkVersion, const std::unique_ptr<std::string>& profileName) { const std::unique_ptr<std::string>& profileName, const std::unique_ptr<std::string>& dexMetadataPath) { ENFORCE_UID(AID_SYSTEM); CHECK_ARGUMENT_UUID(uuid); if (packageName && *packageName != "*") { Loading @@ -1910,17 +1915,18 @@ binder::Status InstalldNativeService::dexopt(const std::string& apkPath, int32_t std::lock_guard<std::recursive_mutex> lock(mLock); const char* apk_path = apkPath.c_str(); const char* pkgname = packageName ? packageName->c_str() : "*"; const char* pkgname = getCStr(packageName, "*"); const char* instruction_set = instructionSet.c_str(); const char* oat_dir = outputPath ? outputPath->c_str() : nullptr; const char* oat_dir = getCStr(outputPath); const char* compiler_filter = compilerFilter.c_str(); const char* volume_uuid = uuid ? uuid->c_str() : nullptr; const char* class_loader_context = classLoaderContext ? classLoaderContext->c_str() : nullptr; const char* se_info = seInfo ? seInfo->c_str() : nullptr; const char* profile_name = profileName ? profileName->c_str() : nullptr; const char* volume_uuid = getCStr(uuid); const char* class_loader_context = getCStr(classLoaderContext); const char* se_info = getCStr(seInfo); const char* profile_name = getCStr(profileName); const char* dm_path = getCStr(dexMetadataPath); 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, targetSdkVersion, profile_name); downgrade, targetSdkVersion, profile_name, dm_path); return res ? error(res, "Failed to dexopt") : ok(); } Loading Loading @@ -2356,8 +2362,8 @@ struct fsverity_root_hash { __u8 root_hash[64]; }; #define FS_IOC_MEASURE_FSVERITY _IOW('f', 2733, struct fsverity_root_hash) #define FS_IOC_SET_FSVERITY _IOW('f', 2734, struct fsverity_set) #define FS_IOC_MEASURE_FSVERITY _IOW('f', 133, struct fsverity_root_hash) #define FS_IOC_SET_FSVERITY _IOW('f', 134, struct fsverity_set) #define FSVERITY_FLAG_ENABLED 0x0001 #endif Loading
cmds/installd/InstalldNativeService.h +2 −1 Original line number Diff line number Diff line Loading @@ -85,7 +85,8 @@ public: 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, int32_t targetSdkVersion, const std::unique_ptr<std::string>& profileName); int32_t targetSdkVersion, const std::unique_ptr<std::string>& profileName, const std::unique_ptr<std::string>& dexMetadataPath); binder::Status rmdex(const std::string& codePath, const std::string& instructionSet); Loading