Merge "Support privleged app in APEX"

This commit is contained in:
Treehugger Robot
2019-10-18 01:30:39 +00:00
committed by Gerrit Code Review
4 changed files with 29 additions and 7 deletions

View File

@@ -972,7 +972,11 @@ func getCopyManifestForPrebuiltEtc(prebuilt *android.PrebuiltEtc) (fileToCopy an
}
func getCopyManifestForAndroidApp(app *java.AndroidApp, pkgName string) (fileToCopy android.Path, dirInApex string) {
dirInApex = filepath.Join("app", pkgName)
appDir := "app"
if app.Privileged() {
appDir = "priv-app"
}
dirInApex = filepath.Join(appDir, pkgName)
fileToCopy = app.OutputFile()
return
}

View File

@@ -2232,6 +2232,7 @@ func TestApexWithApps(t *testing.T) {
key: "myapex.key",
apps: [
"AppFoo",
"AppFooPriv",
],
}
@@ -2247,6 +2248,14 @@ func TestApexWithApps(t *testing.T) {
sdk_version: "none",
system_modules: "none",
}
android_app {
name: "AppFooPriv",
srcs: ["foo/bar/MyClass.java"],
sdk_version: "none",
system_modules: "none",
privileged: true,
}
`)
module := ctx.ModuleForTests("myapex", "android_common_myapex")
@@ -2254,6 +2263,7 @@ func TestApexWithApps(t *testing.T) {
copyCmds := apexRule.Args["copy_commands"]
ensureContains(t, copyCmds, "image.apex/app/AppFoo/AppFoo.apk")
ensureContains(t, copyCmds, "image.apex/priv-app/AppFooPriv/AppFooPriv.apk")
}