Merge "adb: Make HOME=/data/local/tmp"
am: 5358093225

* commit '53580932250c9f3ba4a052c9fe31aa1de7bf411d':
  adb: Make HOME=/data/local/tmp
diff --git a/adb/shell_service.cpp b/adb/shell_service.cpp
index 3fc70b0..6c06669 100644
--- a/adb/shell_service.cpp
+++ b/adb/shell_service.cpp
@@ -289,7 +289,6 @@
         // TODO: $HOSTNAME? Normally bash automatically sets that, but mksh doesn't.
         passwd* pw = getpwuid(getuid());
         if (pw != nullptr) {
-            setenv("HOME", pw->pw_dir, 1);
             setenv("LOGNAME", pw->pw_name, 1);
             setenv("SHELL", pw->pw_shell, 1);
             setenv("USER", pw->pw_name, 1);
@@ -298,6 +297,8 @@
             setenv("TERM", terminal_type_.c_str(), 1);
         }
 
+        setenv("HOME", "/data/local/tmp", 1);
+        chdir(getenv("HOME"));
         if (is_interactive()) {
             execl(_PATH_BSHELL, _PATH_BSHELL, "-", nullptr);
         } else {