package com.vivo.push.d; import android.app.NotificationChannel; import android.app.NotificationManager; import android.content.Context; import android.os.Build; import android.text.TextUtils; import com.huawei.hms.push.constant.RemoteMessageConst; import com.vivo.push.b.h; import com.vivo.push.b.q; import com.vivo.push.b.x; import com.vivo.push.cache.ClientConfigManagerImpl; import com.vivo.push.e; import com.vivo.push.m; import com.vivo.push.model.InsideNotificationItem; import com.vivo.push.o; import com.vivo.push.util.NotifyAdapterUtil; import com.vivo.push.util.aa; import com.vivo.push.util.p; import com.vivo.push.util.t; import java.util.HashMap; /* compiled from: OnNotificationArrivedReceiveTask */ public final class r extends z { /* compiled from: OnNotificationArrivedReceiveTask */ public interface a { void a(); void b(); } r(o oVar) { super(oVar); } /* access modifiers changed from: protected */ @Override // com.vivo.push.l public final void a(o oVar) { if (oVar == null) { p.a("OnNotificationArrivedTask", "command is null"); return; } boolean isEnablePush = ClientConfigManagerImpl.getInstance(this.a).isEnablePush(); q qVar = (q) oVar; if (!t.d(this.a, this.a.getPackageName())) { x xVar = new x(2101); HashMap<String, String> hashMap = new HashMap<>(); hashMap.put(com.heytap.mcssdk.a.a.c, String.valueOf(qVar.f())); String b = aa.b(this.a, this.a.getPackageName()); if (!TextUtils.isEmpty(b)) { hashMap.put("remoteAppId", b); } xVar.a(hashMap); e.a().a(xVar); return; } e.a().a(new h(String.valueOf(qVar.f()))); p.d("OnNotificationArrivedTask", "PushMessageReceiver " + this.a.getPackageName() + " isEnablePush :" + isEnablePush); if (!isEnablePush) { x xVar2 = new x(1020); HashMap<String, String> hashMap2 = new HashMap<>(); hashMap2.put(com.heytap.mcssdk.a.a.c, String.valueOf(qVar.f())); String b2 = aa.b(this.a, this.a.getPackageName()); if (!TextUtils.isEmpty(b2)) { hashMap2.put("remoteAppId", b2); } xVar2.a(hashMap2); e.a().a(xVar2); } else if (!e.a().g() || a(aa.d(this.a), qVar.e(), qVar.i())) { if (Build.VERSION.SDK_INT >= 24) { NotificationManager notificationManager = (NotificationManager) this.a.getSystemService(RemoteMessageConst.NOTIFICATION); if (notificationManager != null && !notificationManager.areNotificationsEnabled()) { p.b("OnNotificationArrivedTask", "pkg name : " + this.a.getPackageName() + " notify switch is false"); p.b(this.a, "通知开关关闭,导致通知无法展示,请到设置页打开应用通知开关"); x xVar3 = new x(2104); HashMap<String, String> hashMap3 = new HashMap<>(); hashMap3.put(com.heytap.mcssdk.a.a.c, String.valueOf(qVar.f())); String b3 = aa.b(this.a, this.a.getPackageName()); if (!TextUtils.isEmpty(b3)) { hashMap3.put("remoteAppId", b3); } xVar3.a(hashMap3); e.a().a(xVar3); return; } else if (Build.VERSION.SDK_INT >= 26 && notificationManager != null) { try { NotificationChannel notificationChannel = notificationManager.getNotificationChannel(NotifyAdapterUtil.PRIMARY_CHANNEL); if (notificationChannel != null && notificationChannel.getImportance() == 0) { p.b("OnNotificationArrivedTask", "pkg name : " + this.a.getPackageName() + " notify channel switch is false"); p.b(this.a, "通知通道开关关闭,导致通知无法展示,请到设置页打开应用通知开关"); HashMap hashMap4 = new HashMap(); hashMap4.put(com.heytap.mcssdk.a.a.c, String.valueOf(qVar.f())); String b4 = aa.b(this.a, this.a.getPackageName()); if (!TextUtils.isEmpty(b4)) { hashMap4.put("remoteAppId", b4); } com.vivo.push.util.e.a(2121, hashMap4); return; } } catch (Exception unused) { p.b("OnNotificationArrivedTask", "判断通知通道出现系统错误"); } } } InsideNotificationItem d = qVar.d(); if (d != null) { int targetType = d.getTargetType(); String tragetContent = d.getTragetContent(); p.d("OnNotificationArrivedTask", "tragetType is " + targetType + " ; target is " + tragetContent); m.c(new s(this, d, qVar)); return; } p.a("OnNotificationArrivedTask", "notify is null"); Context context = this.a; p.c(context, "通知内容为空," + qVar.f()); com.vivo.push.util.e.a(this.a, qVar.f(), 1027); } else { x xVar4 = new x(1021); HashMap<String, String> hashMap5 = new HashMap<>(); hashMap5.put(com.heytap.mcssdk.a.a.c, String.valueOf(qVar.f())); String b5 = aa.b(this.a, this.a.getPackageName()); if (!TextUtils.isEmpty(b5)) { hashMap5.put("remoteAppId", b5); } xVar4.a(hashMap5); e.a().a(xVar4); } } }