diff options
| author | Jeff Sharkey <jsharkey@android.com> | 2015-07-13 10:25:31 -0700 |
|---|---|---|
| committer | Jeff Sharkey <jsharkey@android.com> | 2015-07-14 13:08:22 -0700 |
| commit | 983294596e65a0226aa69e42bda9db322727fee5 (patch) | |
| tree | ab022671a4bc954ee32411d57c4eca0d0af5a3e5 /core/java/android/app/ContextImpl.java | |
| parent | 8b6d5b6b6ac3c363ad7aa36873dec1701d33de1e (diff) | |
| download | frameworks_base-983294596e65a0226aa69e42bda9db322727fee5.zip frameworks_base-983294596e65a0226aa69e42bda9db322727fee5.tar.gz frameworks_base-983294596e65a0226aa69e42bda9db322727fee5.tar.bz2 | |
Better handling of storage paths.
Give more details about why we failed to create storage paths, and
search for underlying volumes using canonical paths.
Bug: 22135060
Change-Id: I75d3584403ece310438b05f5b9fe72d94c9096c6
Diffstat (limited to 'core/java/android/app/ContextImpl.java')
| -rw-r--r-- | core/java/android/app/ContextImpl.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java index 6639486..75dd35c 100644 --- a/core/java/android/app/ContextImpl.java +++ b/core/java/android/app/ContextImpl.java @@ -1925,13 +1925,14 @@ class ContextImpl extends Context { // enough permissions; ask vold to create on our behalf. final IMountService mount = IMountService.Stub.asInterface( ServiceManager.getService("mount")); - int res = -1; try { - res = mount.mkdirs(getPackageName(), dir.getAbsolutePath()); - } catch (Exception ignored) { - } - if (res != 0) { - Log.w(TAG, "Failed to ensure directory: " + dir); + final int res = mount.mkdirs(getPackageName(), dir.getAbsolutePath()); + if (res != 0) { + Log.w(TAG, "Failed to ensure " + dir + ": " + res); + dir = null; + } + } catch (Exception e) { + Log.w(TAG, "Failed to ensure " + dir + ": " + e); dir = null; } } |
