package com.tencent.mm.plugin.card.b;

import android.bluetooth.BluetoothAdapter;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.card.b.i.a;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.al;

class i$a$2 extends BroadcastReceiver {
    final /* synthetic */ a kbx;

    i$a$2(a aVar) {
        this.kbx = aVar;
    }

    public final void onReceive(Context context, Intent intent) {
        AppMethodBeat.i(87704);
        if (intent == null) {
            ab.i("MicroMsg.CardLbsOrBluetooth", "Receive intent failed");
            AppMethodBeat.o(87704);
            return;
        }
        BluetoothAdapter defaultAdapter = BluetoothAdapter.getDefaultAdapter();
        if (defaultAdapter != null) {
            int state = defaultAdapter.getState();
            ab.d("MicroMsg.CardLbsOrBluetooth", "state:%d", new Object[]{Integer.valueOf(state)});
            if (state == 12) {
                this.kbx.kbs = true;
                al.n(this.kbx.kbv, this.kbx.kbu);
                AppMethodBeat.o(87704);
                return;
            } else if (state == 10) {
                al.af(this.kbx.kbv);
                this.kbx.kbs = false;
                this.kbx.kbt.clear();
            }
        }
        AppMethodBeat.o(87704);
    }
}
