package androidx.core.view;

import android.content.ClipData;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.view.ContentInfo;
import java.util.Objects;

/* loaded from: classes.dex */
public final class d {

    /* renamed from: a, reason: collision with root package name */
    private final f f3817a;

    /* loaded from: classes.dex */
    public static final class a {

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

        public a(ClipData clipData, int i10) {
            if (Build.VERSION.SDK_INT >= 31) {
                this.f3818a = new b(clipData, i10);
            } else {
                this.f3818a = new C0103d(clipData, i10);
            }
        }

        public d a() {
            return this.f3818a.build();
        }

        public a b(Bundle bundle) {
            this.f3818a.setExtras(bundle);
            return this;
        }

        public a c(int i10) {
            this.f3818a.b(i10);
            return this;
        }

        public a d(Uri uri) {
            this.f3818a.a(uri);
            return this;
        }
    }

    /* loaded from: classes.dex */
    private static final class b implements c {

        /* renamed from: a, reason: collision with root package name */
        private final ContentInfo.Builder f3819a;

        b(ClipData clipData, int i10) {
            this.f3819a = androidx.core.view.g.a(clipData, i10);
        }

        @Override // androidx.core.view.d.c
        public void a(Uri uri) {
            this.f3819a.setLinkUri(uri);
        }

        @Override // androidx.core.view.d.c
        public void b(int i10) {
            this.f3819a.setFlags(i10);
        }

        @Override // androidx.core.view.d.c
        public d build() {
            ContentInfo build;
            build = this.f3819a.build();
            return new d(new e(build));
        }

        @Override // androidx.core.view.d.c
        public void setExtras(Bundle bundle) {
            this.f3819a.setExtras(bundle);
        }
    }

    /* loaded from: classes.dex */
    private interface c {
        void a(Uri uri);

        void b(int i10);

        d build();

        void setExtras(Bundle bundle);
    }

    /* renamed from: androidx.core.view.d$d, reason: collision with other inner class name */
    /* loaded from: classes.dex */
    private static final class C0103d implements c {

        /* renamed from: a, reason: collision with root package name */
        ClipData f3820a;

        /* renamed from: b, reason: collision with root package name */
        int f3821b;

        /* renamed from: c, reason: collision with root package name */
        int f3822c;

        /* renamed from: d, reason: collision with root package name */
        Uri f3823d;

        /* renamed from: e, reason: collision with root package name */
        Bundle f3824e;

        C0103d(ClipData clipData, int i10) {
            this.f3820a = clipData;
            this.f3821b = i10;
        }

        @Override // androidx.core.view.d.c
        public void a(Uri uri) {
            this.f3823d = uri;
        }

        @Override // androidx.core.view.d.c
        public void b(int i10) {
            this.f3822c = i10;
        }

        @Override // androidx.core.view.d.c
        public d build() {
            return new d(new g(this));
        }

        @Override // androidx.core.view.d.c
        public void setExtras(Bundle bundle) {
            this.f3824e = bundle;
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    /* loaded from: classes.dex */
    public static final class e implements f {

        /* renamed from: a, reason: collision with root package name */
        private final ContentInfo f3825a;

        e(ContentInfo contentInfo) {
            this.f3825a = androidx.core.view.c.a(s3.i.g(contentInfo));
        }

        @Override // androidx.core.view.d.f
        public ClipData a() {
            ClipData clip;
            clip = this.f3825a.getClip();
            return clip;
        }

        @Override // androidx.core.view.d.f
        public int b() {
            int flags;
            flags = this.f3825a.getFlags();
            return flags;
        }

        @Override // androidx.core.view.d.f
        public ContentInfo c() {
            return this.f3825a;
        }

        @Override // androidx.core.view.d.f
        public int getSource() {
            int source;
            source = this.f3825a.getSource();
            return source;
        }

        public String toString() {
            return "ContentInfoCompat{" + this.f3825a + "}";
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    /* loaded from: classes.dex */
    public interface f {
        ClipData a();

        int b();

        ContentInfo c();

        int getSource();
    }

    /* loaded from: classes.dex */
    private static final class g implements f {

        /* renamed from: a, reason: collision with root package name */
        private final ClipData f3826a;

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

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

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

        /* renamed from: e, reason: collision with root package name */
        private final Bundle f3830e;

        g(C0103d c0103d) {
            this.f3826a = (ClipData) s3.i.g(c0103d.f3820a);
            this.f3827b = s3.i.c(c0103d.f3821b, 0, 5, "source");
            this.f3828c = s3.i.f(c0103d.f3822c, 1);
            this.f3829d = c0103d.f3823d;
            this.f3830e = c0103d.f3824e;
        }

        @Override // androidx.core.view.d.f
        public ClipData a() {
            return this.f3826a;
        }

        @Override // androidx.core.view.d.f
        public int b() {
            return this.f3828c;
        }

        @Override // androidx.core.view.d.f
        public ContentInfo c() {
            return null;
        }

        @Override // androidx.core.view.d.f
        public int getSource() {
            return this.f3827b;
        }

        public String toString() {
            String str;
            StringBuilder sb2 = new StringBuilder();
            sb2.append("ContentInfoCompat{clip=");
            sb2.append(this.f3826a.getDescription());
            sb2.append(", source=");
            sb2.append(d.e(this.f3827b));
            sb2.append(", flags=");
            sb2.append(d.a(this.f3828c));
            if (this.f3829d == null) {
                str = "";
            } else {
                str = ", hasLinkUri(" + this.f3829d.toString().length() + ")";
            }
            sb2.append(str);
            sb2.append(this.f3830e != null ? ", hasExtras" : "");
            sb2.append("}");
            return sb2.toString();
        }
    }

    d(f fVar) {
        this.f3817a = fVar;
    }

    static String a(int i10) {
        return (i10 & 1) != 0 ? "FLAG_CONVERT_TO_PLAIN_TEXT" : String.valueOf(i10);
    }

    static String e(int i10) {
        return i10 != 0 ? i10 != 1 ? i10 != 2 ? i10 != 3 ? i10 != 4 ? i10 != 5 ? String.valueOf(i10) : "SOURCE_PROCESS_TEXT" : "SOURCE_AUTOFILL" : "SOURCE_DRAG_AND_DROP" : "SOURCE_INPUT_METHOD" : "SOURCE_CLIPBOARD" : "SOURCE_APP";
    }

    public static d g(ContentInfo contentInfo) {
        return new d(new e(contentInfo));
    }

    public ClipData b() {
        return this.f3817a.a();
    }

    public int c() {
        return this.f3817a.b();
    }

    public int d() {
        return this.f3817a.getSource();
    }

    public ContentInfo f() {
        ContentInfo c10 = this.f3817a.c();
        Objects.requireNonNull(c10);
        return androidx.core.view.c.a(c10);
    }

    public String toString() {
        return this.f3817a.toString();
    }
}
