package D;

import android.content.res.ColorStateList;
import android.graphics.Bitmap;
import android.graphics.PorterDuff;
import android.os.Bundle;
import android.os.Parcelable;
import androidx.core.graphics.drawable.IconCompat;
import io.flutter.embedding.engine.renderer.FlutterRenderer;
import java.util.Objects;

/* JADX INFO: loaded from: classes.dex */
public final class Y {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public CharSequence f348a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public IconCompat f349b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public String f350c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public String f351d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public boolean f352e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public boolean f353f;

    public static Y a(Bundle bundle) {
        Bundle bundle2 = bundle.getBundle("icon");
        CharSequence charSequence = bundle.getCharSequence("name");
        IconCompat iconCompatA = bundle2 != null ? IconCompat.a(bundle2) : null;
        String string = bundle.getString("uri");
        String string2 = bundle.getString("key");
        boolean z5 = bundle.getBoolean("isBot");
        boolean z6 = bundle.getBoolean("isImportant");
        Y y5 = new Y();
        y5.f348a = charSequence;
        y5.f349b = iconCompatA;
        y5.f350c = string;
        y5.f351d = string2;
        y5.f352e = z5;
        y5.f353f = z6;
        return y5;
    }

    public final Bundle b() {
        Bundle bundle;
        Bundle bundle2 = new Bundle();
        bundle2.putCharSequence("name", this.f348a);
        IconCompat iconCompat = this.f349b;
        if (iconCompat != null) {
            bundle = new Bundle();
            switch (iconCompat.f3930a) {
                case FlutterRenderer.ViewportMetrics.unsetValue /* -1 */:
                    bundle.putParcelable("obj", (Parcelable) iconCompat.f3931b);
                    break;
                case 0:
                default:
                    throw new IllegalArgumentException("Invalid icon");
                case 1:
                case 5:
                    bundle.putParcelable("obj", (Bitmap) iconCompat.f3931b);
                    break;
                case 2:
                case 4:
                case 6:
                    bundle.putString("obj", (String) iconCompat.f3931b);
                    break;
                case 3:
                    bundle.putByteArray("obj", (byte[]) iconCompat.f3931b);
                    break;
            }
            bundle.putInt("type", iconCompat.f3930a);
            bundle.putInt("int1", iconCompat.f3934e);
            bundle.putInt("int2", iconCompat.f3935f);
            bundle.putString("string1", iconCompat.f3938j);
            ColorStateList colorStateList = iconCompat.f3936g;
            if (colorStateList != null) {
                bundle.putParcelable("tint_list", colorStateList);
            }
            PorterDuff.Mode mode = iconCompat.f3937h;
            if (mode != IconCompat.f3929k) {
                bundle.putString("tint_mode", mode.name());
            }
        } else {
            bundle = null;
        }
        bundle2.putBundle("icon", bundle);
        bundle2.putString("uri", this.f350c);
        bundle2.putString("key", this.f351d);
        bundle2.putBoolean("isBot", this.f352e);
        bundle2.putBoolean("isImportant", this.f353f);
        return bundle2;
    }

    public final boolean equals(Object obj) {
        if (obj == null || !(obj instanceof Y)) {
            return false;
        }
        Y y5 = (Y) obj;
        String str = this.f351d;
        String str2 = y5.f351d;
        return (str == null && str2 == null) ? Objects.equals(Objects.toString(this.f348a), Objects.toString(y5.f348a)) && Objects.equals(this.f350c, y5.f350c) && Boolean.valueOf(this.f352e).equals(Boolean.valueOf(y5.f352e)) && Boolean.valueOf(this.f353f).equals(Boolean.valueOf(y5.f353f)) : Objects.equals(str, str2);
    }

    public final int hashCode() {
        String str = this.f351d;
        if (str != null) {
            return str.hashCode();
        }
        return Objects.hash(this.f348a, this.f350c, Boolean.valueOf(this.f352e), Boolean.valueOf(this.f353f));
    }
}
