package com.tencent.mm.plugin.d.a.b;

import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCharacteristic;
import android.os.Looper;
import android.os.Message;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.exdevice.j.b;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.ak;
import java.lang.ref.WeakReference;

class f$b extends ak {
    private final WeakReference<f> jGh;

    public f$b(Looper looper, f fVar) {
        super(looper);
        AppMethodBeat.i(18424);
        this.jGh = new WeakReference(fVar);
        AppMethodBeat.o(18424);
    }

    public final void handleMessage(Message message) {
        AppMethodBeat.i(18425);
        f fVar = (f) this.jGh.get();
        if (fVar == null) {
            ab.e("MicroMsg.exdevice.BluetoothLESimpleSession", "null == BluetoothLESession");
            AppMethodBeat.o(18425);
            return;
        }
        switch (message.what) {
            case 0:
                f.a(fVar);
                AppMethodBeat.o(18425);
                return;
            case 1:
                f.b(fVar);
                AppMethodBeat.o(18425);
                return;
            case 2:
                f.c(fVar);
                AppMethodBeat.o(18425);
                return;
            case 3:
                f.a(fVar, (byte[]) message.obj);
                AppMethodBeat.o(18425);
                return;
            case 4:
                f.a(fVar, message.arg1);
                AppMethodBeat.o(18425);
                return;
            case 5:
                if (!f.a(fVar, (BluetoothGatt) message.obj, message.arg1)) {
                    ab.i("MicroMsg.exdevice.BluetoothLESimpleSession", "------disconnect------, mac=%s, name=%s", new Object[]{b.ie(fVar.mSessionId), fVar.hGa.getName()});
                    if (!fVar.mHandler.sendMessage(fVar.mHandler.obtainMessage(1))) {
                        ab.e("MicroMsg.exdevice.BluetoothLESimpleSession", "SendMessage Failed!!! MessageWhat = %d", new Object[]{Integer.valueOf(1)});
                    }
                    AppMethodBeat.o(18425);
                    return;
                }
                break;
            case 6:
                Object obj = message.obj;
                f.b(fVar, message.arg1);
                AppMethodBeat.o(18425);
                return;
            case 7:
                f.c(fVar, message.arg1);
                AppMethodBeat.o(18425);
                return;
            case 8:
                f.a(fVar, (BluetoothGattCharacteristic) message.obj);
                AppMethodBeat.o(18425);
                return;
            case 9:
                f.d(fVar);
                break;
        }
        AppMethodBeat.o(18425);
    }
}
