Dedup checks for module being in versioned sdk snapshot
Previously, various places duplicated the logic to check whether a
module was part of a versioned snapshot. This change replaces that code
with a call to the existing IsModuleInVersionedSdk(Module) func.
This makes the code consistent in preparation for a change that will
remove all calls to IsModuleInVersionedSdk(Module). It is separated out
from that change as it is easier to see that the replaced code is
equivalent to the IsModuleInVersionedSdk(Module) func when it is not
mixed in with other changes. It also makes the following change easier
to review.
Bug: 260237150
Test: m nothing
Change-Id: I44d665bf02d2fc97632a03b5a3d2225ea3c2827d
diff --git a/java/androidmk.go b/java/androidmk.go
index 42b4ef1..e37a90e 100644
--- a/java/androidmk.go
+++ b/java/androidmk.go
@@ -200,7 +200,7 @@
dexpreoptEntries := prebuilt.dexpreopter.AndroidMkEntriesForApex()
return append(dexpreoptEntries, android.AndroidMkEntries{Disabled: true})
}
- if !prebuilt.ContainingSdk().Unversioned() {
+ if android.IsModuleInVersionedSdk(prebuilt) {
return []android.AndroidMkEntries{android.AndroidMkEntries{
Disabled: true,
}}