From 20705fdb10a0d1b50bb771299dca6b069d61d11d Mon Sep 17 00:00:00 2001 From: Adrian Roos Date: Wed, 28 Apr 2021 15:15:24 +0000 Subject: [PATCH] Revert "Fixup app-private dirs that are not writable." This reverts commit 13f793aec9c47a295a105d611e422a3a682aedfe. Reason for revert: Breaks device health checks; crashes if dir is null. Bug: 181726193 Bug: 182088154 Fixes: 186633787 Change-Id: Ia28df79c6ff4aacd6bdadf1d9c540f49dcace707 --- core/java/android/app/ContextImpl.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java index 7f7288b89c861..656942d315ccd 100644 --- a/core/java/android/app/ContextImpl.java +++ b/core/java/android/app/ContextImpl.java @@ -3273,13 +3273,6 @@ 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;