diff options
| author | Martijn Coenen <maco@google.com> | 2021-04-28 15:21:54 +0000 |
|---|---|---|
| committer | Martijn Coenen <maco@google.com> | 2021-04-28 15:23:15 +0000 |
| commit | d6b7b6b3aaceb080405ffe1063b7d244aaa5179f (patch) | |
| tree | 86f1a2411d8e88e89c825efd195fd1bd8a20d4b7 /core/java/android | |
| parent | 20705fdb10a0d1b50bb771299dca6b069d61d11d (diff) | |
Revert "Revert "Fixup app-private dirs that are not writable.""
Fixup non-writable app-private dirs that could have been left around by
an earlier race condition in the setup of the FUSE filesystem.
Bug: 181726193
Bug: 182088154
Test: erase userdata, check Youtube dirs are fixed up correctly
Reason for revert: fixing issue in original CL
Change-Id: Ifacf807f62dec3c9e22b5e5af0f2b00c4423ede4
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/app/ContextImpl.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java index 656942d315cc..9ce37e48ce19 100644 --- a/core/java/android/app/ContextImpl.java +++ b/core/java/android/app/ContextImpl.java @@ -3273,6 +3273,13 @@ class ContextImpl extends Context { dir = null; } } + if (dir != null && !dir.canWrite()) { + // Older versions of the MediaProvider mainline module had a rare early boot race + // condition where app-private dirs could be created with the wrong permissions; + // fix this up here. This check should be very fast, because dir.exists() above + // will already have loaded the dentry in the cache. + sm.fixupAppDir(dir); + } result[i] = dir; } return result; |
