package androidx.core.app; import android.app.AppOpsManager; import android.app.NotificationManager; import android.content.Context; import android.content.pm.ApplicationInfo; import android.os.Build; import java.lang.reflect.InvocationTargetException; import java.util.HashSet; import java.util.Set; /* loaded from: classes.dex */ public final class l0 { /* renamed from: c, reason: collision with root package name */ private static final Object f1432c = new Object(); /* renamed from: d, reason: collision with root package name */ private static Set f1433d = new HashSet(); /* renamed from: e, reason: collision with root package name */ private static final Object f1434e = new Object(); /* renamed from: a, reason: collision with root package name */ private final Context f1435a; /* renamed from: b, reason: collision with root package name */ private final NotificationManager f1436b; private l0(Context context) { this.f1435a = context; this.f1436b = (NotificationManager) context.getSystemService("notification"); } public static l0 b(Context context) { return new l0(context); } public boolean a() { boolean areNotificationsEnabled; if (Build.VERSION.SDK_INT >= 24) { areNotificationsEnabled = this.f1436b.areNotificationsEnabled(); return areNotificationsEnabled; } AppOpsManager appOpsManager = (AppOpsManager) this.f1435a.getSystemService("appops"); ApplicationInfo applicationInfo = this.f1435a.getApplicationInfo(); String packageName = this.f1435a.getApplicationContext().getPackageName(); int i10 = applicationInfo.uid; try { Class cls = Class.forName(AppOpsManager.class.getName()); Class cls2 = Integer.TYPE; return ((Integer) cls.getMethod("checkOpNoThrow", cls2, cls2, String.class).invoke(appOpsManager, Integer.valueOf(((Integer) cls.getDeclaredField("OP_POST_NOTIFICATION").get(Integer.class)).intValue()), Integer.valueOf(i10), packageName)).intValue() == 0; } catch (ClassNotFoundException | IllegalAccessException | NoSuchFieldException | NoSuchMethodException | RuntimeException | InvocationTargetException unused) { return true; } } }