60 lines
1.7 KiB
Java
60 lines
1.7 KiB
Java
package c.i.a.c;
|
|
|
|
import android.content.BroadcastReceiver;
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.content.IntentFilter;
|
|
import android.os.Handler;
|
|
/* compiled from: AudioBecomingNoisyManager */
|
|
public final class d0 {
|
|
public final Context a;
|
|
public final a b;
|
|
|
|
/* renamed from: c reason: collision with root package name */
|
|
public boolean f781c;
|
|
|
|
/* compiled from: AudioBecomingNoisyManager */
|
|
public final class a extends BroadcastReceiver implements Runnable {
|
|
public final b i;
|
|
public final Handler j;
|
|
|
|
public a(Handler handler, b bVar) {
|
|
this.j = handler;
|
|
this.i = bVar;
|
|
}
|
|
|
|
@Override // android.content.BroadcastReceiver
|
|
public void onReceive(Context context, Intent intent) {
|
|
if ("android.media.AUDIO_BECOMING_NOISY".equals(intent.getAction())) {
|
|
this.j.post(this);
|
|
}
|
|
}
|
|
|
|
@Override // java.lang.Runnable
|
|
public void run() {
|
|
if (d0.this.f781c) {
|
|
p1.this.Y(false, -1, 3);
|
|
}
|
|
}
|
|
}
|
|
|
|
/* compiled from: AudioBecomingNoisyManager */
|
|
public interface b {
|
|
}
|
|
|
|
public d0(Context context, Handler handler, b bVar) {
|
|
this.a = context.getApplicationContext();
|
|
this.b = new a(handler, bVar);
|
|
}
|
|
|
|
public void a(boolean z2) {
|
|
if (z2 && !this.f781c) {
|
|
this.a.registerReceiver(this.b, new IntentFilter("android.media.AUDIO_BECOMING_NOISY"));
|
|
this.f781c = true;
|
|
} else if (!z2 && this.f781c) {
|
|
this.a.unregisterReceiver(this.b);
|
|
this.f781c = false;
|
|
}
|
|
}
|
|
}
|