apex: remove compat symlinks to vndk apex

For R+, symlinks from /system/lib to VNDK APEX are not necessary. (Note
that, symlinks to older VNDK are still necessary because older vendor
may access old locations.)

Hence, do not make symlinks for R+ VNDK APEX.

Bug: 142911355
Test: m # check /system/lib[64]/ for symlinks
        # cf should contain 28/29 symlinks but no symlinks for R
Exempt-From-Owner-Approval: cp from internal
Merged-In: I852fad7edebed3e4edc03c374b3643da6b053fed
Change-Id: I852fad7edebed3e4edc03c374b3643da6b053fed
(cherry picked from commit 84026389e7)
This commit is contained in:
Jooyung Han 2020-04-14 14:22:31 +09:00
parent e5fce6cdbf
commit 055418a56a

View file

@ -16,6 +16,7 @@ package apex
import (
"path/filepath"
"strconv"
"strings"
"sync"
@ -121,10 +122,13 @@ func makeCompatSymlinks(name string, ctx android.ModuleContext) (symlinks []stri
// When all hard-coded references are fixed, remove symbolic links
// Note that we should keep following symlinks for older VNDKs (<=29)
// Since prebuilt vndk libs still depend on system/lib/vndk path
if strings.HasPrefix(name, vndkApexName) {
vndkVersion := ctx.DeviceConfig().PlatformVndkVersion()
if strings.HasPrefix(name, vndkApexNamePrefix) {
vndkVersion = strings.TrimPrefix(name, vndkApexNamePrefix)
if strings.HasPrefix(name, vndkApexNamePrefix) {
vndkVersion := strings.TrimPrefix(name, vndkApexNamePrefix)
if numVer, err := strconv.Atoi(vndkVersion); err != nil {
ctx.ModuleErrorf("apex_vndk should be named as %v<ver:number>: %s", vndkApexNamePrefix, name)
return
} else if numVer > android.SdkVersion_Android10 {
return
}
// the name of vndk apex is formatted "com.android.vndk.v" + version
apexName := vndkApexNamePrefix + vndkVersion