platform_frameworks_native/cmds/installd/Android.bp
Felka Chang 2a0a246603 add function to traversal the crates
The system_server needs to traversal Context.getCratesDir() to get all
of crates. But, system_server doesn't have the permission. system_server
needs installd to traverse Context.getCratesDir().

The depth of traversal in Context.getCratesDir is 1. installd returns the
list CrateMetadata. CrateMetadata contains the following information.
* crateName: it is the folder name

To add .gitigTo add .gitignore to collect the ignore file list.

Test: atest \
        CtsOsTestCases:android.os.storage.cts.CrateInfoTest \
        CtsOsTestCases:android.os.storage.cts.StorageManagerCratesTest \
        CtsOsTestCases:android.os.storage.cts.StorageStatsManagerTest

Bug: 141660526
Change-Id: Iea5eee4606e4ff437edef617a1f8db93e37f51c4
2019-12-18 14:13:26 +08:00

261 lines
4.8 KiB
Text

cc_defaults {
name: "installd_defaults",
cflags: [
"-Wall",
"-Werror",
"-Wextra",
"-Wunreachable-code",
"-Wunreachable-code-break",
"-Wunreachable-code-return",
],
srcs: [
"CacheItem.cpp",
"CacheTracker.cpp",
"CrateManager.cpp",
"InstalldNativeService.cpp",
"QuotaUtils.cpp",
"dexopt.cpp",
"globals.cpp",
"utils.cpp",
"utils_default.cpp",
"view_compiler.cpp",
":installd_aidl",
],
header_libs: [
"dex2oat_headers",
],
shared_libs: [
"libbase",
"libbinder",
"libcrypto",
"libcutils",
"liblog",
"liblogwrap",
"libprocessgroup",
"libselinux",
"libutils",
"server_configurable_flags",
],
product_variables: {
arc: {
exclude_srcs: [
"QuotaUtils.cpp",
],
static_libs: [
"libarcdiskquota",
"arc_services_aidl",
],
cflags: [
"-DUSE_ARC",
],
},
},
clang: true,
tidy: true,
tidy_checks: [
"-*",
"clang-analyzer-security*",
"cert-*",
"-cert-err58-cpp",
],
tidy_flags: [
"-warnings-as-errors=clang-analyzer-security*,cert-*"
],
}
//
// Static library used in testing and executable
//
cc_library_static {
name: "libinstalld",
defaults: ["installd_defaults"],
export_include_dirs: ["."],
aidl: {
export_aidl_headers: true,
},
product_variables: {
arc: {
exclude_srcs: [
"QuotaUtils.cpp",
],
static_libs: [
"libarcdiskquota",
"arc_services_aidl",
],
cflags: [
"-DUSE_ARC",
],
},
},
}
cc_library_headers {
name: "libinstalld_headers",
export_include_dirs: ["."],
}
//
// Executable
//
cc_binary {
name: "installd",
defaults: ["installd_defaults"],
srcs: ["installd.cpp"],
static_libs: ["libdiskusage"],
init_rc: ["installd.rc"],
product_variables: {
arc: {
exclude_srcs: [
"QuotaUtils.cpp",
],
static_libs: [
"libarcdiskquota",
"arc_services_aidl",
],
cflags: [
"-DUSE_ARC",
],
},
},
// Needs to be wherever installd is as it's execed by
// installd.
required: [ "migrate_legacy_obb_data.sh" ],
}
// OTA chroot tool
cc_binary {
name: "otapreopt_chroot",
defaults: ["libapexd-deps"],
cflags: [
"-Wall",
"-Werror",
],
clang: true,
srcs: [
"otapreopt_chroot.cpp",
"otapreopt_utils.cpp",
],
shared_libs: [
"libbase",
"liblog",
"libutils",
],
static_libs: [
"libapexd",
],
}
filegroup {
name: "installd_aidl",
srcs: [
"binder/android/os/IInstalld.aidl",
"binder/android/os/storage/CrateMetadata.aidl",
],
path: "binder",
}
//
// Static library for otapreopt used in testing
//
cc_library_static {
name: "libotapreoptparameters",
cflags: [
"-Wall",
"-Werror"
],
srcs: ["otapreopt_parameters.cpp"],
export_include_dirs: ["."],
shared_libs: [
"libbase",
"libcutils",
"liblog",
"libprocessgroup",
"libutils",
],
}
//
// OTA Executable
//
cc_binary {
name: "otapreopt",
cflags: [
"-Wall",
"-Werror"
],
srcs: [
"dexopt.cpp",
"globals.cpp",
"otapreopt.cpp",
"otapreopt_utils.cpp",
"utils.cpp",
"utils_default.cpp",
"view_compiler.cpp",
],
header_libs: ["dex2oat_headers"],
static_libs: [
"libartimagevalues",
"libdiskusage",
"libotapreoptparameters",
],
shared_libs: [
"libbase",
"libcrypto",
"libcutils",
"liblog",
"liblogwrap",
"libprocessgroup",
"libselinux",
"libutils",
"server_configurable_flags",
],
}
// OTA slot script
sh_binary {
name: "otapreopt_slot",
src: "otapreopt_slot.sh",
init_rc: ["otapreopt.rc"],
}
// OTA postinstall script
sh_binary {
name: "otapreopt_script",
src: "otapreopt_script.sh",
// Let this depend on otapreopt, the chroot tool and the slot script,
// so we just have to mention one in a configuration.
required: [
"otapreopt",
"otapreopt_chroot",
"otapreopt_slot",
],
}
// Script to migrate legacy obb data.
sh_binary {
name: "migrate_legacy_obb_data.sh",
src: "migrate_legacy_obb_data.sh"
}