summaryrefslogtreecommitdiff
path: root/android/apex.go
diff options
context:
space:
mode:
author Yifan Hong <elsk@google.com> 2020-07-28 17:37:46 -0700
committer Yifan Hong <elsk@google.com> 2020-07-30 18:20:37 -0700
commitd22a84a88bf500c29f4d52ff604b64309ba7a0d9 (patch)
tree3a2356fd14500c1f496f70935d037aba3e3f6e0f /android/apex.go
parent4514d96e1856b41581f47363f4797992a7c637de (diff)
Support com.android.gki.* in apex_available.
com.android.gki.* matches any APEX with the prefix com.android.gki., like com.android.gki.bar. Test: use it Bug: 162267963 Change-Id: Ie46fcb08b031611d26b2b6cde157253f51ba9bfc
Diffstat (limited to 'android/apex.go')
-rw-r--r--android/apex.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/android/apex.go b/android/apex.go
index a7570dc54..cd84f8aa5 100644
--- a/android/apex.go
+++ b/android/apex.go
@@ -137,6 +137,7 @@ type ApexProperties struct {
//
// "//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
// "//apex_available:platform" refers to non-APEX partitions like "system.img".
+ // "com.android.gki.*" matches any APEX module name with the prefix "com.android.gki.".
// Default is ["//apex_available:platform"].
Apex_available []string
@@ -213,6 +214,7 @@ func (m *ApexModuleBase) IsInstallableToApex() bool {
const (
AvailableToPlatform = "//apex_available:platform"
AvailableToAnyApex = "//apex_available:anyapex"
+ AvailableToGkiApex = "com.android.gki.*"
)
func CheckAvailableForApex(what string, apex_available []string) bool {
@@ -222,7 +224,8 @@ func CheckAvailableForApex(what string, apex_available []string) bool {
return what == AvailableToPlatform
}
return InList(what, apex_available) ||
- (what != AvailableToPlatform && InList(AvailableToAnyApex, apex_available))
+ (what != AvailableToPlatform && InList(AvailableToAnyApex, apex_available)) ||
+ (strings.HasPrefix(what, "com.android.gki.") && InList(AvailableToGkiApex, apex_available))
}
func (m *ApexModuleBase) AvailableFor(what string) bool {
@@ -256,7 +259,7 @@ func (m *ApexModuleBase) ChooseSdkVersion(versionList []string, maxSdkVersion in
func (m *ApexModuleBase) checkApexAvailableProperty(mctx BaseModuleContext) {
for _, n := range m.ApexProperties.Apex_available {
- if n == AvailableToPlatform || n == AvailableToAnyApex {
+ if n == AvailableToPlatform || n == AvailableToAnyApex || n == AvailableToGkiApex {
continue
}
if !mctx.OtherModuleExists(n) && !mctx.Config().AllowMissingDependencies() {