Refactor install paths
Explicitly allow installation into the data partition instead of using
"../data" for tests. At the same time, pipe through the information
required for vendor modules.
Change-Id: I6baf9d828c285e1080e43074beef8aebdbb38875
diff --git a/common/paths.go b/common/paths.go
index e0d4914..2bbb72c 100644
--- a/common/paths.go
+++ b/common/paths.go
@@ -601,10 +601,20 @@
func PathForModuleInstall(ctx AndroidModuleContext, paths ...string) OutputPath {
var outPaths []string
if ctx.Device() {
- outPaths = []string{"target", "product", ctx.AConfig().DeviceName(), "system"}
+ partition := "system"
+ if ctx.Proprietary() {
+ partition = "vendor"
+ }
+ if ctx.InstallInData() {
+ partition = "data"
+ }
+ outPaths = []string{"target", "product", ctx.AConfig().DeviceName(), partition}
} else {
outPaths = []string{"host", ctx.HostType().String() + "-x86"}
}
+ if ctx.Debug() {
+ outPaths = append([]string{"debug"}, outPaths...)
+ }
outPaths = append(outPaths, paths...)
return PathForOutput(ctx, outPaths...)
}