diff --git a/java/hiddenapi_singleton.go b/java/hiddenapi_singleton.go index 9627dc64b..b1ddab48d 100644 --- a/java/hiddenapi_singleton.go +++ b/java/hiddenapi_singleton.go @@ -61,7 +61,7 @@ func (h *hiddenAPISingleton) GenerateBuildActions(ctx android.SingletonContext) stubFlagsRule(ctx) // 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) { + if ctx.Config().FrameworksBaseDirExists(ctx) && !ctx.Config().UnbundledBuild() { h.flags = flagsRule(ctx) h.metadata = metadataRule(ctx) } else { diff --git a/java/java.go b/java/java.go index 44830839d..8dbdfb6a7 100644 --- a/java/java.go +++ b/java/java.go @@ -1301,9 +1301,11 @@ func (j *Module) compile(ctx android.ModuleContext, aaptSrcJar android.Path) { return } - // Hidden API CSV generation and dex encoding - dexOutputFile = j.hiddenAPI.hiddenAPI(ctx, dexOutputFile, j.implementationJarFile, - j.deviceProperties.UncompressDex) + if !ctx.Config().UnbundledBuild() { + // Hidden API CSV generation and dex encoding + dexOutputFile = j.hiddenAPI.hiddenAPI(ctx, dexOutputFile, j.implementationJarFile, + j.deviceProperties.UncompressDex) + } // merge dex jar with resources if necessary if j.resourceJar != nil {