package com.tencent.luggage.sdk.b;

import android.app.Activity;
import android.text.TextUtils;
import com.tencent.luggage.g.d;
import com.tencent.luggage.sdk.b.a.2;
import com.tencent.luggage.sdk.config.AppBrandInitConfigLU;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.appbrand.config.a.a;
import com.tencent.mm.plugin.appbrand.i;
import com.tencent.mm.plugin.appbrand.report.AppBrandStatObject;
import com.tencent.mm.plugin.appbrand.widget.input.n;
import java.util.Iterator;

class a$1 implements Runnable {
    final /* synthetic */ i bRj;
    final /* synthetic */ AppBrandInitConfigLU bRk;
    final /* synthetic */ AppBrandStatObject bRl;
    final /* synthetic */ a bRm;

    a$1(a aVar, i iVar, AppBrandInitConfigLU appBrandInitConfigLU, AppBrandStatObject appBrandStatObject) {
        this.bRm = aVar;
        this.bRj = iVar;
        this.bRk = appBrandInitConfigLU;
        this.bRl = appBrandStatObject;
    }

    public final void run() {
        i iVar;
        AppMethodBeat.i(101682);
        n.w(this.bRm.gNy);
        if (this.bRj == null) {
            this.bRm.atx();
        }
        a aVar = this.bRm;
        String str = this.bRk.appId;
        Iterator it = aVar.gOB.iterator();
        while (it.hasNext()) {
            iVar = (i) it.next();
            if (iVar.mAppId.equals(str)) {
                break;
            }
        }
        iVar = (i) aVar.gOC.get(str);
        iVar = (b) iVar;
        this.bRk.bQn = this.bRl;
        if (iVar == null) {
            iVar = (b) this.bRm.e(this.bRk);
            aVar = this.bRm;
            AppBrandInitConfigLU appBrandInitConfigLU = this.bRk;
            if (!TextUtils.isEmpty(appBrandInitConfigLU.hfh)) {
                Activity context = aVar.gOD.getContext();
                if (!(context == null || context.isFinishing())) {
                    d.i("Luggage.AppBrandRuntimeContainerLU", "tryRequestOrientation appId[%s] orientation[%s]", new Object[]{appBrandInitConfigLU.appId, appBrandInitConfigLU.hfh});
                    a.t(context).a(a.g(appBrandInitConfigLU), new 2(aVar));
                }
            }
            this.bRm.a(this.bRj, iVar, this.bRk);
        } else if (this.bRj == iVar) {
            this.bRm.b(null, iVar, this.bRk);
            this.bRm.onResume();
        } else {
            this.bRm.b(this.bRj, iVar, this.bRk);
        }
        if (this.bRm.e(iVar) && iVar.asU() != null) {
            iVar.gNS = true;
        }
        AppMethodBeat.o(101682);
    }
}
