Merge "Make start/stop warn if you're not root."
diff --git a/adb/adb.cpp b/adb/adb.cpp
index ff6a499..371525c 100644
--- a/adb/adb.cpp
+++ b/adb/adb.cpp
@@ -190,6 +190,13 @@
 }
 
 void adb_trace_init(char** argv) {
+    // Don't open log file if no tracing, since this will block
+    // the crypto unmount of /data
+    const std::string trace_setting = get_trace_setting();
+    if (trace_setting.empty()) {
+        return;
+    }
+
 #if !ADB_HOST
     if (isatty(STDOUT_FILENO) == 0) {
         start_device_log();
diff --git a/adb/tests/test_adb.py b/adb/tests/test_adb.py
index 0be1efc..730f668 100755
--- a/adb/tests/test_adb.py
+++ b/adb/tests/test_adb.py
@@ -249,7 +249,8 @@
 
     def _test_root(self):
         adb = AdbWrapper()
-        adb.root()
+        if "adbd cannot run as root in production builds" in adb.root():
+            return
         adb.wait()
         self.assertEqual("root", adb.shell("id -un").strip())
 
@@ -317,16 +318,13 @@
 
         Bug: http://b/19735063
         """
-        output = AdbWrapper().shell("uname");
+        output = AdbWrapper().shell("uname")
         if sys.platform == 'win32':
             # adb.exe running on Windows does translation to the Windows \r\n
             # convention, so we should expect those chars.
-            self.assertTrue(output.endswith("\r\n"));
-            # If the server outputs \r\n and adb.exe translates that to \r\r\n
-            # we want to catch that server problem.
-            self.assertFalse(output.endswith("\r\r\n"));
+            self.assertEqual(output, "Linux\r\n")
         else:
-            self.assertFalse(output.endswith("\r\n"))
+            self.assertEqual(output, "Linux\n")
 
 
 class AdbFile(unittest.TestCase):