diff options
Diffstat (limited to 'core/java/android/app')
| -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; } } |
