package a.c.d.l;

import a.a.a.b;
import android.content.Context;
import android.media.AudioTrack;
import java.util.concurrent.atomic.AtomicBoolean;

public class a {

    /* renamed from: a  reason: collision with root package name */
    private static final String f163a = "AudioTrackUtil";
    private static final String b = "at_info";
    private static final String c = "hwl";
    private static final int d = 200;
    private static final AtomicBoolean e = new AtomicBoolean(false);

    private a() {
    }

    public static int a(Context context) {
        return context.getSharedPreferences(b, 0).getInt(c, 200);
    }

    public static void a(Context context, AudioTrack audioTrack) {
        if (e.compareAndSet(false, true)) {
            try {
                context.getSharedPreferences(b, 0).edit().putInt(c, ((Integer) AudioTrack.class.getMethod("getLatency", null).invoke(audioTrack, new Object[0])).intValue()).apply();
            } catch (Exception e2) {
                b.b(f163a, "invoke getLatency failed.", e2);
            }
        }
    }
}
