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

Commit 86c25164 authored by Tony Huang's avatar Tony Huang Committed by android-build-merger
Browse files

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

am: 9d3a7d0c

Change-Id: I0e711980d0a5495ae2d92397e13b27a60002607b
parents a2b8c485 9d3a7d0c
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();
    }