diff options
Diffstat (limited to 'java/java.go')
| -rw-r--r-- | java/java.go | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/java/java.go b/java/java.go index 7258dcefd..f85de3d77 100644 --- a/java/java.go +++ b/java/java.go @@ -669,6 +669,7 @@ func LibraryHostFactory() android.Module { module.Module.properties.Installable = proptools.BoolPtr(true) android.InitApexModule(module) + android.InitSdkAwareModule(module) InitJavaModule(module, android.HostSupported) return module } @@ -923,6 +924,7 @@ func TestFactory() android.Module { module.Module.dexpreopter.isTest = true module.Module.linter.test = true + android.InitSdkAwareModule(module) InitJavaModule(module, android.HostAndDeviceSupported) return module } @@ -1220,6 +1222,13 @@ func (j *Import) LintDepSets() LintDepSets { return LintDepSets{} } +func (j *Import) getStrictUpdatabilityLinting() bool { + return false +} + +func (j *Import) setStrictUpdatabilityLinting(bool) { +} + func (j *Import) DepsMutator(ctx android.BottomUpMutatorContext) { ctx.AddVariationDependencies(nil, libTag, j.properties.Libs...) @@ -1296,16 +1305,17 @@ func (j *Import) GenerateAndroidBuildActions(ctx android.ModuleContext) { if ai.ForPrebuiltApex { if deapexerModule == nil { // This should never happen as a variant for a prebuilt_apex is only created if the - // deapxer module has been configured to export the dex implementation jar for this module. + // deapexer module has been configured to export the dex implementation jar for this module. ctx.ModuleErrorf("internal error: module %q does not depend on a `deapexer` module for prebuilt_apex %q", j.Name(), ai.ApexVariationName) + return } // Get the path of the dex implementation jar from the `deapexer` module. di := ctx.OtherModuleProvider(deapexerModule, android.DeapexerProvider).(android.DeapexerInfo) if dexOutputPath := di.PrebuiltExportPath(j.BaseModuleName(), ".dexjar"); dexOutputPath != nil { j.dexJarFile = dexOutputPath - j.hiddenAPIExtractInformation(ctx, dexOutputPath, outputFile) + j.hiddenAPIUpdatePaths(ctx, dexOutputPath, outputFile) } 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. @@ -1336,9 +1346,11 @@ func (j *Import) GenerateAndroidBuildActions(ctx android.ModuleContext) { return } - // Hidden API CSV generation and dex encoding - dexOutputFile = j.hiddenAPIExtractAndEncode(ctx, dexOutputFile, outputFile, - proptools.Bool(j.dexProperties.Uncompress_dex)) + // Update hidden API paths. + j.hiddenAPIUpdatePaths(ctx, dexOutputFile, outputFile) + + // Encode hidden API flags in dex file. + dexOutputFile = j.hiddenAPIEncodeDex(ctx, dexOutputFile, proptools.Bool(j.dexProperties.Uncompress_dex)) j.dexJarFile = dexOutputFile } @@ -1542,6 +1554,13 @@ func (j *DexImport) IsInstallable() bool { return true } +func (j *DexImport) getStrictUpdatabilityLinting() bool { + return false +} + +func (j *DexImport) setStrictUpdatabilityLinting(bool) { +} + func (j *DexImport) GenerateAndroidBuildActions(ctx android.ModuleContext) { if len(j.properties.Jars) != 1 { ctx.PropertyErrorf("jars", "exactly one jar must be provided") |