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/java/java.go b/java/java.go
index 839fb01..db1ae05 100644
--- a/java/java.go
+++ b/java/java.go
@@ -442,7 +442,7 @@
 func (j *JavaLibrary) GenerateJavaBuildActions(ctx common.AndroidModuleContext) {
 	j.javaBase.GenerateJavaBuildActions(ctx)
 
-	j.installFile = ctx.InstallFileName("framework", ctx.ModuleName()+".jar", j.outputFile)
+	j.installFile = ctx.InstallFileName(common.PathForModuleInstall(ctx, "framework"), ctx.ModuleName()+".jar", j.outputFile)
 }
 
 func JavaLibraryFactory() (blueprint.Module, []interface{}) {
@@ -479,7 +479,7 @@
 
 	// Depend on the installed jar (j.installFile) so that the wrapper doesn't get executed by
 	// another build rule before the jar has been installed.
-	ctx.InstallFile("bin", common.PathForModuleSrc(ctx, j.binaryProperties.Wrapper),
+	ctx.InstallFile(common.PathForModuleInstall(ctx, "bin"), common.PathForModuleSrc(ctx, j.binaryProperties.Wrapper),
 		j.installFile)
 }
 
@@ -526,7 +526,7 @@
 	j.classpathFile = prebuilt
 	j.classJarSpecs = []jarSpec{classJarSpec}
 	j.resourceJarSpecs = []jarSpec{resourceJarSpec}
-	ctx.InstallFileName("framework", ctx.ModuleName()+".jar", j.classpathFile)
+	ctx.InstallFileName(common.PathForModuleInstall(ctx, "framework"), ctx.ModuleName()+".jar", j.classpathFile)
 }
 
 var _ JavaDependency = (*JavaPrebuilt)(nil)