diff options
| author | 2021-12-01 13:04:46 -0800 | |
|---|---|---|
| committer | 2022-05-17 13:15:39 -0700 | |
| commit | 61df14acce0c642f18730eefff5ebd20ee1463dc (patch) | |
| tree | 271807dd619d263816d1b5c424c5dcc5ff7f51e0 /java/java.go | |
| parent | f2d126b3d8d2d60fcc8c844cb1629382b34a675e (diff) | |
Don't call dexpreopter methods on host modules
Only call the dexpreopter methods on device modules so broken
dexpreopt configs don't break host-only unbundled builds.
Bug: 207813628
Test: tradefed branch builds
Change-Id: I41deb765a29c5cef9130a4d26aad7f956f75cdd5
Diffstat (limited to 'java/java.go')
| -rw-r--r-- | java/java.go | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/java/java.go b/java/java.go index 13f4c807e..160bb7637 100644 --- a/java/java.go +++ b/java/java.go @@ -592,12 +592,14 @@ func (j *Library) GenerateAndroidBuildActions(ctx android.ModuleContext) { } j.checkSdkVersions(ctx) - j.dexpreopter.installPath = j.dexpreopter.getInstallPath( - ctx, android.PathForModuleInstall(ctx, "framework", j.Stem()+".jar")) - j.dexpreopter.isSDKLibrary = j.deviceProperties.IsSDKLibrary - setUncompressDex(ctx, &j.dexpreopter, &j.dexer) - j.dexpreopter.uncompressedDex = *j.dexProperties.Uncompress_dex - j.classLoaderContexts = j.usesLibrary.classLoaderContextForUsesLibDeps(ctx) + if ctx.Device() { + j.dexpreopter.installPath = j.dexpreopter.getInstallPath( + ctx, android.PathForModuleInstall(ctx, "framework", j.Stem()+".jar")) + j.dexpreopter.isSDKLibrary = j.deviceProperties.IsSDKLibrary + setUncompressDex(ctx, &j.dexpreopter, &j.dexer) + j.dexpreopter.uncompressedDex = *j.dexProperties.Uncompress_dex + j.classLoaderContexts = j.usesLibrary.classLoaderContextForUsesLibDeps(ctx) + } j.compile(ctx, nil) // Collect the module directory for IDE info in java/jdeps.go. |