- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
88 lines
2.4 KiB
Java
88 lines
2.4 KiB
Java
package com.mbridge.msdk.mbsignalcommon.mraid;
|
|
|
|
import android.content.BroadcastReceiver;
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.content.IntentFilter;
|
|
import android.media.AudioManager;
|
|
import java.lang.ref.WeakReference;
|
|
|
|
/* loaded from: classes4.dex */
|
|
public final class d {
|
|
public static double a = -1.0d;
|
|
private Context b;
|
|
private AudioManager c;
|
|
private boolean d = false;
|
|
private b e;
|
|
private a f;
|
|
|
|
public interface b {
|
|
void a(double d);
|
|
}
|
|
|
|
public final void a(b bVar) {
|
|
this.e = bVar;
|
|
}
|
|
|
|
public final b b() {
|
|
return this.e;
|
|
}
|
|
|
|
public d(Context context) {
|
|
this.b = context;
|
|
this.c = (AudioManager) context.getApplicationContext().getSystemService("audio");
|
|
}
|
|
|
|
public final double a() {
|
|
AudioManager audioManager = this.c;
|
|
double streamVolume = ((this.c != null ? r3.getStreamVolume(3) : -1) * 100.0d) / (audioManager != null ? audioManager.getStreamMaxVolume(3) : -1);
|
|
a = streamVolume;
|
|
return streamVolume;
|
|
}
|
|
|
|
public final void c() {
|
|
if (this.b != null) {
|
|
this.f = new a(this);
|
|
IntentFilter intentFilter = new IntentFilter();
|
|
intentFilter.addAction("android.media.VOLUME_CHANGED_ACTION");
|
|
this.b.registerReceiver(this.f, intentFilter);
|
|
this.d = true;
|
|
}
|
|
}
|
|
|
|
public final void d() {
|
|
Context context;
|
|
if (!this.d || (context = this.b) == null) {
|
|
return;
|
|
}
|
|
try {
|
|
context.unregisterReceiver(this.f);
|
|
this.e = null;
|
|
this.d = false;
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
public static class a extends BroadcastReceiver {
|
|
private WeakReference<d> a;
|
|
|
|
public a(d dVar) {
|
|
this.a = new WeakReference<>(dVar);
|
|
}
|
|
|
|
@Override // android.content.BroadcastReceiver
|
|
public final void onReceive(Context context, Intent intent) {
|
|
d dVar;
|
|
b b;
|
|
if (!"android.media.VOLUME_CHANGED_ACTION".equals(intent.getAction()) || intent.getIntExtra("android.media.EXTRA_VOLUME_STREAM_TYPE", -1) != 3 || (dVar = this.a.get()) == null || (b = dVar.b()) == null) {
|
|
return;
|
|
}
|
|
double a = dVar.a();
|
|
if (a >= 0.0d) {
|
|
b.a(a);
|
|
}
|
|
}
|
|
}
|
|
}
|