package X6FRs_4.IMuAHx_6.Mqv2r_3;

import X6FRs_4.IMuAHx_6.Mqv2r_3.IFxWkV_5;
import android.app.Notification;
import android.os.Bundle;
import android.util.Log;
import android.util.SparseArray;
import java.lang.reflect.Field;
import java.util.List;
/* compiled from: NotificationCompatJellybean.java */
/* loaded from: classes.dex */
public class FSaI4_7 {
    public static final Object KQgRr5e_0 = new Object();

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public static Field f416KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public static boolean f417KQgRr5e_0;

    public static SparseArray<Bundle> KQgRr5e_0(List<Bundle> list) {
        int size = list.size();
        SparseArray<Bundle> sparseArray = null;
        for (int i = 0; i < size; i++) {
            Bundle bundle = list.get(i);
            if (bundle != null) {
                if (sparseArray == null) {
                    sparseArray = new SparseArray<>();
                }
                sparseArray.put(i, bundle);
            }
        }
        return sparseArray;
    }

    public static Bundle KQgRr5e_0(Notification notification) {
        synchronized (KQgRr5e_0) {
            if (f417KQgRr5e_0) {
                return null;
            }
            try {
                if (f416KQgRr5e_0 == null) {
                    Field declaredField = Notification.class.getDeclaredField("extras");
                    if (!Bundle.class.isAssignableFrom(declaredField.getType())) {
                        Log.e("NotificationCompat", "Notification.extras field is not of type Bundle");
                        f417KQgRr5e_0 = true;
                        return null;
                    }
                    declaredField.setAccessible(true);
                    f416KQgRr5e_0 = declaredField;
                }
                Bundle bundle = (Bundle) f416KQgRr5e_0.get(notification);
                if (bundle == null) {
                    bundle = new Bundle();
                    f416KQgRr5e_0.set(notification, bundle);
                }
                return bundle;
            } catch (IllegalAccessException e) {
                Log.e("NotificationCompat", "Unable to access notification extras", e);
                f417KQgRr5e_0 = true;
                return null;
            } catch (NoSuchFieldException e2) {
                Log.e("NotificationCompat", "Unable to access notification extras", e2);
                f417KQgRr5e_0 = true;
                return null;
            }
        }
    }

    public static Bundle KQgRr5e_0(Notification.Builder builder, IFxWkV_5.KQgRr5e_0 kQgRr5e_0) {
        builder.addAction(kQgRr5e_0.KQgRr5e_0(), kQgRr5e_0.m300KQgRr5e_0(), kQgRr5e_0.m298KQgRr5e_0());
        Bundle bundle = new Bundle(kQgRr5e_0.m299KQgRr5e_0());
        if (kQgRr5e_0.m304QxJ9d_1() != null) {
            bundle.putParcelableArray("android.support.remoteInputs", KQgRr5e_0(kQgRr5e_0.m304QxJ9d_1()));
        }
        if (kQgRr5e_0.m302KQgRr5e_0() != null) {
            bundle.putParcelableArray("android.support.dataRemoteInputs", KQgRr5e_0(kQgRr5e_0.m302KQgRr5e_0()));
        }
        bundle.putBoolean("android.support.allowGeneratedReplies", kQgRr5e_0.m301KQgRr5e_0());
        return bundle;
    }

    public static Bundle KQgRr5e_0(IFxWkV_5.KQgRr5e_0 kQgRr5e_0) {
        Bundle bundle;
        Bundle bundle2 = new Bundle();
        bundle2.putInt("icon", kQgRr5e_0.KQgRr5e_0());
        bundle2.putCharSequence("title", kQgRr5e_0.m300KQgRr5e_0());
        bundle2.putParcelable("actionIntent", kQgRr5e_0.m298KQgRr5e_0());
        if (kQgRr5e_0.m299KQgRr5e_0() != null) {
            bundle = new Bundle(kQgRr5e_0.m299KQgRr5e_0());
        } else {
            bundle = new Bundle();
        }
        bundle.putBoolean("android.support.allowGeneratedReplies", kQgRr5e_0.m301KQgRr5e_0());
        bundle2.putBundle("extras", bundle);
        bundle2.putParcelableArray("remoteInputs", KQgRr5e_0(kQgRr5e_0.m304QxJ9d_1()));
        bundle2.putBoolean("showsUserInterface", kQgRr5e_0.m303QxJ9d_1());
        bundle2.putInt("semanticAction", kQgRr5e_0.QxJ9d_1());
        return bundle2;
    }

    public static Bundle KQgRr5e_0(Xgtqvk_8 xgtqvk_8) {
        new Bundle();
        xgtqvk_8.KQgRr5e_0();
        throw null;
    }

    public static Bundle[] KQgRr5e_0(Xgtqvk_8[] xgtqvk_8Arr) {
        if (xgtqvk_8Arr == null) {
            return null;
        }
        Bundle[] bundleArr = new Bundle[xgtqvk_8Arr.length];
        if (xgtqvk_8Arr.length <= 0) {
            return bundleArr;
        }
        KQgRr5e_0(xgtqvk_8Arr[0]);
        throw null;
    }
}
