package D;

import android.app.Notification;
import android.app.NotificationManager;
import android.content.Context;
import android.os.Bundle;
import java.util.HashSet;

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

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public static String f342d;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public static U f345g;

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final NotificationManager f347b;

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

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public static HashSet f343e = new HashSet();

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public static final Object f344f = new Object();

    public V(Context context) {
        this.f346a = context;
        this.f347b = (NotificationManager) context.getSystemService("notification");
    }

    public final void a(int i, String str) {
        this.f347b.cancel(str, i);
    }

    public final void b(String str, int i, Notification notification) {
        Bundle bundle = notification.extras;
        NotificationManager notificationManager = this.f347b;
        if (bundle == null || !bundle.getBoolean("android.support.useSideChannel")) {
            notificationManager.notify(str, i, notification);
            return;
        }
        Q q = new Q(this.f346a.getPackageName(), i, str, notification);
        synchronized (f344f) {
            try {
                if (f345g == null) {
                    f345g = new U(this.f346a.getApplicationContext());
                }
                f345g.f338b.obtainMessage(0, q).sendToTarget();
            } catch (Throwable th) {
                throw th;
            }
        }
        notificationManager.cancel(str, i);
    }
}
