- 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
57 lines
1.4 KiB
Java
57 lines
1.4 KiB
Java
package com.iab.omid.library.unity3d.devicevolume;
|
|
|
|
import android.content.Context;
|
|
import android.database.ContentObserver;
|
|
import android.media.AudioManager;
|
|
import android.os.Handler;
|
|
import android.provider.Settings;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public final class d extends ContentObserver {
|
|
private final Context a;
|
|
private final AudioManager b;
|
|
private final a c;
|
|
private final c d;
|
|
private float e;
|
|
|
|
public d(Handler handler, Context context, a aVar, c cVar) {
|
|
super(handler);
|
|
this.a = context;
|
|
this.b = (AudioManager) context.getSystemService("audio");
|
|
this.c = aVar;
|
|
this.d = cVar;
|
|
}
|
|
|
|
private float a() {
|
|
return this.c.a(this.b.getStreamVolume(3), this.b.getStreamMaxVolume(3));
|
|
}
|
|
|
|
private boolean a(float f) {
|
|
return f != this.e;
|
|
}
|
|
|
|
private void b() {
|
|
this.d.a(this.e);
|
|
}
|
|
|
|
public void c() {
|
|
this.e = a();
|
|
b();
|
|
this.a.getContentResolver().registerContentObserver(Settings.System.CONTENT_URI, true, this);
|
|
}
|
|
|
|
public void d() {
|
|
this.a.getContentResolver().unregisterContentObserver(this);
|
|
}
|
|
|
|
@Override // android.database.ContentObserver
|
|
public void onChange(boolean z) {
|
|
super.onChange(z);
|
|
float a = a();
|
|
if (a(a)) {
|
|
this.e = a;
|
|
b();
|
|
}
|
|
}
|
|
}
|