Merge "Fix bug where group IDs were not being assigned during boot."
diff --git a/api/current.xml b/api/current.xml
index 58ce3ee..4af2a43 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -88413,7 +88413,7 @@
  static="true"
  final="false"
  deprecated="not deprecated"
- visibility="private"
+ visibility="public"
 >
 <method name="startDownloadByUri"
  return="long"
diff --git a/core/java/android/content/ContentValues.java b/core/java/android/content/ContentValues.java
index c04625d..75787cd 100644
--- a/core/java/android/content/ContentValues.java
+++ b/core/java/android/content/ContentValues.java
@@ -66,7 +66,7 @@
      * Creates a set of values copied from the given HashMap. This is used
      * by the Parcel unmarshalling code.
      *
-     * @param from the values to start with
+     * @param values the values to start with
      * {@hide}
      */
     private ContentValues(HashMap<String, Object> values) {
@@ -248,7 +248,7 @@
      */
     public String getAsString(String key) {
         Object value = mValues.get(key);
-        return value != null ? mValues.get(key).toString() : null;
+        return value != null ? value.toString() : null;
     }
 
     /**
diff --git a/core/java/android/net/Downloads.java b/core/java/android/net/Downloads.java
index 72106c8..3867385 100644
--- a/core/java/android/net/Downloads.java
+++ b/core/java/android/net/Downloads.java
@@ -469,7 +469,7 @@
     /**
      * Base class with common functionality for the various download classes
      */
-    private static class DownloadBase {
+    public static class DownloadBase {
         /** @hide */
         DownloadBase() {}
 
diff --git a/services/java/com/android/server/MountService.java b/services/java/com/android/server/MountService.java
index a4703de..10920fa 100644
--- a/services/java/com/android/server/MountService.java
+++ b/services/java/com/android/server/MountService.java
@@ -100,6 +100,7 @@
         public static final int OpFailedMediaCorrupt           = 403;
         public static final int OpFailedVolNotMounted          = 404;
         public static final int OpFailedStorageBusy            = 405;
+        public static final int OpFailedStorageNotFound        = 406;
 
         /*
          * 600 series - Unsolicited broadcasts.
@@ -1290,21 +1291,22 @@
         waitForReady();
         warnOnNotMounted();
 
-        ArrayList<String> rsp = mConnector.doCommand("asec path " + id);
-
-        for (String line : rsp) {
-            String []tok = line.split(" ");
+        try {
+            ArrayList<String> rsp = mConnector.doCommand(String.format("asec path %s", id));
+            String []tok = rsp.get(0).split(" ");
             int code = Integer.parseInt(tok[0]);
-            if (code == VoldResponseCode.AsecPathResult) {
-                return tok[1];
+            if (code != VoldResponseCode.AsecPathResult) {
+                throw new IllegalStateException(String.format("Unexpected response code %d", code));
+            }
+            return tok[1];
+        } catch (NativeDaemonConnectorException e) {
+            int code = e.getCode();
+            if (code == VoldResponseCode.OpFailedStorageNotFound) {
+                throw new IllegalArgumentException(String.format("Container '%s' not found", id));
             } else {
-                Log.e(TAG, String.format("Unexpected response code %d", code));
-                return "";
+                throw new IllegalStateException(String.format("Unexpected response code %d", code));
             }
         }
-
-        Log.e(TAG, "Got an empty response");
-        return "";
     }
 
     public void finishMediaUpdate() {
diff --git a/tests/AndroidTests/src/com/android/unit_tests/AsecTests.java b/tests/AndroidTests/src/com/android/unit_tests/AsecTests.java
index 9aed363..9a75047 100755
--- a/tests/AndroidTests/src/com/android/unit_tests/AsecTests.java
+++ b/tests/AndroidTests/src/com/android/unit_tests/AsecTests.java
@@ -259,6 +259,17 @@
         }
     }
 
+    public void testNonExistPath() {
+        IMountService ms = getMs();
+        try {
+            String path = ms.getSecureContainerPath("jparks.broke.it");
+            failStr(path);
+        } catch (IllegalArgumentException e) {
+        } catch (Exception e) {
+            failStr(e);
+        }
+    }
+
     public void testUnmountBusyContainer() {
         IMountService ms = getMs();
         try {
diff --git a/tests/LocationTracker/src/com/android/locationtracker/TrackerService.java b/tests/LocationTracker/src/com/android/locationtracker/TrackerService.java
index 5b75653..e2332bf 100644
--- a/tests/LocationTracker/src/com/android/locationtracker/TrackerService.java
+++ b/tests/LocationTracker/src/com/android/locationtracker/TrackerService.java
@@ -193,11 +193,11 @@
     }
 
     private boolean doDebugLogging() {
-        return getPreferences().getBoolean(DEBUG_PREF, true);
+        return getPreferences().getBoolean(DEBUG_PREF, false);
     }
 
     private boolean trackSignalStrength() {
-        return getPreferences().getBoolean(SIGNAL_PREF, true);
+        return getPreferences().getBoolean(SIGNAL_PREF, false);
     }
 
     private float getLocationMinDistance() {