Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 84026389 authored by Jooyung Han's avatar Jooyung Han
Browse files

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
Change-Id: I852fad7edebed3e4edc03c374b3643da6b053fed
parent be024ad6
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -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)
		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