Add "updatable" property to ApexModule interface.
For a given variant of a module that implements ApexModule interface,
the "updatable" property tests if this variant comes from an updatable
apex. For platform variants it is always false.
Test: lunch aosp_walleye-userdebug && m nothing
Bug: 138994281
Merged-In: I2d4c54fb397e29dc9b3203be7fb17be4536529f7
Change-Id: I2d4c54fb397e29dc9b3203be7fb17be4536529f7
Exempt-From-Owner-Approval: cp from aosp
(cherry picked from commit 7c140d828a0c0f6126fa60cf87381960649286ff)
diff --git a/android/apex.go b/android/apex.go
index ede0965..9056c3d 100644
--- a/android/apex.go
+++ b/android/apex.go
@@ -33,6 +33,7 @@
ApexName string
MinSdkVersion int
+ Updatable bool
}
// Extracted from ApexModule to make it easier to define custom subsets of the
@@ -116,6 +117,9 @@
// it returns 9 as string
ChooseSdkVersion(versionList []string, maxSdkVersion int) (string, error)
+ // Tests if the module comes from an updatable APEX.
+ Updatable() bool
+
// List of APEXes that this module tests. The module has access to
// the private part of the listed APEXes even when it is not included in the
// APEXes.
@@ -260,6 +264,10 @@
}
}
+func (m *ApexModuleBase) Updatable() bool {
+ return m.ApexProperties.Info.Updatable
+}
+
type byApexName []ApexInfo
func (a byApexName) Len() int { return len(a) }