From 13e919154dcb65a4cb06b6bf434744d08e7fdd28 Mon Sep 17 00:00:00 2001 From: Jooyung Han Date: Thu, 27 Feb 2025 14:30:01 +0900 Subject: 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 --- apex/apex.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'apex/apex.go') diff --git a/apex/apex.go b/apex/apex.go index 4dd3d4cc0..38381aeed 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -18,6 +18,7 @@ package apex import ( "fmt" + "path" "path/filepath" "regexp" "slices" @@ -2258,6 +2259,7 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) { a.enforcePartitionTagOnApexSystemServerJar(ctx) a.verifyNativeImplementationLibs(ctx) + a.enforceNoVintfInUpdatable(ctx) android.SetProvider(ctx, android.ApexBundleDepsDataProvider, android.ApexBundleDepsData{ FlatListPath: a.FlatListPath(), @@ -2916,3 +2918,16 @@ func (a *apexBundle) verifyNativeImplementationLibs(ctx android.ModuleContext) { } } } + +// 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 + } + } +} -- cgit v1.2.3-59-g8ed1b