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

Commit a66dfee8 authored by Jason Monk's avatar Jason Monk
Browse files

Allow onGetSliceDescendants to be slow

Because sometimes it needs to be

Test: existing tests
Bug: 79132845
Bug: 77873463
Change-Id: I93aa8553c48c856bf96c347a229be6e770751708
parent 3b592910
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) {