package o;

import android.app.Notification;
import android.os.Build;
import android.os.Bundle;
import java.util.ArrayList;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class LS {
    public final CharSequence a;
    public final long b;
    public final QW c;
    public final Bundle d = new Bundle();

    public LS(CharSequence charSequence, long j, QW qw) {
        this.a = charSequence;
        this.b = j;
        this.c = qw;
    }

    public static Bundle[] a(ArrayList arrayList) {
        Bundle[] bundleArr = new Bundle[arrayList.size()];
        int size = arrayList.size();
        for (int i = 0; i < size; i++) {
            LS ls = (LS) arrayList.get(i);
            QW qw = ls.c;
            Bundle bundle = new Bundle();
            CharSequence charSequence = ls.a;
            if (charSequence != null) {
                bundle.putCharSequence("text", charSequence);
            }
            bundle.putLong("time", ls.b);
            if (qw != null) {
                bundle.putCharSequence("sender", qw.a);
                if (Build.VERSION.SDK_INT >= 28) {
                    bundle.putParcelable("sender_person", KS.a(AbstractC0094Dq.s(qw)));
                } else {
                    bundle.putBundle("person", qw.a());
                }
            }
            Bundle bundle2 = ls.d;
            if (bundle2 != null) {
                bundle.putBundle("extras", bundle2);
            }
            bundleArr[i] = bundle;
        }
        return bundleArr;
    }

    public final Notification.MessagingStyle.Message b() {
        int i = Build.VERSION.SDK_INT;
        long j = this.b;
        CharSequence charSequence = this.a;
        QW qw = this.c;
        if (i >= 28) {
            return KS.b(charSequence, j, qw != null ? AbstractC0094Dq.s(qw) : null);
        }
        return JS.a(charSequence, j, qw != null ? qw.a : null);
    }
}
