Fix incorrect install path for priv-app prebuilt

Dexpreopted files for privleged app prebuilt(android_app_import) are
installed wrongly to /system/app.
To fix this issue, install path is changed to /system/priv-app
in the case that "privileged" flag is true.

Bug: 144945646
Test: build and check dexpreopted files of privileged app are
      installed to /system/priv-app

Change-Id: Iec140119f58179a3eb0feeff7af2699fcc855fe7
This commit is contained in:
Kyeongkab.Nam 2019-11-22 11:38:16 +09:00
parent bdebb171cc
commit c49971469f
1 changed files with 7 additions and 1 deletions

8
java/app.go Normal file → Executable file
View File

@ -974,7 +974,13 @@ func (a *AndroidAppImport) generateAndroidBuildActions(ctx android.ModuleContext
jnisUncompressed := android.PathForModuleOut(ctx, "jnis-uncompressed", ctx.ModuleName()+".apk")
a.uncompressEmbeddedJniLibs(ctx, srcApk, jnisUncompressed.OutputPath)
installDir := android.PathForModuleInstall(ctx, "app", a.BaseModuleName())
var installDir android.InstallPath
if Bool(a.properties.Privileged) {
installDir = android.PathForModuleInstall(ctx, "priv-app", a.BaseModuleName())
} else {
installDir = android.PathForModuleInstall(ctx, "app", a.BaseModuleName())
}
a.dexpreopter.installPath = installDir.Join(ctx, a.BaseModuleName()+".apk")
a.dexpreopter.isInstallable = true
a.dexpreopter.isPresignedPrebuilt = Bool(a.properties.Presigned)