Loading core/java/android/app/ContextImpl.java +23 −12 Original line number Original line Diff line number Diff line Loading @@ -817,6 +817,10 @@ class ContextImpl extends Context { } } if (!mFilesDir.exists()) { if (!mFilesDir.exists()) { if(!mFilesDir.mkdirs()) { if(!mFilesDir.mkdirs()) { if (mFilesDir.exists()) { // spurious failure; probably racing with another process for this app return mFilesDir; } Log.w(TAG, "Unable to create files directory " + mFilesDir.getPath()); Log.w(TAG, "Unable to create files directory " + mFilesDir.getPath()); return null; return null; } } Loading Loading @@ -879,6 +883,10 @@ class ContextImpl extends Context { } } if (!mCacheDir.exists()) { if (!mCacheDir.exists()) { if(!mCacheDir.mkdirs()) { if(!mCacheDir.mkdirs()) { if (mCacheDir.exists()) { // spurious failure; probably racing with another process for this app return mCacheDir; } Log.w(TAG, "Unable to create cache directory " + mCacheDir.getAbsolutePath()); Log.w(TAG, "Unable to create cache directory " + mCacheDir.getAbsolutePath()); return null; return null; } } Loading Loading @@ -2136,6 +2144,8 @@ class ContextImpl extends Context { File dir = dirs[i]; File dir = dirs[i]; if (!dir.exists()) { if (!dir.exists()) { if (!dir.mkdirs()) { if (!dir.mkdirs()) { // recheck existence in case of cross-process race if (!dir.exists()) { // Failing to mkdir() may be okay, since we might not have // Failing to mkdir() may be okay, since we might not have // enough permissions; ask vold to create on our behalf. // enough permissions; ask vold to create on our behalf. final IMountService mount = IMountService.Stub.asInterface( final IMountService mount = IMountService.Stub.asInterface( Loading @@ -2151,6 +2161,7 @@ class ContextImpl extends Context { } } } } } } } result[i] = dir; result[i] = dir; } } return result; return result; Loading Loading
core/java/android/app/ContextImpl.java +23 −12 Original line number Original line Diff line number Diff line Loading @@ -817,6 +817,10 @@ class ContextImpl extends Context { } } if (!mFilesDir.exists()) { if (!mFilesDir.exists()) { if(!mFilesDir.mkdirs()) { if(!mFilesDir.mkdirs()) { if (mFilesDir.exists()) { // spurious failure; probably racing with another process for this app return mFilesDir; } Log.w(TAG, "Unable to create files directory " + mFilesDir.getPath()); Log.w(TAG, "Unable to create files directory " + mFilesDir.getPath()); return null; return null; } } Loading Loading @@ -879,6 +883,10 @@ class ContextImpl extends Context { } } if (!mCacheDir.exists()) { if (!mCacheDir.exists()) { if(!mCacheDir.mkdirs()) { if(!mCacheDir.mkdirs()) { if (mCacheDir.exists()) { // spurious failure; probably racing with another process for this app return mCacheDir; } Log.w(TAG, "Unable to create cache directory " + mCacheDir.getAbsolutePath()); Log.w(TAG, "Unable to create cache directory " + mCacheDir.getAbsolutePath()); return null; return null; } } Loading Loading @@ -2136,6 +2144,8 @@ class ContextImpl extends Context { File dir = dirs[i]; File dir = dirs[i]; if (!dir.exists()) { if (!dir.exists()) { if (!dir.mkdirs()) { if (!dir.mkdirs()) { // recheck existence in case of cross-process race if (!dir.exists()) { // Failing to mkdir() may be okay, since we might not have // Failing to mkdir() may be okay, since we might not have // enough permissions; ask vold to create on our behalf. // enough permissions; ask vold to create on our behalf. final IMountService mount = IMountService.Stub.asInterface( final IMountService mount = IMountService.Stub.asInterface( Loading @@ -2151,6 +2161,7 @@ class ContextImpl extends Context { } } } } } } } result[i] = dir; result[i] = dir; } } return result; return result; Loading