summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorMartijn Coenen <maco@google.com>2021-04-28 09:48:50 +0200
committerMartijn Coenen <maco@google.com>2021-04-28 09:48:50 +0200
commit13f793aec9c47a295a105d611e422a3a682aedfe (patch)
tree8320c2344f7f414bb57bccd353bdd664aacfdd65 /core/java
parent198741831a61dd39776f08d15160ad91704b6ef6 (diff)
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 Change-Id: I7972f79d14893571289a2245f98e90e6c8c69f0a
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/app/ContextImpl.java7
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..7f7288b89c86 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.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;