From cbe2ba04b771fb22f6d58a29bf43bc7ba55e7012 Mon Sep 17 00:00:00 2001 From: Kiyoung Kim Date: Thu, 7 Sep 2023 16:00:04 +0900 Subject: [PATCH] Temporarily link Vendor APEX with vendor libbinder when VNDK deprecated As VNDK is in deprecation, any Vendor APEX which used use_vndk_as_stable should copy former-VNDK libraries into its own APEX. However, libbinder is not allowed to create APEX variant, so it should use libbinder_ndk instead. This change is to temporalily allow Vendor APEX modules link with libbinder in /vendor/lib, while any Vendor APEX modules using libbinder transit into libbinder_ndk. Bug: 296491928 Test: Cheetah build and boot succeeded Change-Id: I40beb255bab658b75685e78f48e14520058616d6 --- apex/apex.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/apex/apex.go b/apex/apex.go index 1e65b0ffe..3858d3155 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -18,6 +18,7 @@ package apex import ( "fmt" + "log" "path/filepath" "regexp" "sort" @@ -991,6 +992,13 @@ func (a *apexBundle) ApexInfoMutator(mctx android.TopDownMutatorContext) { return false } } + + //TODO: b/296491928 Vendor APEX should use libbinder.ndk instead of libbinder once VNDK is fully deprecated. + if useVndk && mctx.Config().IsVndkDeprecated() && child.Name() == "libbinder" { + log.Print("Libbinder is linked from Vendor APEX ", a.Name(), " with module ", parent.Name()) + return false + } + // By default, all the transitive dependencies are collected, unless filtered out // above. return true @@ -2225,6 +2233,11 @@ func (a *apexBundle) depVisitor(vctx *visitorContext, ctx android.ModuleContext, vctx.requireNativeLibs = append(vctx.requireNativeLibs, ":vndk") return false } + + //TODO: b/296491928 Vendor APEX should use libbinder.ndk instead of libbinder once VNDK is fully deprecated. + if ch.UseVndk() && ctx.Config().IsVndkDeprecated() && child.Name() == "libbinder" { + return false + } af := apexFileForNativeLibrary(ctx, ch, vctx.handleSpecialLibs) af.transitiveDep = true