mirror of
https://github.com/nextcloud/android.git
synced 2024-11-24 14:15:44 +03:00
fix lint warnings
Signed-off-by: Jens Mueller <tschenser@gmx.de>
This commit is contained in:
parent
dddffce2a1
commit
fbff63bb02
2 changed files with 13 additions and 9 deletions
|
@ -179,7 +179,7 @@ public class DocumentsStorageProvider extends DocumentsProvider {
|
|||
|
||||
boolean isLoading = false;
|
||||
if (parentFolder.isExpired()) {
|
||||
final LoadChildrenTask task = new LoadChildrenTask(parentFolder, getContext(), loadChildrenCallback);
|
||||
final LoadChildrenTask task = new LoadChildrenTask(parentFolder, loadChildrenCallback);
|
||||
task.executeOnExecutor(executor);
|
||||
resultCursor.setLoadingTask(task);
|
||||
isLoading = true;
|
||||
|
@ -735,12 +735,10 @@ public class DocumentsStorageProvider extends DocumentsProvider {
|
|||
static class LoadChildrenTask extends AsyncTask<Void, Void, RemoteOperationResult> {
|
||||
|
||||
private final Document document;
|
||||
private final Context context;
|
||||
private final OnTaskFinishedCallback<Document> callback;
|
||||
|
||||
LoadChildrenTask(Document document, Context context, OnTaskFinishedCallback<Document> callback) {
|
||||
LoadChildrenTask(Document document, OnTaskFinishedCallback<Document> callback) {
|
||||
this.document = document;
|
||||
this.context = context;
|
||||
this.callback = callback;
|
||||
}
|
||||
|
||||
|
@ -749,7 +747,7 @@ public class DocumentsStorageProvider extends DocumentsProvider {
|
|||
Log.d(TAG, "run RefreshDocumentTask(), id=" + document.getDocumentId());
|
||||
return new RefreshFolderOperation(document.getFile(), System.currentTimeMillis(), false,
|
||||
false, true, document.getStorageManager(), document.getAccount(),
|
||||
context).execute(document.getClient());
|
||||
MainApp.getAppContext()).execute(document.getClient());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -768,9 +766,9 @@ public class DocumentsStorageProvider extends DocumentsProvider {
|
|||
|
||||
public class Document {
|
||||
private final FileDataStorageManager storageManager;
|
||||
private final Long fileId;
|
||||
private final long fileId;
|
||||
|
||||
Document(FileDataStorageManager storageManager, Long fileId) {
|
||||
Document(FileDataStorageManager storageManager, long fileId) {
|
||||
this.storageManager = storageManager;
|
||||
this.fileId = fileId;
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ import android.annotation.TargetApi;
|
|||
import android.content.Context;
|
||||
import android.database.MatrixCursor;
|
||||
import android.os.Build;
|
||||
import android.provider.DocumentsContract;
|
||||
import android.provider.DocumentsContract.Root;
|
||||
|
||||
import com.owncloud.android.R;
|
||||
|
@ -50,12 +51,17 @@ public class RootCursor extends MatrixCursor {
|
|||
|
||||
public void addRoot(DocumentsStorageProvider.Document document, Context context) {
|
||||
Account account = document.getAccount();
|
||||
|
||||
int rootFlags = Root.FLAG_SUPPORTS_CREATE | Root.FLAG_SUPPORTS_RECENTS | Root.FLAG_SUPPORTS_SEARCH;
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
|
||||
rootFlags = rootFlags | Root.FLAG_SUPPORTS_IS_CHILD;
|
||||
}
|
||||
|
||||
newRow().add(Root.COLUMN_ROOT_ID, account.name)
|
||||
.add(Root.COLUMN_DOCUMENT_ID, document.getDocumentId())
|
||||
.add(Root.COLUMN_SUMMARY, account.name)
|
||||
.add(Root.COLUMN_TITLE, context.getString(R.string.app_name))
|
||||
.add(Root.COLUMN_ICON, R.mipmap.ic_launcher)
|
||||
.add(Root.COLUMN_FLAGS, Root.FLAG_SUPPORTS_CREATE | Root.FLAG_SUPPORTS_IS_CHILD |
|
||||
Root.FLAG_SUPPORTS_RECENTS | Root.FLAG_SUPPORTS_SEARCH);
|
||||
.add(Root.COLUMN_FLAGS, rootFlags);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue