Remove apex.apex_name

apex_name was used to install symbol files under /apex/<apex name>,
which caused duplicate rules when there's two apexes with the same
apex_name. (e.g. override_apex or multi-install apexes)

Since symbol files can be looked up via ELF Build-Id, we don't have to
install symbol files with the actual "apex name", but instead we can
install them with soong module name.

Bug: 267581665
Test: m (soong test)
Change-Id: I1cbe5c86d287f180c7deef93ba85ea5552680011
This commit is contained in:
Jooyung Han
2023-02-08 09:24:06 +09:00
parent d7d179a0e8
commit df26332d50
4 changed files with 21 additions and 71 deletions

View File

@@ -4105,52 +4105,11 @@ func TestDependenciesInApexManifest(t *testing.T) {
ensureListEmpty(t, requireNativeLibs)
}
func TestApexName(t *testing.T) {
ctx := testApex(t, `
apex {
name: "myapex",
key: "myapex.key",
apex_name: "com.android.myapex",
native_shared_libs: ["mylib"],
updatable: false,
}
apex_key {
name: "myapex.key",
public_key: "testkey.avbpubkey",
private_key: "testkey.pem",
}
cc_library {
name: "mylib",
srcs: ["mylib.cpp"],
system_shared_libs: [],
stl: "none",
apex_available: [
"//apex_available:platform",
"myapex",
],
}
`)
module := ctx.ModuleForTests("myapex", "android_common_com.android.myapex_image")
apexBundle := module.Module().(*apexBundle)
data := android.AndroidMkDataForTest(t, ctx, apexBundle)
name := apexBundle.BaseModuleName()
prefix := "TARGET_"
var builder strings.Builder
data.Custom(&builder, name, prefix, "", data)
androidMk := builder.String()
ensureContains(t, androidMk, "LOCAL_MODULE := mylib.myapex\n")
ensureNotContains(t, androidMk, "LOCAL_MODULE := mylib.com.android.myapex\n")
}
func TestOverrideApexManifestDefaultVersion(t *testing.T) {
ctx := testApex(t, `
apex {
name: "myapex",
key: "myapex.key",
apex_name: "com.android.myapex",
native_shared_libs: ["mylib"],
updatable: false,
}
@@ -4175,7 +4134,7 @@ func TestOverrideApexManifestDefaultVersion(t *testing.T) {
"OVERRIDE_APEX_MANIFEST_DEFAULT_VERSION": "1234",
}))
module := ctx.ModuleForTests("myapex", "android_common_com.android.myapex_image")
module := ctx.ModuleForTests("myapex", "android_common_myapex_image")
apexManifestRule := module.Rule("apexManifestRule")
ensureContains(t, apexManifestRule.Args["default_version"], "1234")
}