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

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

Merge "Allow onGetSliceDescendants to be slow" into pi-dev

parents 78f939b4 a66dfee8
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.annotation.Nullable;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
import android.annotation.SystemService;
import android.annotation.WorkerThread;
import android.content.ContentProviderClient;
import android.content.ContentResolver;
import android.content.Context;
@@ -217,6 +218,7 @@ public class SliceManager {
     * @return All slices within the space.
     * @see SliceProvider#onGetSliceDescendants(Uri)
     */
    @WorkerThread
    public @NonNull Collection<Uri> getSliceDescendants(@NonNull Uri uri) {
        ContentResolver resolver = mContext.getContentResolver();
        try (ContentProviderClient provider = resolver.acquireContentProviderClient(uri)) {
+1 −6
Original line number Diff line number Diff line
@@ -398,12 +398,7 @@ public abstract class SliceProvider extends ContentProvider {

    private Collection<Uri> handleGetDescendants(Uri uri) {
        mCallback = "onGetSliceDescendants";
        Handler.getMain().postDelayed(mAnr, SLICE_BIND_ANR);
        try {
        return onGetSliceDescendants(uri);
        } finally {
            Handler.getMain().removeCallbacks(mAnr);
        }
    }

    private void handlePinSlice(Uri sliceUri) {