Allow for setting a logging_parent for an Apex. am: 004d717158 am: f4fa3fe81e am: 833162725c
Change-Id: Ifa85d785453e5e363b4b374ce0ea1d12963cafbb
diff --git a/apex/apex.go b/apex/apex.go
index a235ead..712afe4 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -1321,6 +1321,9 @@
// binaries would be installed by default (in PRODUCT_PACKAGES) the other binary will be removed
// from PRODUCT_PACKAGES.
Overrides []string
+
+ // Logging Parent value
+ Logging_parent string
}
type apexPackaging int
diff --git a/apex/apex_test.go b/apex/apex_test.go
index 7361fc6..e694435 100644
--- a/apex/apex_test.go
+++ b/apex/apex_test.go
@@ -3230,6 +3230,7 @@
base: "myapex",
apps: ["override_app"],
overrides: ["unknownapex"],
+ logging_parent: "com.foo.bar",
}
apex_key {
@@ -3276,6 +3277,10 @@
t.Errorf("name should be \"override_myapex\", but was %q", name)
}
+ if apexBundle.overridableProperties.Logging_parent != "com.foo.bar" {
+ t.Errorf("override_myapex should have logging parent (com.foo.bar), but was %q.", apexBundle.overridableProperties.Logging_parent)
+ }
+
data := android.AndroidMkDataForTest(t, config, "", apexBundle)
var builder strings.Builder
data.Custom(&builder, name, "TARGET_", "", data)
diff --git a/apex/builder.go b/apex/builder.go
index 022353f..adb3219 100644
--- a/apex/builder.go
+++ b/apex/builder.go
@@ -404,6 +404,10 @@
optFlags = append(optFlags, "--target_sdk_version "+targetSdkVersion)
optFlags = append(optFlags, "--min_sdk_version "+minSdkVersion)
+ if a.overridableProperties.Logging_parent != "" {
+ optFlags = append(optFlags, "--logging_parent ", a.overridableProperties.Logging_parent)
+ }
+
a.mergedNotices = a.buildNoticeFiles(ctx, a.Name()+suffix)
if a.mergedNotices.HtmlGzOutput.Valid() {
// If there's a NOTICE file, embed it as an asset file in the APEX.