Add compat symlinks for prebuilt_apex

When prebuilt_apex overrides/replaces other apex, the same symlinks need
to be created as well.

Bug: 143192278
Test: 1. add prebuilt_apex with vndk apex
         with overrides set as ["com.android.vndk.current"]
      2. m <prebuilt apex>
      3. check if vndk symlinks are created

Change-Id: I8ee9c981ea9c7202ccf5143b3f43e6848773cd63
This commit is contained in:
Jooyung Han
2020-01-08 01:57:58 +09:00
parent 17cf0ab3bc
commit 002ab687ac
3 changed files with 30 additions and 11 deletions

View File

@@ -522,9 +522,9 @@ type apexBundle struct {
manifestJsonOut android.WritablePath
manifestPbOut android.WritablePath
// list of commands to create symlinks for backward compatibility
// list of commands to create symlinks for backward compatibility.
// these commands will be attached as LOCAL_POST_INSTALL_CMD to
// apex package itself(for unflattened build) or apex_manifest.json(for flattened build)
// apex package itself(for unflattened build) or apex_manifest(for flattened build)
// so that compat symlinks are always installed regardless of TARGET_FLATTEN_APEX setting.
compatSymlinks []string
@@ -1236,8 +1236,7 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
a.buildUnflattenedApex(ctx)
}
apexName := proptools.StringDefault(a.properties.Apex_name, a.Name())
a.compatSymlinks = makeCompatSymlinks(apexName, ctx)
a.compatSymlinks = makeCompatSymlinks(a.BaseModuleName(), ctx)
}
func newApexBundle() *apexBundle {