diff options
author | Paul Duffin <paulduffin@google.com> | 2021-05-14 07:52:42 +0100 |
---|---|---|
committer | Paul Duffin <paulduffin@google.com> | 2021-05-14 15:57:10 +0100 |
commit | b6f53c064e66f1f7ded2121f9d592463d02e0bdd (patch) | |
tree | 43a4ef99758a34142fe5daf57ee7cc17cc1c02b3 /java/hiddenapi_singleton.go | |
parent | afaa47c74afff8be502b6ba8d0139abfc4f5135d (diff) |
Refactor special handling of hidden API encoding for master-art
Instead of encoding the hidden API with an empty set of flags when the
monolithic flags are not available this simply disables encoding
altogether which should have the same behavior at runtime.
This change also removes the unused flags field in hiddenAPISingleton
which was set but never read.
Bug: 179354495
Test: m nothing
Change-Id: I32d5825e5271829993dd4e5be4d4ee1b22fa7b22
Diffstat (limited to 'java/hiddenapi_singleton.go')
-rw-r--r-- | java/hiddenapi_singleton.go | 36 |
1 files changed, 2 insertions, 34 deletions
diff --git a/java/hiddenapi_singleton.go b/java/hiddenapi_singleton.go index 676a0e722..848aa59bc 100644 --- a/java/hiddenapi_singleton.go +++ b/java/hiddenapi_singleton.go @@ -117,7 +117,6 @@ func hiddenAPISingletonFactory() android.Singleton { } type hiddenAPISingleton struct { - flags android.Path } // hiddenAPI singleton rules @@ -136,17 +135,10 @@ func (h *hiddenAPISingleton) GenerateBuildActions(ctx android.SingletonContext) // consistency. if ctx.Config().PrebuiltHiddenApiDir(ctx) != "" { - h.flags = prebuiltFlagsRule(ctx) + prebuiltFlagsRule(ctx) prebuiltIndexRule(ctx) return } - - // These rules depend on files located in frameworks/base, skip them if running in a tree that doesn't have them. - if ctx.Config().FrameworksBaseDirExists(ctx) { - h.flags = flagsRule(ctx) - } else { - h.flags = emptyFlagsRule(ctx) - } } // Checks to see whether the supplied module variant is in the list of boot jars. @@ -187,7 +179,7 @@ func isModuleInConfiguredList(ctx android.BaseModuleContext, module android.Modu return true } -func prebuiltFlagsRule(ctx android.SingletonContext) android.Path { +func prebuiltFlagsRule(ctx android.SingletonContext) { outputPath := hiddenAPISingletonPaths(ctx).flags inputPath := android.PathForSource(ctx, ctx.Config().PrebuiltHiddenApiDir(ctx), "hiddenapi-flags.csv") @@ -196,8 +188,6 @@ func prebuiltFlagsRule(ctx android.SingletonContext) android.Path { Output: outputPath, Input: inputPath, }) - - return outputPath } func prebuiltIndexRule(ctx android.SingletonContext) { @@ -211,28 +201,6 @@ func prebuiltIndexRule(ctx android.SingletonContext) { }) } -// flagsRule is a placeholder that simply returns the location of the file, the generation of the -// ninja rules is done in generateHiddenAPIBuildActions. -func flagsRule(ctx android.SingletonContext) android.Path { - outputPath := hiddenAPISingletonPaths(ctx).flags - return outputPath -} - -// emptyFlagsRule creates a rule to build an empty hiddenapi-flags.csv, which is needed by master-art-host builds that -// have a partial manifest without frameworks/base but still need to build a boot image. -func emptyFlagsRule(ctx android.SingletonContext) android.Path { - rule := android.NewRuleBuilder(pctx, ctx) - - outputPath := hiddenAPISingletonPaths(ctx).flags - - rule.Command().Text("rm").Flag("-f").Output(outputPath) - rule.Command().Text("touch").Output(outputPath) - - rule.Build("emptyHiddenAPIFlagsFile", "empty hiddenapi flags") - - return outputPath -} - // tempPathForRestat creates a path of the same type as the supplied type but with a name of // <path>.tmp. // |