apex: disallow VINTF fragments in updatable APEX
Since libvintf doesn't support forward compatibility, updatable APEXes
shouldn't have VINTF fragments.
Bug: 399527905
Test: m nothing --no-skip-soong-tests
Change-Id: Ie0f1b4599f27d9aa478aac689dd167e77b3733b8
diff --git a/apex/apex.go b/apex/apex.go
index 4dd3d4c..38381ae 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -18,6 +18,7 @@
import (
"fmt"
+ "path"
"path/filepath"
"regexp"
"slices"
@@ -2258,6 +2259,7 @@
a.enforcePartitionTagOnApexSystemServerJar(ctx)
a.verifyNativeImplementationLibs(ctx)
+ a.enforceNoVintfInUpdatable(ctx)
android.SetProvider(ctx, android.ApexBundleDepsDataProvider, android.ApexBundleDepsData{
FlatListPath: a.FlatListPath(),
@@ -2916,3 +2918,16 @@
}
}
}
+
+// TODO(b/399527905) libvintf is not forward compatible.
+func (a *apexBundle) enforceNoVintfInUpdatable(ctx android.ModuleContext) {
+ if !a.Updatable() {
+ return
+ }
+ for _, fi := range a.filesInfo {
+ if match, _ := path.Match("etc/vintf/*", fi.path()); match {
+ ctx.ModuleErrorf("VINTF fragment (%s) is not supported in updatable APEX.", fi.path())
+ break
+ }
+ }
+}