From 4fbbda4cecb078bd3867f416b02cc75f5455284f Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Mon, 24 Sep 2012 18:34:07 -0700 Subject: Handle multi-user mountObb() requests. Since emulated external storage paths differ based on execution context, carefully fix up paths for various use-cases: 1. When sending paths to DefaultContainerService, always scope OBB paths as belonging to USER_OWNER. 2. When sending paths to vold, always build emulated storage paths visible to root. 3. Always use the original untouched path when talking with apps. Mount OBB containers using shared app GID, so that an app can read the mount point across users. Handle legacy paths like "/sdcard" by resolving the canonical path before sending to MountService. Move tests to servicestests, and add tests for new path generation logic. Bug: 7212801 Change-Id: I078c52879cd08d9c8a52cc8c83ac7ced1e8035e7 --- libs/storage/IMountService.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libs/storage') diff --git a/libs/storage/IMountService.cpp b/libs/storage/IMountService.cpp index 4ec8b25..5701678 100644 --- a/libs/storage/IMountService.cpp +++ b/libs/storage/IMountService.cpp @@ -433,12 +433,13 @@ public: reply.readExceptionCode(); } - void mountObb(const String16& filename, const String16& key, + void mountObb(const String16& rawPath, const String16& canonicalPath, const String16& key, const sp& token, int32_t nonce) { Parcel data, reply; data.writeInterfaceToken(IMountService::getInterfaceDescriptor()); - data.writeString16(filename); + data.writeString16(rawPath); + data.writeString16(canonicalPath); data.writeString16(key); data.writeStrongBinder(token->asBinder()); data.writeInt32(nonce); -- cgit v1.1