From 2ee3c1e189819cc6efb4d7de24f1438bdb824087 Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Fri, 30 May 2014 15:38:35 -0700 Subject: Per-app media directories on external storage. This change defines per-app directories on external storage that will be scanned and included in MediaStore. This gives apps a way to write content to secondary shared storage in a way that can easily be surfaced to other apps. Bug: 14382377 Change-Id: I4cb367c870509e76f0c2c598f01e2f699780030a --- services/core/java/com/android/server/MountService.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'services') diff --git a/services/core/java/com/android/server/MountService.java b/services/core/java/com/android/server/MountService.java index d5f045e..d31fb60 100644 --- a/services/core/java/com/android/server/MountService.java +++ b/services/core/java/com/android/server/MountService.java @@ -2372,6 +2372,18 @@ class MountService extends IMountService.Stub } } + voldPath = maybeTranslatePathForVold(appPath, + userEnv.buildExternalStorageAppMediaDirs(callingPkg), + userEnv.buildExternalStorageAppMediaDirsForVold(callingPkg)); + if (voldPath != null) { + try { + mConnector.execute("volume", "mkdirs", voldPath); + return 0; + } catch (NativeDaemonConnectorException e) { + return e.getCode(); + } + } + throw new SecurityException("Invalid mkdirs path: " + appPath); } -- cgit v1.1