summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--aconfig/codegen/rust_aconfig_library.go1
-rw-r--r--aconfig/codegen/rust_aconfig_library_test.go15
-rw-r--r--android/aconfig_providers.go6
-rw-r--r--apex/aconfig_test.go18
-rw-r--r--apex/apex_test.go21
-rw-r--r--apex/builder.go2
-rw-r--r--etc/prebuilt_etc.go12
-rw-r--r--etc/prebuilt_etc_test.go14
-rw-r--r--java/base.go2
-rw-r--r--java/sdk_library_test.go13
-rw-r--r--python/python.go1
11 files changed, 81 insertions, 24 deletions
diff --git a/aconfig/codegen/rust_aconfig_library.go b/aconfig/codegen/rust_aconfig_library.go
index 3f7495be1..a0a2a546b 100644
--- a/aconfig/codegen/rust_aconfig_library.go
+++ b/aconfig/codegen/rust_aconfig_library.go
@@ -101,6 +101,7 @@ func (a *aconfigDecorator) SourceProviderDeps(ctx rust.DepsContext, deps rust.De
deps = a.BaseSourceProvider.SourceProviderDeps(ctx, deps)
deps.Rustlibs = append(deps.Rustlibs, "libflags_rust")
deps.Rustlibs = append(deps.Rustlibs, "liblazy_static")
+ deps.Rustlibs = append(deps.Rustlibs, "libaconfig_storage_read_api")
ctx.AddDependency(ctx.Module(), rustDeclarationsTag, a.Properties.Aconfig_declarations)
return deps
}
diff --git a/aconfig/codegen/rust_aconfig_library_test.go b/aconfig/codegen/rust_aconfig_library_test.go
index 60bc9f747..330cecd73 100644
--- a/aconfig/codegen/rust_aconfig_library_test.go
+++ b/aconfig/codegen/rust_aconfig_library_test.go
@@ -28,6 +28,11 @@ func TestRustAconfigLibrary(t *testing.T) {
crate_name: "lazy_static",
srcs: ["src/lib.rs"],
}
+ rust_library {
+ name: "libaconfig_storage_read_api", // test mock
+ crate_name: "aconfig_storage_read_api",
+ srcs: ["lib.rs"],
+ }
aconfig_declarations {
name: "my_aconfig_declarations",
package: "com.example.package",
@@ -98,6 +103,11 @@ func testRustCodegenModeHelper(t *testing.T, bpMode string, ruleMode string) {
crate_name: "lazy_static",
srcs: ["src/lib.rs"],
}
+ rust_library {
+ name: "libaconfig_storage_read_api", // test mock
+ crate_name: "aconfig_storage_read_api",
+ srcs: ["lib.rs"],
+ }
aconfig_declarations {
name: "my_aconfig_declarations",
package: "com.example.package",
@@ -145,6 +155,11 @@ func testIncorrectRustCodegenModeHelper(t *testing.T, bpMode string, err string)
crate_name: "lazy_static",
srcs: ["src/lib.rs"],
}
+ rust_library {
+ name: "libaconfig_storage_read_api", // test mock
+ crate_name: "aconfig_storage_read_api",
+ srcs: ["lib.rs"],
+ }
aconfig_declarations {
name: "my_aconfig_declarations",
package: "com.example.package",
diff --git a/android/aconfig_providers.go b/android/aconfig_providers.go
index fcc57e1a4..4c1782b8e 100644
--- a/android/aconfig_providers.go
+++ b/android/aconfig_providers.go
@@ -105,7 +105,8 @@ func CollectDependencyAconfigFiles(ctx ModuleContext, mergedAconfigFiles *map[st
}
})
- for container, aconfigFiles := range *mergedAconfigFiles {
+ for _, container := range SortedKeys(*mergedAconfigFiles) {
+ aconfigFiles := (*mergedAconfigFiles)[container]
(*mergedAconfigFiles)[container] = mergeAconfigFiles(ctx, container, aconfigFiles, false)
}
@@ -172,7 +173,8 @@ func aconfigUpdateAndroidBuildActions(ctx ModuleContext) {
})
// We only need to set the provider if we have aconfig files.
if len(mergedAconfigFiles) > 0 {
- for container, aconfigFiles := range mergedAconfigFiles {
+ for _, container := range SortedKeys(mergedAconfigFiles) {
+ aconfigFiles := mergedAconfigFiles[container]
mergedAconfigFiles[container] = mergeAconfigFiles(ctx, container, aconfigFiles, true)
}
diff --git a/apex/aconfig_test.go b/apex/aconfig_test.go
index a179dbffd..515b2fdd0 100644
--- a/apex/aconfig_test.go
+++ b/apex/aconfig_test.go
@@ -217,6 +217,12 @@ func TestValidationAcrossContainersExportedPass(t *testing.T) {
srcs: ["src/lib.rs"],
apex_available: ["myapex"],
}
+ rust_library {
+ name: "libaconfig_storage_read_api", // test mock
+ crate_name: "aconfig_storage_read_api",
+ srcs: ["src/lib.rs"],
+ apex_available: ["myapex"],
+ }
rust_ffi_shared {
name: "libmy_rust_library",
srcs: ["src/lib.rs"],
@@ -480,6 +486,12 @@ func TestValidationAcrossContainersNotExportedFail(t *testing.T) {
srcs: ["src/lib.rs"],
apex_available: ["myapex"],
}
+ rust_library {
+ name: "libaconfig_storage_read_api", // test mock
+ crate_name: "aconfig_storage_read_api",
+ srcs: ["src/lib.rs"],
+ apex_available: ["myapex"],
+ }
rust_ffi_shared {
name: "libmy_rust_library",
srcs: ["src/lib.rs"],
@@ -524,6 +536,12 @@ func TestValidationAcrossContainersNotExportedFail(t *testing.T) {
srcs: ["src/lib.rs"],
apex_available: ["myapex"],
}
+ rust_library {
+ name: "libaconfig_storage_read_api", // test mock
+ crate_name: "aconfig_storage_read_api",
+ srcs: ["src/lib.rs"],
+ apex_available: ["myapex"],
+ }
rust_binary {
name: "my_rust_binary",
srcs: ["foo/bar/MyClass.rs"],
diff --git a/apex/apex_test.go b/apex/apex_test.go
index b7362b202..535805b4e 100644
--- a/apex/apex_test.go
+++ b/apex/apex_test.go
@@ -11296,6 +11296,15 @@ func TestAconfigFilesRustDeps(t *testing.T) {
],
}
+ rust_library {
+ name: "libaconfig_storage_read_api", // test mock
+ crate_name: "aconfig_storage_read_api",
+ srcs: ["src/lib.rs"],
+ apex_available: [
+ "myapex",
+ ],
+ }
+
rust_ffi_shared {
name: "libmy_rust_library",
srcs: ["src/lib.rs"],
@@ -11380,14 +11389,14 @@ func TestAconfigFilesRustDeps(t *testing.T) {
mod := ctx.ModuleForTests("myapex", "android_common_myapex")
s := mod.Rule("apexRule").Args["copy_commands"]
copyCmds := regexp.MustCompile(" *&& *").Split(s, -1)
- if len(copyCmds) != 26 {
- t.Fatalf("Expected 26 commands, got %d in:\n%s", len(copyCmds), s)
+ if len(copyCmds) != 28 {
+ t.Fatalf("Expected 28 commands, got %d in:\n%s", len(copyCmds), s)
}
- ensureMatches(t, copyCmds[22], "^cp -f .*/aconfig_flags.pb .*/image.apex/etc$")
- ensureMatches(t, copyCmds[23], "^cp -f .*/package.map .*/image.apex/etc$")
- ensureMatches(t, copyCmds[24], "^cp -f .*/flag.map .*/image.apex/etc$")
- ensureMatches(t, copyCmds[25], "^cp -f .*/flag.val .*/image.apex/etc$")
+ ensureMatches(t, copyCmds[24], "^cp -f .*/aconfig_flags.pb .*/image.apex/etc$")
+ ensureMatches(t, copyCmds[25], "^cp -f .*/package.map .*/image.apex/etc$")
+ ensureMatches(t, copyCmds[26], "^cp -f .*/flag.map .*/image.apex/etc$")
+ ensureMatches(t, copyCmds[27], "^cp -f .*/flag.val .*/image.apex/etc$")
inputs := []string{
"my_aconfig_declarations_foo/intermediate.pb",
diff --git a/apex/builder.go b/apex/builder.go
index 6ad282ab6..50db631b7 100644
--- a/apex/builder.go
+++ b/apex/builder.go
@@ -485,7 +485,7 @@ func markManifestTestOnly(ctx android.ModuleContext, androidManifestFile android
}
func isVintfFragment(fi apexFile) bool {
- isVintfFragment, _ := path.Match("etc/vintf/*.xml", fi.path())
+ isVintfFragment, _ := path.Match("etc/vintf/*", fi.path())
return isVintfFragment
}
diff --git a/etc/prebuilt_etc.go b/etc/prebuilt_etc.go
index a42c576d5..21a18dfd4 100644
--- a/etc/prebuilt_etc.go
+++ b/etc/prebuilt_etc.go
@@ -57,6 +57,7 @@ func RegisterPrebuiltEtcBuildComponents(ctx android.RegistrationContext) {
ctx.RegisterModuleType("prebuilt_root_host", PrebuiltRootHostFactory)
ctx.RegisterModuleType("prebuilt_usr_share", PrebuiltUserShareFactory)
ctx.RegisterModuleType("prebuilt_usr_share_host", PrebuiltUserShareHostFactory)
+ ctx.RegisterModuleType("prebuilt_usr_hyphendata", PrebuiltUserHyphenDataFactory)
ctx.RegisterModuleType("prebuilt_font", PrebuiltFontFactory)
ctx.RegisterModuleType("prebuilt_firmware", PrebuiltFirmwareFactory)
ctx.RegisterModuleType("prebuilt_dsp", PrebuiltDSPFactory)
@@ -611,6 +612,17 @@ func PrebuiltUserShareHostFactory() android.Module {
return module
}
+// prebuilt_usr_hyphendata is for a prebuilt artifact that is installed in
+// <partition>/usr/hyphen-data/<sub_dir> directory.
+func PrebuiltUserHyphenDataFactory() android.Module {
+ module := &PrebuiltEtc{}
+ InitPrebuiltEtcModule(module, "usr/hyphen-data")
+ // This module is device-only
+ android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
+ android.InitDefaultableModule(module)
+ return module
+}
+
// prebuilt_font installs a font in <partition>/fonts directory.
func PrebuiltFontFactory() android.Module {
module := &PrebuiltEtc{}
diff --git a/etc/prebuilt_etc_test.go b/etc/prebuilt_etc_test.go
index 1d9aa8e58..e346bd79f 100644
--- a/etc/prebuilt_etc_test.go
+++ b/etc/prebuilt_etc_test.go
@@ -287,6 +287,20 @@ func TestPrebuiltUserShareHostInstallDirPath(t *testing.T) {
android.AssertPathRelativeToTopEquals(t, "install dir", expected, p.installDirPath)
}
+func TestPrebuiltPrebuiltUserHyphenDataInstallDirPath(t *testing.T) {
+ result := prepareForPrebuiltEtcTest.RunTestWithBp(t, `
+ prebuilt_usr_hyphendata {
+ name: "foo.conf",
+ src: "foo.conf",
+ sub_dir: "bar",
+ }
+ `)
+
+ p := result.Module("foo.conf", "android_arm64_armv8-a").(*PrebuiltEtc)
+ expected := "out/soong/target/product/test_device/system/usr/hyphen-data/bar"
+ android.AssertPathRelativeToTopEquals(t, "install dir", expected, p.installDirPath)
+}
+
func TestPrebuiltFontInstallDirPath(t *testing.T) {
result := prepareForPrebuiltEtcTest.RunTestWithBp(t, `
prebuilt_font {
diff --git a/java/base.go b/java/base.go
index 838574df5..9bb133dc3 100644
--- a/java/base.go
+++ b/java/base.go
@@ -804,7 +804,7 @@ func (j *Module) deps(ctx android.BottomUpMutatorContext) {
// Add dependency on libraries that provide additional hidden api annotations.
ctx.AddVariationDependencies(nil, hiddenApiAnnotationsTag, j.properties.Hiddenapi_additional_annotations...)
- if ctx.DeviceConfig().VndkVersion() != "" && ctx.Config().EnforceInterPartitionJavaSdkLibrary() {
+ if ctx.Config().EnforceInterPartitionJavaSdkLibrary() {
// Require java_sdk_library at inter-partition java dependency to ensure stable
// interface between partitions. If inter-partition java_library dependency is detected,
// raise build error because java_library doesn't have a stable interface.
diff --git a/java/sdk_library_test.go b/java/sdk_library_test.go
index fb584c5c7..a19d3829f 100644
--- a/java/sdk_library_test.go
+++ b/java/sdk_library_test.go
@@ -1239,7 +1239,6 @@ func TestJavaSdkLibraryEnforce(t *testing.T) {
libraryType string
fromPartition string
toPartition string
- enforceVendorInterface bool
enforceProductInterface bool
enforceJavaSdkLibraryCheck bool
allowList []string
@@ -1274,9 +1273,6 @@ func TestJavaSdkLibraryEnforce(t *testing.T) {
android.FixtureWithRootAndroidBp(bpFile),
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
variables.EnforceProductPartitionInterface = proptools.BoolPtr(info.enforceProductInterface)
- if info.enforceVendorInterface {
- variables.DeviceVndkVersion = proptools.StringPtr("current")
- }
variables.EnforceInterPartitionJavaSdkLibrary = proptools.BoolPtr(info.enforceJavaSdkLibraryCheck)
variables.InterPartitionJavaLibraryAllowList = info.allowList
}),
@@ -1304,7 +1300,6 @@ func TestJavaSdkLibraryEnforce(t *testing.T) {
libraryType: "java_library",
fromPartition: "product",
toPartition: "system",
- enforceVendorInterface: true,
enforceProductInterface: true,
enforceJavaSdkLibraryCheck: false,
}, "")
@@ -1313,7 +1308,6 @@ func TestJavaSdkLibraryEnforce(t *testing.T) {
libraryType: "java_library",
fromPartition: "product",
toPartition: "system",
- enforceVendorInterface: true,
enforceProductInterface: false,
enforceJavaSdkLibraryCheck: true,
}, "")
@@ -1322,7 +1316,6 @@ func TestJavaSdkLibraryEnforce(t *testing.T) {
libraryType: "java_library",
fromPartition: "product",
toPartition: "system",
- enforceVendorInterface: true,
enforceProductInterface: true,
enforceJavaSdkLibraryCheck: true,
}, errorMessage)
@@ -1331,7 +1324,6 @@ func TestJavaSdkLibraryEnforce(t *testing.T) {
libraryType: "java_library",
fromPartition: "vendor",
toPartition: "system",
- enforceVendorInterface: true,
enforceProductInterface: true,
enforceJavaSdkLibraryCheck: true,
}, errorMessage)
@@ -1340,7 +1332,6 @@ func TestJavaSdkLibraryEnforce(t *testing.T) {
libraryType: "java_library",
fromPartition: "vendor",
toPartition: "system",
- enforceVendorInterface: true,
enforceProductInterface: true,
enforceJavaSdkLibraryCheck: true,
allowList: []string{"bar"},
@@ -1350,7 +1341,6 @@ func TestJavaSdkLibraryEnforce(t *testing.T) {
libraryType: "java_library",
fromPartition: "vendor",
toPartition: "product",
- enforceVendorInterface: true,
enforceProductInterface: true,
enforceJavaSdkLibraryCheck: true,
}, errorMessage)
@@ -1359,7 +1349,6 @@ func TestJavaSdkLibraryEnforce(t *testing.T) {
libraryType: "java_sdk_library",
fromPartition: "product",
toPartition: "system",
- enforceVendorInterface: true,
enforceProductInterface: true,
enforceJavaSdkLibraryCheck: true,
}, "")
@@ -1368,7 +1357,6 @@ func TestJavaSdkLibraryEnforce(t *testing.T) {
libraryType: "java_sdk_library",
fromPartition: "vendor",
toPartition: "system",
- enforceVendorInterface: true,
enforceProductInterface: true,
enforceJavaSdkLibraryCheck: true,
}, "")
@@ -1377,7 +1365,6 @@ func TestJavaSdkLibraryEnforce(t *testing.T) {
libraryType: "java_sdk_library",
fromPartition: "vendor",
toPartition: "product",
- enforceVendorInterface: true,
enforceProductInterface: true,
enforceJavaSdkLibraryCheck: true,
}, "")
diff --git a/python/python.go b/python/python.go
index d3cbd7695..2b1974eb8 100644
--- a/python/python.go
+++ b/python/python.go
@@ -545,7 +545,6 @@ func (p *PythonLibraryModule) createSrcsZip(ctx android.ModuleContext, pkgPath s
var stagedProtoSrcs android.Paths
for _, srcFile := range protoSrcs {
stagedProtoSrc := pkgPathStagingDir.Join(ctx, pkgPath, srcFile.Rel())
- rule.Command().Text("mkdir -p").Flag(filepath.Base(stagedProtoSrc.String()))
rule.Command().Text("cp -f").Input(srcFile).Output(stagedProtoSrc)
stagedProtoSrcs = append(stagedProtoSrcs, stagedProtoSrc)
}