Skip to content

Commit

Permalink
Fix Android 11 storage redirect
Browse files Browse the repository at this point in the history
Android 11 must enable storage redirect or crash
  • Loading branch information
梁丽欣 authored Feb 24, 2021
1 parent dfa1862 commit 13e6157
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,8 @@ private void startIOUniformer() {
private void setupVirtualStorage(ApplicationInfo info, int userId) {
VirtualStorageManager vsManager = VirtualStorageManager.get();
boolean enable = vsManager.isVirtualStorageEnable(info.packageName, userId);
if (!enable) {
// Android 11, force enable storage redirect.
if (!enable && !(Build.VERSION.SDK_INT >= 30)) {
// There are lots of situation to deal, I am tired, disable it now.
// such as: FileProvider.
return;
Expand Down

0 comments on commit 13e6157

Please sign in to comment.