Shared OBB storage across users.

To avoid downloading large OBB files separately for each user,
provide a shared view of /sdcard/Android/obb to all apps.  Added
upgrade step to migrate the owners existing OBB files to become
the default view.

Bug: 7008879
Change-Id: I199321552fa7d4b97d5ed7fc3b3bc41f23618601
diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c
index a52f74a..ab64747 100644
--- a/cmds/installd/commands.c
+++ b/cmds/installd/commands.c
@@ -241,7 +241,6 @@
 {
     char src_data_dir[PKG_PATH_MAX];
     char pkg_path[PKG_PATH_MAX];
-    char media_path[PATH_MAX];
     DIR *d;
     struct dirent *de;
     struct stat s;
@@ -250,9 +249,6 @@
     if (create_persona_path(src_data_dir, src_persona)) {
         return -1;
     }
-    if (create_persona_media_path(media_path, (userid_t) target_persona) == -1) {
-        return -1;
-    }
 
     d = opendir(src_data_dir);
     if (d != NULL) {
@@ -281,10 +277,10 @@
         closedir(d);
     }
 
-    // ensure /data/media/<user_id> exists
-    if (ensure_dir(media_path, 0770, AID_MEDIA_RW, AID_MEDIA_RW) == -1) {
+    if (ensure_media_user_dirs((userid_t) target_persona) == -1) {
         return -1;
     }
+
     return 0;
 }