Remove "apex_uses" mutator

which was added to support built-time common apex. But the common apex
was abandoned and it is used nowhere.

This is a manual revert of 5c998b9ff8.

Bug: 173329465
Test: m
Change-Id: I684e6b8bfe2ef5b53943329f4aaa5a5ccba27738
This commit is contained in:
Jooyung Han
2020-11-16 18:03:34 +09:00
parent 1d26d3033a
commit 74f576de58
2 changed files with 0 additions and 170 deletions

View File

@@ -149,10 +149,8 @@ func testApexContext(_ *testing.T, bp string, handlers ...testCustomizer) (*andr
"system/sepolicy/apex/myapex.updatable-file_contexts": nil,
"system/sepolicy/apex/myapex2-file_contexts": nil,
"system/sepolicy/apex/otherapex-file_contexts": nil,
"system/sepolicy/apex/commonapex-file_contexts": nil,
"system/sepolicy/apex/com.android.vndk-file_contexts": nil,
"mylib.cpp": nil,
"mylib_common.cpp": nil,
"mytest.cpp": nil,
"mytest1.cpp": nil,
"mytest2.cpp": nil,
@@ -4202,131 +4200,6 @@ func TestInstallExtraFlattenedApexes(t *testing.T) {
ensureContains(t, androidMk, "LOCAL_REQUIRED_MODULES += myapex.flattened")
}
func TestApexUsesOtherApex(t *testing.T) {
ctx, _ := testApex(t, `
apex {
name: "myapex",
key: "myapex.key",
native_shared_libs: ["mylib"],
uses: ["commonapex"],
}
apex {
name: "commonapex",
key: "myapex.key",
native_shared_libs: ["libcommon"],
provide_cpp_shared_libs: true,
}
apex_key {
name: "myapex.key",
public_key: "testkey.avbpubkey",
private_key: "testkey.pem",
}
cc_library {
name: "mylib",
srcs: ["mylib.cpp"],
shared_libs: ["libcommon"],
system_shared_libs: [],
stl: "none",
apex_available: [ "myapex" ],
}
cc_library {
name: "libcommon",
srcs: ["mylib_common.cpp"],
system_shared_libs: [],
stl: "none",
// TODO: remove //apex_available:platform
apex_available: [
"//apex_available:platform",
"commonapex",
"myapex",
],
}
`)
module1 := ctx.ModuleForTests("myapex", "android_common_myapex_image")
apexRule1 := module1.Rule("apexRule")
copyCmds1 := apexRule1.Args["copy_commands"]
module2 := ctx.ModuleForTests("commonapex", "android_common_commonapex_image")
apexRule2 := module2.Rule("apexRule")
copyCmds2 := apexRule2.Args["copy_commands"]
ensureListContains(t, ctx.ModuleVariantsForTests("mylib"), "android_arm64_armv8-a_shared_apex10000")
ensureListContains(t, ctx.ModuleVariantsForTests("libcommon"), "android_arm64_armv8-a_shared_apex10000")
ensureContains(t, copyCmds1, "image.apex/lib64/mylib.so")
ensureContains(t, copyCmds2, "image.apex/lib64/libcommon.so")
ensureNotContains(t, copyCmds1, "image.apex/lib64/libcommon.so")
}
func TestApexUsesFailsIfNotProvided(t *testing.T) {
testApexError(t, `uses: "commonapex" does not provide native_shared_libs`, `
apex {
name: "myapex",
key: "myapex.key",
uses: ["commonapex"],
}
apex {
name: "commonapex",
key: "myapex.key",
}
apex_key {
name: "myapex.key",
public_key: "testkey.avbpubkey",
private_key: "testkey.pem",
}
`)
testApexError(t, `uses: "commonapex" is not a provider`, `
apex {
name: "myapex",
key: "myapex.key",
uses: ["commonapex"],
}
cc_library {
name: "commonapex",
system_shared_libs: [],
stl: "none",
}
apex_key {
name: "myapex.key",
public_key: "testkey.avbpubkey",
private_key: "testkey.pem",
}
`)
}
func TestApexUsesFailsIfUseVenderMismatch(t *testing.T) {
testApexError(t, `use_vendor: "commonapex" has different value of use_vendor`, `
apex {
name: "myapex",
key: "myapex.key",
use_vendor: true,
uses: ["commonapex"],
}
apex {
name: "commonapex",
key: "myapex.key",
provide_cpp_shared_libs: true,
}
apex_key {
name: "myapex.key",
public_key: "testkey.avbpubkey",
private_key: "testkey.pem",
}
`, func(fs map[string][]byte, config android.Config) {
setUseVendorAllowListForTest(config, []string{"myapex"})
})
}
func TestErrorsIfDepsAreNotEnabled(t *testing.T) {
testApexError(t, `module "myapex" .* depends on disabled module "libfoo"`, `
apex {