Set download_tmp_dir explicitly to be a directory under the output directory.

This directory is where outputs are download first before being moved
to their final destination to ensure atomicity.

Change-Id: Ic224bf21c07566de00d292d02f1c0f7f727dcb08
diff --git a/ui/build/config.go b/ui/build/config.go
index f80868c..2e5921a 100644
--- a/ui/build/config.go
+++ b/ui/build/config.go
@@ -1349,6 +1349,19 @@
 			return v
 		}
 	}
+	return c.rbeTmpDir()
+}
+
+func (c *configImpl) rbeDownloadTmpDir() string {
+    for _, f := range []string{"RBE_download_tmp_dir", "FLAG_download_tmp_dir"} {
+		if v, ok := c.environ.Get(f); ok {
+			return v
+		}
+	}
+	return c.rbeTmpDir()
+}
+
+func (c *configImpl) rbeTmpDir() string {
 	buildTmpDir := shared.TempDirForOutDir(c.SoongOutDir())
 	return filepath.Join(buildTmpDir, "rbe")
 }