diff options
| author | 2021-02-09 13:58:12 +0000 | |
|---|---|---|
| committer | 2021-02-09 13:58:12 +0000 | |
| commit | 320e170675a5d8ce2e8fbdf05c3f0ee822a2b08e (patch) | |
| tree | a5c7816ce85ef7574e5b41f069a305e665a8f434 /java/java.go | |
| parent | b71a8de0d5cc7571a7c900c1573c7cda38de9c2b (diff) | |
| parent | 9d67ca6ab7cbc3874b51d7a434a8b0c1506f7ecf (diff) | |
Merge "Allow dex jars from prebuilt_apex to be used by hiddenapi"
Diffstat (limited to 'java/java.go')
| -rw-r--r-- | java/java.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/java/java.go b/java/java.go index dfbcd6f54..d194ff7d9 100644 --- a/java/java.go +++ b/java/java.go @@ -2917,6 +2917,9 @@ func (j *Import) GenerateAndroidBuildActions(ctx android.ModuleContext) { j.exportAidlIncludeDirs = android.PathsForModuleSrc(ctx, j.properties.Aidl.Export_include_dirs) if ctx.Device() { + configurationName := j.BaseModuleName() + primary := j.Prebuilt().UsePrebuilt() + // If this is a variant created for a prebuilt_apex then use the dex implementation jar // obtained from the associated deapexer module. ai := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo) @@ -2930,8 +2933,10 @@ func (j *Import) GenerateAndroidBuildActions(ctx android.ModuleContext) { // Get the path of the dex implementation jar from the `deapexer` module. di := ctx.OtherModuleProvider(deapexerModule, android.DeapexerProvider).(android.DeapexerInfo) - j.dexJarFile = di.PrebuiltExportPath(j.BaseModuleName(), ".dexjar") - if j.dexJarFile == nil { + if dexOutputPath := di.PrebuiltExportPath(j.BaseModuleName(), ".dexjar"); dexOutputPath != nil { + j.dexJarFile = dexOutputPath + j.hiddenAPI.hiddenAPIExtractInformation(ctx, dexOutputPath, outputFile, primary) + } else { // This should never happen as a variant for a prebuilt_apex is only created if the // prebuilt_apex has been configured to export the java library dex file. ctx.ModuleErrorf("internal error: no dex implementation jar available from prebuilt_apex %q", deapexerModule.Name()) @@ -2961,9 +2966,6 @@ func (j *Import) GenerateAndroidBuildActions(ctx android.ModuleContext) { return } - configurationName := j.BaseModuleName() - primary := j.Prebuilt().UsePrebuilt() - // Hidden API CSV generation and dex encoding dexOutputFile = j.hiddenAPIExtractAndEncode(ctx, configurationName, primary, dexOutputFile, outputFile, proptools.Bool(j.dexProperties.Uncompress_dex)) |