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

import android.arch.lifecycle.Lifecycle.Event;
import android.arch.lifecycle.LifecycleObserver;
import android.arch.lifecycle.MutableLiveData;
import android.arch.lifecycle.OnLifecycleEvent;
import android.util.Pair;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.scanner.c.a.a;
import com.tencent.mm.sdk.g.d;
import com.tencent.mm.sdk.platformtools.al;
import com.tencent.mm.ui.MMActivity;

public final class b implements LifecycleObserver, a<String, Integer> {
    private MMActivity hwd;
    private MutableLiveData<Pair<String, Integer>> qiT = new MutableLiveData();

    public final /* synthetic */ void a(Object obj, a aVar) {
        AppMethodBeat.i(138723);
        String str = (String) obj;
        if (!this.qiT.hasObservers()) {
            this.qiT.observe(this.hwd, new 1(this, aVar));
        }
        d.xDG.b(new 2(this, str), "ImageWordScanThread");
        AppMethodBeat.o(138723);
    }

    public b(MMActivity mMActivity) {
        AppMethodBeat.i(138721);
        mMActivity.getLifecycle().addObserver(this);
        this.hwd = mMActivity;
        AppMethodBeat.o(138721);
    }

    @OnLifecycleEvent(Event.ON_DESTROY)
    public final void onDestroy() {
        AppMethodBeat.i(138722);
        this.hwd.getLifecycle().removeObserver(this);
        this.hwd = null;
        AppMethodBeat.o(138722);
    }

    static /* synthetic */ void a(b bVar, String str, int i) {
        AppMethodBeat.i(138724);
        al.d(new 3(bVar, str, i));
        AppMethodBeat.o(138724);
    }
}
