package com.google.android.play.core.assetpacks; import android.R; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.os.Build; import android.os.Bundle; import android.os.Parcelable; /* loaded from: classes2.dex */ final class w extends r3.b0 { /* renamed from: a, reason: collision with root package name */ private final r3.h0 f5113a = new r3.h0("AssetPackExtractionService"); /* renamed from: b, reason: collision with root package name */ private final Context f5114b; /* renamed from: c, reason: collision with root package name */ private final e0 f5115c; /* renamed from: d, reason: collision with root package name */ private final k3 f5116d; /* renamed from: e, reason: collision with root package name */ private final b1 f5117e; /* renamed from: f, reason: collision with root package name */ final NotificationManager f5118f; w(Context context, e0 e0Var, k3 k3Var, b1 b1Var) { this.f5114b = context; this.f5115c = e0Var; this.f5116d = k3Var; this.f5117e = b1Var; this.f5118f = (NotificationManager) context.getSystemService("notification"); } private final synchronized void L(String str) { if (str == null) { str = "File downloads by Play"; } q3.c.a(); this.f5118f.createNotificationChannel(h1.a.a("playcore-assetpacks-service-notification-channel", str, 2)); } private final synchronized void M(Bundle bundle, r3.d0 d0Var) { Notification.Builder priority; this.f5113a.a("updateServiceState AIDL call", new Object[0]); if (r3.h.b(this.f5114b) && r3.h.a(this.f5114b)) { int i10 = bundle.getInt("action_type"); this.f5117e.c(d0Var); if (i10 != 1) { if (i10 == 2) { this.f5116d.c(false); this.f5117e.b(); return; } else { this.f5113a.b("Unknown action type received: %d", Integer.valueOf(i10)); d0Var.x(new Bundle()); return; } } int i11 = Build.VERSION.SDK_INT; if (i11 >= 26) { L(bundle.getString("notification_channel_name")); } this.f5116d.c(true); b1 b1Var = this.f5117e; String string = bundle.getString("notification_title"); String string2 = bundle.getString("notification_subtext"); long j10 = bundle.getLong("notification_timeout", 600000L); Parcelable parcelable = bundle.getParcelable("notification_on_click_intent"); if (i11 >= 26) { Context context = this.f5114b; androidx.core.app.v.a(); priority = androidx.core.app.u.a(context, "playcore-assetpacks-service-notification-channel").setTimeoutAfter(j10); } else { priority = new Notification.Builder(this.f5114b).setPriority(-2); } if (parcelable instanceof PendingIntent) { priority.setContentIntent((PendingIntent) parcelable); } Notification.Builder ongoing = priority.setSmallIcon(R.drawable.stat_sys_download).setOngoing(false); if (string == null) { string = "Downloading additional file"; } Notification.Builder contentTitle = ongoing.setContentTitle(string); if (string2 == null) { string2 = "Transferring"; } contentTitle.setSubText(string2); int i12 = bundle.getInt("notification_color"); if (i12 != 0) { priority.setColor(i12).setVisibility(-1); } b1Var.a(priority.build()); this.f5114b.bindService(new Intent(this.f5114b, (Class) ExtractionForegroundService.class), this.f5117e, 1); return; } d0Var.x(new Bundle()); } @Override // r3.c0 public final void s(Bundle bundle, r3.d0 d0Var) { M(bundle, d0Var); } @Override // r3.c0 public final void w(Bundle bundle, r3.d0 d0Var) { this.f5113a.a("clearAssetPackStorage AIDL call", new Object[0]); if (!r3.h.b(this.f5114b) || !r3.h.a(this.f5114b)) { d0Var.x(new Bundle()); } else { this.f5115c.H(); d0Var.l(new Bundle()); } } }