package com.tencent.mm.booter.notification.a;

import android.annotation.SuppressLint;
import android.content.Context;
import android.media.MediaPlayer;
import android.os.HandlerThread;
import android.os.Looper;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.a.e;
import com.tencent.mm.compatible.e.q;
import com.tencent.mm.sdk.g.d;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.ah;
import com.tencent.mm.sdk.platformtools.ak;
import com.tencent.mm.sdk.platformtools.bo;
import com.tencent.mm.storage.ac;
import java.nio.charset.Charset;

public final class f {
    Context context;
    boolean eeq;
    MediaPlayer eer;
    @SuppressLint({"HandlerLeak"})
    ak ees;
    private ak eet;

    /* synthetic */ f(byte b) {
        this();
    }

    private f() {
        String str = null;
        AppMethodBeat.i(16033);
        this.eeq = false;
        this.eer = null;
        this.ees = new 1(this, Looper.getMainLooper());
        this.context = ah.getContext();
        String str2 = ac.eSj + "deviceconfig.cfg";
        ab.i("MicroMsg.ServerConfigInfoStorage", "readConfigFromLocalFile, path: %s, isExist: %s", new Object[]{str2, Boolean.valueOf(e.ct(str2))});
        if (e.ct(str2)) {
            byte[] f = e.f(str2, 0, -1);
            if (!bo.cb(f)) {
                str2 = new String(f, Charset.defaultCharset());
                if (!bo.isNullOrNil(str2)) {
                    str = str2;
                }
            }
        }
        q.ku(str);
        AppMethodBeat.o(16033);
    }

    public final synchronized void jT(String str) {
        AppMethodBeat.i(16034);
        if (this.eet == null) {
            ab.i("MicroMsg.Notification.Tool.Sound", "playSound playHandler == null");
            HandlerThread ek = d.ek("playSoundThread", 0);
            ek.start();
            this.eet = new ak(ek.getLooper());
        }
        this.eet.post(new 2(this, str));
        AppMethodBeat.o(16034);
    }
}
