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

import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.webview.ui.tools.jsapi.d;
import com.tencent.mm.plugin.webview.ui.tools.jsapi.d.6;
import com.tencent.mm.plugin.webview.ui.tools.jsapi.i.a;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.al;
import java.util.HashMap;

class n$18 implements Runnable {
    final /* synthetic */ boolean uuB;
    final /* synthetic */ WebViewUI uul;
    final /* synthetic */ d uum;
    final /* synthetic */ n uuo;

    n$18(n nVar, WebViewUI webViewUI, d dVar, boolean z) {
        this.uuo = nVar;
        this.uul = webViewUI;
        this.uum = dVar;
        this.uuB = z;
    }

    public final void run() {
        AppMethodBeat.i(7730);
        if (this.uul == null || this.uul.isFinishing()) {
            AppMethodBeat.o(7730);
            return;
        }
        if (this.uum != null) {
            d dVar = this.uum;
            boolean z = this.uuB;
            if (dVar.ready) {
                ab.i("MicroMsg.JsApiHandler", "onWXDeviceBTStateChange: state = %s", new Object[]{Boolean.valueOf(z)});
                HashMap hashMap = new HashMap();
                if (z) {
                    hashMap.put("state", "on");
                } else {
                    hashMap.put("state", "off");
                }
                al.d(new 6(dVar, a.b("onWXDeviceBluetoothStateChange", hashMap, dVar.uFv, dVar.uFw)));
            } else {
                ab.e("MicroMsg.JsApiHandler", "onWXDeviceBTStateChange fail, not ready");
                AppMethodBeat.o(7730);
                return;
            }
        }
        AppMethodBeat.o(7730);
    }
}
