package androidx.core.app;

import android.content.res.ColorStateList;
import android.graphics.Bitmap;
import android.graphics.PorterDuff;
import android.os.Bundle;
import android.os.Parcelable;
import androidx.annotation.Nullable;
import androidx.core.graphics.drawable.IconCompat;
import java.util.Objects;

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

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

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

    @Nullable
    IconCompat mIcon;

    @Nullable
    String mKey;

    @Nullable
    CharSequence mName;

    @Nullable
    String mUri;

    public static z1 a(Bundle bundle) {
        Bundle bundle2 = bundle.getBundle("icon");
        y1 key = new y1().setName(bundle.getCharSequence("name")).setIcon(bundle2 != null ? IconCompat.createFromBundle(bundle2) : null).setUri(bundle.getString("uri")).setKey(bundle.getString("key"));
        key.f1696a = bundle.getBoolean("isBot");
        key.f1697b = bundle.getBoolean("isImportant");
        return key.a();
    }

    public final Bundle b() {
        Bundle bundle;
        Bundle bundle2 = new Bundle();
        bundle2.putCharSequence("name", this.mName);
        IconCompat iconCompat = this.mIcon;
        if (iconCompat != null) {
            bundle = new Bundle();
            switch (iconCompat.f1702a) {
                case -1:
                    bundle.putParcelable("obj", (Parcelable) iconCompat.f1703b);
                    break;
                case 0:
                default:
                    throw new IllegalArgumentException("Invalid icon");
                case 1:
                case 5:
                    bundle.putParcelable("obj", (Bitmap) iconCompat.f1703b);
                    break;
                case 2:
                case 4:
                case 6:
                    bundle.putString("obj", (String) iconCompat.f1703b);
                    break;
                case 3:
                    bundle.putByteArray("obj", (byte[]) iconCompat.f1703b);
                    break;
            }
            bundle.putInt("type", iconCompat.f1702a);
            bundle.putInt("int1", iconCompat.f1704c);
            bundle.putInt("int2", iconCompat.f1705d);
            bundle.putString("string1", iconCompat.mString1);
            ColorStateList colorStateList = iconCompat.mTintList;
            if (colorStateList != null) {
                bundle.putParcelable("tint_list", colorStateList);
            }
            PorterDuff.Mode mode = iconCompat.f1706e;
            if (mode != IconCompat.f1701f) {
                bundle.putString("tint_mode", mode.name());
            }
        } else {
            bundle = null;
        }
        bundle2.putBundle("icon", bundle);
        bundle2.putString("uri", this.mUri);
        bundle2.putString("key", this.mKey);
        bundle2.putBoolean("isBot", this.f1698a);
        bundle2.putBoolean("isImportant", this.f1699b);
        return bundle2;
    }

    public boolean equals(@Nullable Object obj) {
        if (obj == null || !(obj instanceof z1)) {
            return false;
        }
        z1 z1Var = (z1) obj;
        String key = getKey();
        String key2 = z1Var.getKey();
        return (key == null && key2 == null) ? Objects.equals(Objects.toString(getName()), Objects.toString(z1Var.getName())) && Objects.equals(getUri(), z1Var.getUri()) && Objects.equals(Boolean.valueOf(this.f1698a), Boolean.valueOf(z1Var.f1698a)) && Objects.equals(Boolean.valueOf(this.f1699b), Boolean.valueOf(z1Var.f1699b)) : Objects.equals(key, key2);
    }

    @Nullable
    public IconCompat getIcon() {
        return this.mIcon;
    }

    @Nullable
    public String getKey() {
        return this.mKey;
    }

    @Nullable
    public CharSequence getName() {
        return this.mName;
    }

    @Nullable
    public String getUri() {
        return this.mUri;
    }

    public final int hashCode() {
        String key = getKey();
        return key != null ? key.hashCode() : Objects.hash(getName(), getUri(), Boolean.valueOf(this.f1698a), Boolean.valueOf(this.f1699b));
    }
}
