package s5; import android.content.Context; import android.database.ContentObserver; import android.media.AudioManager; import android.os.Handler; import android.provider.Settings; import com.unity3d.services.core.device.MimeTypes; /* loaded from: classes2.dex */ public final class d extends ContentObserver { /* renamed from: a, reason: collision with root package name */ private final Context f14004a; /* renamed from: b, reason: collision with root package name */ private final AudioManager f14005b; /* renamed from: c, reason: collision with root package name */ private final a f14006c; /* renamed from: d, reason: collision with root package name */ private final c f14007d; /* renamed from: e, reason: collision with root package name */ private float f14008e; public d(Handler handler, Context context, a aVar, c cVar) { super(handler); this.f14004a = context; this.f14005b = (AudioManager) context.getSystemService(MimeTypes.BASE_TYPE_AUDIO); this.f14006c = aVar; this.f14007d = cVar; } private boolean b(float f10) { return f10 != this.f14008e; } private float d() { return this.f14006c.a(this.f14005b.getStreamVolume(3), this.f14005b.getStreamMaxVolume(3)); } private void e() { this.f14007d.a(this.f14008e); } public void a() { this.f14008e = d(); e(); this.f14004a.getContentResolver().registerContentObserver(Settings.System.CONTENT_URI, true, this); } public void c() { this.f14004a.getContentResolver().unregisterContentObserver(this); } @Override // android.database.ContentObserver public void onChange(boolean z10) { super.onChange(z10); float d10 = d(); if (b(d10)) { this.f14008e = d10; e(); } } }