Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9d3a7d0c authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix crash bug on RefreshTask" into qt-dev

parents db7aabc3 26c37932
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ package com.android.documentsui;

import static com.android.documentsui.base.SharedMinimal.DEBUG;

import androidx.annotation.Nullable;
import android.content.ContentProviderClient;
import android.content.ContentResolver;
import android.content.Context;
@@ -27,6 +26,8 @@ import android.os.CancellationSignal;
import android.os.FileUtils;
import android.util.Log;

import androidx.annotation.Nullable;

import com.android.documentsui.base.ApplicationScope;
import com.android.documentsui.base.BooleanConsumer;
import com.android.documentsui.base.CheckedTask;
@@ -74,6 +75,11 @@ public class RefreshTask extends TimeoutTask<Void, Boolean> {
            return false;
        }

        if (mDoc.derivedUri == null) {
            Log.w(TAG, "Ignoring attempt to refresh due to null derived uri in DocumentInfo.");
            return false;
        }

        if (!mDoc.derivedUri.equals(mState.stack.peek().derivedUri)) {
            Log.w(TAG, "Ignoring attempt to refresh on a non-top-level uri.");
            return false;
+1 −2
Original line number Diff line number Diff line
@@ -406,8 +406,7 @@ public class DocumentInfo implements Durable, Parcelable {
        }

        if (doc.derivedUri == null) {
            doc.deriveFields();
            assert(doc.derivedUri != null);
            return "<DocumentInfo null derivedUri>";
        }
        return doc.derivedUri.toString();
    }