package androidx.core.app;

import android.app.PendingIntent;
import android.os.Parcel;
import android.text.TextUtils;
import androidx.core.graphics.drawable.IconCompat;
import java.lang.reflect.InvocationTargetException;
import o.AbstractC2455sj0;
import o.C2550tj0;
import o.InterfaceC2645uj0;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public class RemoteActionCompatParcelizer {
    public static RemoteActionCompat read(AbstractC2455sj0 abstractC2455sj0) {
        RemoteActionCompat remoteActionCompat = new RemoteActionCompat();
        InterfaceC2645uj0 interfaceC2645uj0G = remoteActionCompat.a;
        boolean z = true;
        if (abstractC2455sj0.e(1)) {
            interfaceC2645uj0G = abstractC2455sj0.g();
        }
        remoteActionCompat.a = (IconCompat) interfaceC2645uj0G;
        CharSequence charSequence = remoteActionCompat.b;
        if (abstractC2455sj0.e(2)) {
            charSequence = (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(((C2550tj0) abstractC2455sj0).e);
        }
        remoteActionCompat.b = charSequence;
        CharSequence charSequence2 = remoteActionCompat.c;
        if (abstractC2455sj0.e(3)) {
            charSequence2 = (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(((C2550tj0) abstractC2455sj0).e);
        }
        remoteActionCompat.c = charSequence2;
        remoteActionCompat.d = (PendingIntent) abstractC2455sj0.f(remoteActionCompat.d, 4);
        boolean z2 = remoteActionCompat.e;
        if (abstractC2455sj0.e(5)) {
            z2 = ((C2550tj0) abstractC2455sj0).e.readInt() != 0;
        }
        remoteActionCompat.e = z2;
        boolean z3 = remoteActionCompat.f;
        if (!abstractC2455sj0.e(6)) {
            z = z3;
        } else if (((C2550tj0) abstractC2455sj0).e.readInt() == 0) {
            z = false;
        }
        remoteActionCompat.f = z;
        return remoteActionCompat;
    }

    public static void write(RemoteActionCompat remoteActionCompat, AbstractC2455sj0 abstractC2455sj0) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
        abstractC2455sj0.getClass();
        IconCompat iconCompat = remoteActionCompat.a;
        abstractC2455sj0.h(1);
        abstractC2455sj0.i(iconCompat);
        CharSequence charSequence = remoteActionCompat.b;
        abstractC2455sj0.h(2);
        Parcel parcel = ((C2550tj0) abstractC2455sj0).e;
        TextUtils.writeToParcel(charSequence, parcel, 0);
        CharSequence charSequence2 = remoteActionCompat.c;
        abstractC2455sj0.h(3);
        TextUtils.writeToParcel(charSequence2, parcel, 0);
        PendingIntent pendingIntent = remoteActionCompat.d;
        abstractC2455sj0.h(4);
        parcel.writeParcelable(pendingIntent, 0);
        boolean z = remoteActionCompat.e;
        abstractC2455sj0.h(5);
        parcel.writeInt(z ? 1 : 0);
        boolean z2 = remoteActionCompat.f;
        abstractC2455sj0.h(6);
        parcel.writeInt(z2 ? 1 : 0);
    }
}
