package com.tencent.mm.plugin.webview.ui.tools.jsapi;

import android.os.Bundle;
import android.text.TextUtils;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.g.a.ke;
import com.tencent.mm.sdk.b.c;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.ytcommon.BuildConfig;

class g$36 extends c<ke> {
    final /* synthetic */ g uHd;

    g$36(g gVar) {
        this.uHd = gVar;
        AppMethodBeat.i(9087);
        this.xxI = ke.class.getName().hashCode();
        AppMethodBeat.o(9087);
    }

    private boolean a(ke keVar) {
        AppMethodBeat.i(9088);
        ab.i("MicroMsg.MsgHandler", "backgroundAudioListener callback in, state:%s", new Object[]{keVar.cFH.state});
        int i = (int) (keVar.cFH.duration / 1000);
        if (keVar.cFH.cFJ) {
            try {
                Bundle bundle = new Bundle();
                bundle.putString("background_audio_state_player_state", r2);
                bundle.putInt("background_audio_state_player_duration", i);
                if (keVar.cFH.cFB != null) {
                    bundle.putString("background_audio_state_player_src", keVar.cFH.cFB.fKa);
                    bundle.putString("background_audio_state_player_src_id", keVar.cFH.cFB.fKs);
                }
                bundle.putInt("background_audio_state_player_err_code", keVar.cFH.errCode);
                String str = BuildConfig.FLAVOR;
                if (!TextUtils.isEmpty(keVar.cFH.aIm)) {
                    str = keVar.cFH.aIm;
                }
                bundle.putString("background_audio_state_player_err_msg", str);
                if (g.k(this.uHd) != null) {
                    ab.i("MicroMsg.MsgHandler", "onBackgroundAudioStateChange");
                    g.k(this.uHd).c(2100, bundle);
                } else {
                    ab.e("MicroMsg.MsgHandler", "backgroundAudioListener callbacker is null");
                }
                AppMethodBeat.o(9088);
                return true;
            } catch (Exception e) {
                ab.e("MicroMsg.MsgHandler", e.getMessage());
                AppMethodBeat.o(9088);
                return false;
            }
        }
        ab.e("MicroMsg.MsgHandler", "is not from QQMusicPlayer, don't callback!");
        AppMethodBeat.o(9088);
        return false;
    }
}
