Skip to content

Commit

Permalink
Please make it stop...
Browse files Browse the repository at this point in the history
  • Loading branch information
slowscript committed Sep 18, 2022
1 parent a6a2938 commit 6a574f7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/src/main/java/slowscript/warpinator/Transfer.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ private void resolveTreeUri(Uri rootUri, String docId, String parent) {
Uri childrenUri = DocumentsContract.buildChildDocumentsUriUsingTree(rootUri, docId);
ArrayList<MFile> items = resolveUri(childrenUri);
for (MFile f : items) {
if (f.documentID == null)
break; //Provider is broken, what can we do...
f.uri = DocumentsContract.buildDocumentUriUsingTree(rootUri, f.documentID);
f.relPath = parent + "/" + f.name;
if (f.isDirectory) {
Expand All @@ -171,8 +173,10 @@ private ArrayList<MFile> resolveUri(Uri u) {

while (c.moveToNext()) {
MFile f = new MFile();
f.documentID = c.getString(idCol);
f.name = c.getString(nameCol);
if (idCol != -1)
f.documentID = c.getString(idCol);
else Log.w(TAG, "Could not get document ID");
f.name = c.getString(nameCol); //Name is mandatory
if (mimeCol != -1)
f.mime = c.getString(mimeCol);
else {
Expand All @@ -183,7 +187,7 @@ private ArrayList<MFile> resolveUri(Uri u) {
f.lastMod = c.getLong(mTimeCol);
else
f.lastMod = -1;
f.length = c.getLong(sizeCol);
f.length = c.getLong(sizeCol); //Size is mandatory
f.isDirectory = f.mime.endsWith("directory");
f.uri = u;
f.relPath = f.name;
Expand Down

0 comments on commit 6a574f7

Please sign in to comment.