mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-16 16:16:04 -04:00
Fix[file_provider]: check for storage before initializing
This commit is contained in:
parent
097282507b
commit
2a44e8da69
@ -47,7 +47,7 @@ public class FolderProvider extends DocumentsProvider {
|
||||
|
||||
private static final String ALL_MIME_TYPES = "*/*";
|
||||
|
||||
private static final File BASE_DIR = new File(Tools.DIR_GAME_HOME);
|
||||
private File BASE_DIR;
|
||||
|
||||
private ContentResolver mContentResolver;
|
||||
|
||||
@ -138,6 +138,12 @@ public class FolderProvider extends DocumentsProvider {
|
||||
|
||||
@Override
|
||||
public boolean onCreate() {
|
||||
if(Tools.checkStorageRoot(getContext())) {
|
||||
Tools.initStorageConstants(getContext());
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
BASE_DIR = new File(Tools.DIR_GAME_HOME);
|
||||
mContentResolver = getContext().getContentResolver();
|
||||
mStorageProviderAuthortiy = getContext().getString(R.string.storageProviderAuthorities);
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user