Track down Contexts without data directories.

Data directories for all packages should be created and managed by
installd; if we create a Context and the data directory doesn't exist
yet, we're in trouble, since a later mkdirs() would end up creating
the directory with incorrect permissions, mode, and SELinux labels.

Bug: 28272737
Change-Id: Ie3bb884ab07748719378de5c792046a031a3f945
This commit is contained in:
Jeff Sharkey
2016-04-25 13:20:25 -06:00
parent f07c7b9fd0
commit 24492ae448

View File

@@ -1958,6 +1958,10 @@ class ContextImpl extends Context {
}
if (res != null) {
if (!res.exists()) {
Log.wtf(TAG, "Data directory doesn't exist for package " + getPackageName(),
new Throwable());
}
return res;
} else {
throw new RuntimeException(