package androidx.core.app;

import android.app.Notification;
import android.app.PendingIntent;
import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import android.widget.RemoteViews;
import androidx.core.graphics.drawable.IconCompat;
import java.util.ArrayList;

/* JADX INFO: renamed from: androidx.core.app.n, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C1007n {

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

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

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

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

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

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

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

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

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

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public boolean f11259k;
    public C l;

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

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

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

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

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

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

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

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

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

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

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

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

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public boolean f11258j = true;

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

    /* JADX INFO: renamed from: v, reason: collision with root package name */
    public int f11269v = 0;

    /* JADX INFO: renamed from: w, reason: collision with root package name */
    public int f11270w = 0;

    /* JADX INFO: renamed from: y, reason: collision with root package name */
    public int f11272y = 0;

    /* JADX INFO: renamed from: z, reason: collision with root package name */
    public int f11273z = 0;

    public C1007n(Context context, String str) {
        Notification notification = new Notification();
        this.f11247B = notification;
        this.f11249a = context;
        this.f11271x = str;
        notification.when = System.currentTimeMillis();
        notification.audioStreamType = -1;
        this.f11257i = 0;
        this.f11248C = new ArrayList();
        this.f11246A = true;
    }

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

    public final Notification a() {
        Bundle bundle;
        RemoteViews remoteViewsMakeHeadsUpContentView;
        RemoteViews remoteViewsMakeBigContentView;
        G g6 = new G(this);
        C1007n c1007n = g6.f11194c;
        C c6 = c1007n.l;
        if (c6 != null) {
            c6.apply(g6);
        }
        RemoteViews remoteViewsMakeContentView = c6 != null ? c6.makeContentView(g6) : null;
        int i6 = Build.VERSION.SDK_INT;
        Notification.Builder builder = g6.f11193b;
        Notification notificationBuild = i6 >= 26 ? builder.build() : builder.build();
        if (remoteViewsMakeContentView != null) {
            notificationBuild.contentView = remoteViewsMakeContentView;
        }
        if (c6 != null && (remoteViewsMakeBigContentView = c6.makeBigContentView(g6)) != null) {
            notificationBuild.bigContentView = remoteViewsMakeBigContentView;
        }
        if (c6 != null && (remoteViewsMakeHeadsUpContentView = c1007n.l.makeHeadsUpContentView(g6)) != null) {
            notificationBuild.headsUpContentView = remoteViewsMakeHeadsUpContentView;
        }
        if (c6 != null && (bundle = notificationBuild.extras) != null) {
            c6.addCompatExtras(bundle);
        }
        return notificationBuild;
    }

    public final void c(int i6, boolean z6) {
        Notification notification = this.f11247B;
        if (z6) {
            notification.flags = i6 | notification.flags;
        } else {
            notification.flags = (~i6) & notification.flags;
        }
    }

    public final void d(C c6) {
        if (this.l != c6) {
            this.l = c6;
            if (c6 != null) {
                c6.setBuilder(this);
            }
        }
    }
}
