package B;

import A1.L;
import android.app.Notification;
import android.app.PendingIntent;
import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import d3.R0;
import java.util.ArrayList;

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

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final Context f471a;

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

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

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public PendingIntent f477g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public int f478h;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public R0 f479j;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public Bundle f481l;

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

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public final boolean f483n;

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    public final Notification f484o;

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

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public final ArrayList f486q;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final ArrayList f472b = new ArrayList();

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final ArrayList f473c = new ArrayList();

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final ArrayList f474d = new ArrayList();
    public final boolean i = true;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public boolean f480k = false;

    public f(Context context, String str) {
        Notification notification = new Notification();
        this.f484o = notification;
        this.f471a = context;
        this.f482m = str;
        notification.when = System.currentTimeMillis();
        notification.audioStreamType = -1;
        this.f478h = 0;
        this.f486q = new ArrayList();
        this.f483n = true;
    }

    public static CharSequence b(String str) {
        return (str != null && str.length() > 5120) ? str.subSequence(0, 5120) : str;
    }

    public final Notification a() {
        Notification notificationBuild;
        Bundle bundle;
        L l8 = new L(this);
        f fVar = (f) l8.f97s;
        R0 r02 = fVar.f479j;
        Notification.Builder builder = (Notification.Builder) l8.f96r;
        if (r02 != null) {
            new Notification.BigTextStyle(builder).setBigContentTitle(null).bigText((CharSequence) r02.f11693s);
        }
        int i = Build.VERSION.SDK_INT;
        if (i >= 26) {
            notificationBuild = builder.build();
        } else {
            int i5 = l8.f95q;
            if (i >= 24) {
                notificationBuild = builder.build();
                if (i5 != 0) {
                    if (notificationBuild.getGroup() != null && (notificationBuild.flags & 512) != 0 && i5 == 2) {
                        L.e(notificationBuild);
                    }
                    if (notificationBuild.getGroup() != null && (notificationBuild.flags & 512) == 0 && i5 == 1) {
                        L.e(notificationBuild);
                    }
                }
            } else {
                builder.setExtras((Bundle) l8.f98t);
                notificationBuild = builder.build();
                if (i5 != 0) {
                    if (notificationBuild.getGroup() != null && (notificationBuild.flags & 512) != 0 && i5 == 2) {
                        L.e(notificationBuild);
                    }
                    if (notificationBuild.getGroup() != null && (notificationBuild.flags & 512) == 0 && i5 == 1) {
                        L.e(notificationBuild);
                    }
                }
            }
        }
        if (r02 != null) {
            fVar.f479j.getClass();
        }
        if (r02 != null && (bundle = notificationBuild.extras) != null) {
            bundle.putString("androidx.core.app.extra.COMPAT_TEMPLATE", "androidx.core.app.NotificationCompat$BigTextStyle");
        }
        return notificationBuild;
    }

    public final void c(int i, boolean z8) {
        Notification notification = this.f484o;
        if (z8) {
            notification.flags = i | notification.flags;
        } else {
            notification.flags = (~i) & notification.flags;
        }
    }

    public final void d(R0 r02) {
        if (this.f479j != r02) {
            this.f479j = r02;
            if (((f) r02.f11692r) != this) {
                r02.f11692r = this;
                d(r02);
            }
        }
    }
}
