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

import android.support.v4.f.a;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.appbrand.b.d.7;
import com.tencent.mm.plugin.appbrand.i;
import com.tencent.mm.sdk.platformtools.ak;

public final class c {
    final i gPI;
    public final d gWy;
    public final a<a, c> gWz = new a();

    public c(i iVar) {
        AppMethodBeat.i(86833);
        this.gPI = iVar;
        this.gWy = new 1(this, iVar);
        AppMethodBeat.o(86833);
    }

    public final void a(a aVar) {
        AppMethodBeat.i(86834);
        if (aVar == null || b.gWw == this.gWy.awz()) {
            AppMethodBeat.o(86834);
            return;
        }
        synchronized (this.gWz) {
            try {
                this.gWz.put(aVar, this);
            } finally {
                while (true) {
                }
                AppMethodBeat.o(86834);
            }
        }
    }

    public final void b(a aVar) {
        AppMethodBeat.i(86835);
        if (aVar == null || b.gWw == this.gWy.awz()) {
            AppMethodBeat.o(86835);
            return;
        }
        synchronized (this.gWz) {
            try {
                this.gWz.remove(aVar);
            } finally {
                while (true) {
                }
                AppMethodBeat.o(86835);
            }
        }
    }

    public final boolean awx() {
        AppMethodBeat.i(86836);
        d dVar = this.gWy;
        switch (7.gWN[dVar.awz().ordinal()]) {
            case 1:
                AppMethodBeat.o(86836);
                return true;
            case 2:
            case 3:
                AppMethodBeat.o(86836);
                return false;
            case 4:
                boolean booleanValue = ((Boolean) new d$5(dVar).b(new ak(dVar.xCt.getLooper()))).booleanValue();
                AppMethodBeat.o(86836);
                return booleanValue;
            default:
                AppMethodBeat.o(86836);
                return false;
        }
    }
}
