package com.tencent.mm.plugin.subapp.c;

import android.os.Message;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.ak;
import com.tencent.mm.sdk.platformtools.bo;

final class i$a implements Runnable {
    ak handler;
    final /* synthetic */ i stm;

    public i$a(final i iVar) {
        this.stm = iVar;
        AppMethodBeat.i(25296);
        this.handler = new ak() {
            public final void handleMessage(Message message) {
                AppMethodBeat.i(25295);
                if (i.c(i$a.this.stm) <= 0) {
                    AppMethodBeat.o(25295);
                    return;
                }
                ab.d("MicroMsg.VoiceRemindRecorder", "On Part :" + (i$a.this.stm.stf == null));
                i.d(i$a.this.stm);
                if (i$a.this.stm.stf != null) {
                    i$a.this.stm.stf.acE();
                }
                AppMethodBeat.o(25295);
            }
        };
        AppMethodBeat.o(25296);
    }

    public final void run() {
        AppMethodBeat.i(25297);
        if (i.e(this.stm) == null) {
            ab.e("MicroMsg.VoiceRemindRecorder", "Stop Record Failed recorder == null");
            AppMethodBeat.o(25297);
            return;
        }
        synchronized (this.stm) {
            try {
                if (!i.e(this.stm).el(h.by(i.a(this.stm), true))) {
                    i.abn(i.a(this.stm));
                    i.f(this.stm);
                    ab.d("MicroMsg.VoiceRemindRecorder", "Thread Start Record  Error fileName[" + i.a(this.stm) + "]");
                    i.g(this.stm);
                }
                i.a(this.stm, bo.yz());
                ab.d("MicroMsg.VoiceRemindRecorder", "Thread Started Record fileName[" + i.a(this.stm) + "] time:" + bo.az(i.h(this.stm)));
            } finally {
                while (true) {
                }
                AppMethodBeat.o(25297);
            }
        }
        this.handler.sendEmptyMessageDelayed(0, 1);
    }
}
