package D;

import android.app.Notification;
import android.app.PendingIntent;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import androidx.core.graphics.drawable.IconCompat;
import com.riyaz.zvytour.R;
import java.util.ArrayList;

/* JADX INFO: renamed from: D.o, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0044o {

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

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

    /* JADX INFO: renamed from: D, reason: collision with root package name */
    public long f387D;

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

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

    /* JADX INFO: renamed from: H, reason: collision with root package name */
    public boolean f391H;
    public final ArrayList I;

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

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

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

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

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

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

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

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

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

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    public CharSequence f405o;
    public int p;
    public int q;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    public C0044o(Context context, String str) {
        Notification notification = new Notification();
        this.f390G = notification;
        this.f392a = context;
        this.f385B = str;
        notification.when = System.currentTimeMillis();
        notification.audioStreamType = -1;
        this.f401k = 0;
        this.I = new ArrayList();
        this.f389F = true;
    }

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

    public final Notification a() {
        Notification notificationBuild;
        Bundle bundle;
        P p = new P(this);
        C0044o c0044o = p.f323c;
        K k5 = c0044o.f404n;
        if (k5 != null) {
            k5.b(p);
        }
        int i = Build.VERSION.SDK_INT;
        Notification.Builder builder = p.f322b;
        if (i >= 26) {
            notificationBuild = builder.build();
        } else {
            Notification notificationBuild2 = builder.build();
            int i5 = p.f325e;
            if (i5 != 0) {
                if (notificationBuild2.getGroup() != null && (notificationBuild2.flags & 512) != 0 && i5 == 2) {
                    notificationBuild2.sound = null;
                    notificationBuild2.vibrate = null;
                    notificationBuild2.defaults &= -4;
                }
                if (notificationBuild2.getGroup() != null && (notificationBuild2.flags & 512) == 0 && i5 == 1) {
                    notificationBuild2.sound = null;
                    notificationBuild2.vibrate = null;
                    notificationBuild2.defaults &= -4;
                }
            }
            notificationBuild = notificationBuild2;
        }
        if (k5 != null) {
            c0044o.f404n.getClass();
        }
        if (k5 != null && (bundle = notificationBuild.extras) != null) {
            k5.a(bundle);
        }
        return notificationBuild;
    }

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

    public final void d(Bitmap bitmap) {
        IconCompat iconCompatD;
        if (bitmap == null) {
            iconCompatD = null;
        } else {
            if (Build.VERSION.SDK_INT < 27) {
                Resources resources = this.f392a.getResources();
                int dimensionPixelSize = resources.getDimensionPixelSize(R.dimen.compat_notification_large_icon_max_width);
                int dimensionPixelSize2 = resources.getDimensionPixelSize(R.dimen.compat_notification_large_icon_max_height);
                if (bitmap.getWidth() > dimensionPixelSize || bitmap.getHeight() > dimensionPixelSize2) {
                    double dMin = Math.min(((double) dimensionPixelSize) / ((double) Math.max(1, bitmap.getWidth())), ((double) dimensionPixelSize2) / ((double) Math.max(1, bitmap.getHeight())));
                    bitmap = Bitmap.createScaledBitmap(bitmap, (int) Math.ceil(((double) bitmap.getWidth()) * dMin), (int) Math.ceil(((double) bitmap.getHeight()) * dMin), true);
                }
            }
            iconCompatD = IconCompat.d(bitmap);
        }
        this.i = iconCompatD;
    }

    public final void e(Uri uri) {
        Notification notification = this.f390G;
        notification.sound = uri;
        notification.audioStreamType = -1;
        notification.audioAttributes = AbstractC0043n.a(AbstractC0043n.d(AbstractC0043n.c(AbstractC0043n.b(), 4), 5));
    }

    public final void f(K k5) {
        if (this.f404n != k5) {
            this.f404n = k5;
            if (k5 == null || k5.f317a == this) {
                return;
            }
            k5.f317a = this;
            f(k5);
        }
    }
}
