use of org.nextcloud.providers.cursors.RootCursor in project android by nextcloud.
the class DocumentsStorageProvider method queryRoots.
@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()) || SettingsActivity.LOCK_DEVICE_CREDENTIALS.equals(preferences.getLockPreference())) {
return new FileCursor();
}
final RootCursor result = new RootCursor(projection);
for (int i = 0; i < rootIdToStorageManager.size(); i++) {
result.addRoot(new Document(rootIdToStorageManager.valueAt(i), ROOT_PATH), getContext());
}
return result;
}
Aggregations