package k5;

import android.content.Context;
import android.net.Uri;
import androidx.slice.Slice;
import androidx.slice.SliceSpec;
import j5.e;
import java.util.ArrayList;
import java.util.List;
import l5.d;

/* loaded from: classes.dex */
public abstract class c {

    /* renamed from: a, reason: collision with root package name */
    private final Slice.a f25413a;

    /* renamed from: b, reason: collision with root package name */
    private final Context f25414b;

    /* renamed from: c, reason: collision with root package name */
    private final d f25415c;

    /* renamed from: d, reason: collision with root package name */
    private List f25416d;

    public c(Context context, Uri uri) {
        this.f25413a = new Slice.a(uri);
        this.f25414b = context;
        this.f25416d = d(uri);
        d e10 = e(uri);
        this.f25415c = e10;
        if (e10 == null) {
            throw new IllegalArgumentException("No valid specs found");
        }
        f(e10);
    }

    private List d(Uri uri) {
        return androidx.slice.c.c() != null ? new ArrayList(androidx.slice.c.c()) : new ArrayList(j5.b.a(this.f25414b).c(uri));
    }

    /* JADX INFO: Access modifiers changed from: protected */
    public boolean a(SliceSpec sliceSpec, Uri uri) {
        int size = this.f25416d.size();
        for (int i10 = 0; i10 < size; i10++) {
            if (((SliceSpec) this.f25416d.get(i10)).a(sliceSpec)) {
                return true;
            }
        }
        return false;
    }

    /* JADX INFO: Access modifiers changed from: protected */
    public Slice.a b() {
        return this.f25413a;
    }

    /* JADX INFO: Access modifiers changed from: protected */
    public j5.a c() {
        return androidx.slice.c.b() != null ? androidx.slice.c.b() : new e();
    }

    protected abstract d e(Uri uri);

    abstract void f(d dVar);
}
