|
@@ -118,6 +118,10 @@ public class DocumentsStorageProvider extends DocumentsProvider {
|
|
|
@Override
|
|
|
public Cursor queryRoots(String[] projection) {
|
|
|
|
|
|
+ // always recreate storage manager collection, as it will change after account creation/removal
|
|
|
+ // and we need to serve document(tree)s with persist permissions
|
|
|
+ initiateStorageMap();
|
|
|
+
|
|
|
Context context = MainApp.getAppContext();
|
|
|
AppPreferences preferences = AppPreferencesImpl.fromContext(context);
|
|
|
if (SettingsActivity.LOCK_PASSCODE.equals(preferences.getLockPreference()) ||
|
|
@@ -125,8 +129,6 @@ public class DocumentsStorageProvider extends DocumentsProvider {
|
|
|
return new FileCursor();
|
|
|
}
|
|
|
|
|
|
- initiateStorageMap();
|
|
|
-
|
|
|
final RootCursor result = new RootCursor(projection);
|
|
|
for(int i = 0; i < rootIdToStorageManager.size(); i++) {
|
|
|
result.addRoot(new Document(rootIdToStorageManager.valueAt(i), ROOT_PATH), getContext());
|
|
@@ -293,6 +295,11 @@ public class DocumentsStorageProvider extends DocumentsProvider {
|
|
|
@Override
|
|
|
public boolean onCreate() {
|
|
|
accountManager = UserAccountManagerImpl.fromContext(getContext());
|
|
|
+
|
|
|
+ // initiate storage manager collection, because we need to serve document(tree)s
|
|
|
+ // with persist permissions
|
|
|
+ initiateStorageMap();
|
|
|
+
|
|
|
return true;
|
|
|
}
|
|
|
|