vold: Make asec sdcard dir a hidden dir

Signed-off-by: San Mehat <san@google.com>
diff --git a/Volume.cpp b/Volume.cpp
index cd91a9f..83c1c0e 100644
--- a/Volume.cpp
+++ b/Volume.cpp
@@ -61,7 +61,7 @@
  * asec imagefiles. This path will be obscured before the mount is
  * exposed to non priviledged users.
  */
-const char *Volume::SEC_STG_SECIMGDIR = "/mnt/secure/staging/android_secure";
+const char *Volume::SEC_STG_SECIMGDIR = "/mnt/secure/staging/.android_secure";
 
 /*
  * Path to where *only* root can access asec imagefiles
@@ -329,6 +329,16 @@
     unsigned long flags;
 
     /*
+     * Rename old /android_secure -> /.android_secure
+     */
+    if (!access("/mnt/secure/staging/android_secure", R_OK | X_OK) &&
+         access(SEC_STG_SECIMGDIR, R_OK | X_OK)) {
+        if (rename("/mnt/secure/staging/android_secure", SEC_STG_SECIMGDIR)) {
+            LOGE("Failed to rename legacy asec dir (%s)", strerror(errno));
+        }
+    }
+
+    /*
      * Ensure that /android_secure exists and is a directory
      */
     if (access(SEC_STG_SECIMGDIR, R_OK | X_OK)) {