diff options
author | Daniel Norman <danielnorman@google.com> | 2021-06-18 15:33:16 -0700 |
---|---|---|
committer | Daniel Norman <danielnorman@google.com> | 2021-06-18 15:33:16 -0700 |
commit | fb4970cd04bc1e98bc18f34c4cb5a12f34af772b (patch) | |
tree | bc1820b4ada8d579772f1f69b10db8a53ef27109 /apex | |
parent | e1a058ad0bad84b928a729ff51574484fedc38b5 (diff) | |
parent | 6bca599d74bac2b7fdc6f3f51de05845db9cbd77 (diff) |
Merge SP1A.210616.001
Change-Id: I93c80df288abe7780005a793240e6dc9d39245cb
Diffstat (limited to 'apex')
-rw-r--r-- | apex/apex.go | 13 | ||||
-rw-r--r-- | apex/builder.go | 6 |
2 files changed, 8 insertions, 11 deletions
diff --git a/apex/apex.go b/apex/apex.go index 89693d2ff..73134bfc7 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -165,9 +165,10 @@ type apexBundleProperties struct { // Default is false. Ignore_system_library_special_case *bool - // Whenever apex_payload.img of the APEX should include dm-verity hashtree. Should be only - // used in tests. - Test_only_no_hashtree *bool + // Whenever apex_payload.img of the APEX should include dm-verity hashtree. + // Default value is false. + // TODO(b/190621617): change default value to true. + Generate_hashtree *bool // Whenever apex_payload.img of the APEX should not be dm-verity signed. Should be only // used in tests. @@ -1268,9 +1269,9 @@ func (a *apexBundle) installable() bool { return !a.properties.PreventInstall && (a.properties.Installable == nil || proptools.Bool(a.properties.Installable)) } -// See the test_only_no_hashtree property -func (a *apexBundle) testOnlyShouldSkipHashtreeGeneration() bool { - return proptools.Bool(a.properties.Test_only_no_hashtree) +// See the generate_hashtree property +func (a *apexBundle) shouldGenerateHashtree() bool { + return proptools.BoolDefault(a.properties.Generate_hashtree, false) } // See the test_only_unsigned_payload property diff --git a/apex/builder.go b/apex/builder.go index da8841ce7..d2e6ad8d5 100644 --- a/apex/builder.go +++ b/apex/builder.go @@ -629,11 +629,7 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext) { optFlags = append(optFlags, "--assets_dir "+filepath.Dir(a.mergedNotices.HtmlGzOutput.String())) } - if ctx.ModuleDir() != "system/apex/apexd/apexd_testdata" && ctx.ModuleDir() != "system/apex/shim/build" && a.testOnlyShouldSkipHashtreeGeneration() { - ctx.PropertyErrorf("test_only_no_hashtree", "not available") - return - } - if (moduleMinSdkVersion.GreaterThan(android.SdkVersion_Android10) || a.testOnlyShouldSkipHashtreeGeneration()) && !compressionEnabled { + if (moduleMinSdkVersion.GreaterThan(android.SdkVersion_Android10) && !a.shouldGenerateHashtree()) && !compressionEnabled { // Apexes which are supposed to be installed in builtin dirs(/system, etc) // don't need hashtree for activation. Therefore, by removing hashtree from // apex bundle (filesystem image in it, to be specific), we can save storage. |