package com.tencent.mm.plugin.appbrand.dynamic.widget;

import android.os.Bundle;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.ipcinvoker.f;
import com.tencent.mm.plugin.appbrand.dynamic.a;
import com.tencent.mm.plugin.appbrand.dynamic.a.2;
import com.tencent.mm.plugin.appbrand.dynamic.a.b;
import com.tencent.mm.plugin.appbrand.dynamic.e;
import com.tencent.mm.plugin.appbrand.dynamic.i;
import com.tencent.mm.plugin.appbrand.dynamic.j;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.bo;
import com.tencent.sqlitelint.config.SharePluginInfo;
import java.lang.ref.WeakReference;

class IPCDynamicPageView$2 implements Runnable {
    final /* synthetic */ IPCDynamicPageView hpw;

    IPCDynamicPageView$2(IPCDynamicPageView iPCDynamicPageView) {
        this.hpw = iPCDynamicPageView;
    }

    public final void run() {
        AppMethodBeat.i(11038);
        String e = IPCDynamicPageView.e(this.hpw);
        if (bo.isNullOrNil(e)) {
            ab.i("MicroMsg.IPCDynamicPageView", "detach failed, id is null or nil.");
            AppMethodBeat.o(11038);
            return;
        }
        IPCDynamicPageView.b(this.hpw, true);
        a f = IPCDynamicPageView.f(this.hpw);
        if (e == null || e.length() == 0) {
            ab.v("MicroMsg.DynamicIPCJsBridge", "detach(%s) failed, id is null or nil.", new Object[]{Integer.valueOf(f.hashCode())});
        } else {
            ab.i("MicroMsg.DynamicIPCJsBridge", "detach(%s, id : %s)", new Object[]{Integer.valueOf(f.hashCode()), e});
            Bundle bundle = new Bundle();
            bundle.putString(SharePluginInfo.ISSUE_KEY_ID, e);
            f.a(i.azC().zV(e), bundle, b.class, new 2(f, e));
            j azE = j.azE();
            if (azE.hlB.containsKey(e)) {
                azE.hlB.remove(e);
            } else {
                com.tencent.mm.ipcinvoker.h.b.w("WidgetReporter_14443", "OnDettach but no keylist found, widgetId[%s]", new Object[]{e});
            }
        }
        e azz = e.azz();
        if (bo.isNullOrNil(e)) {
            ab.w("MicroMsg.DynamicPageViewMgr", "remove view from manager failed, key is null or nil.");
        } else {
            WeakReference weakReference = (WeakReference) azz.hlz.remove(e);
            if (weakReference != null) {
                weakReference.get();
            }
        }
        this.hpw.cleanup();
        IPCDynamicPageView.a(this.hpw, null);
        IPCDynamicPageView.a(this.hpw, null);
        IPCDynamicPageView.a(this.hpw, null);
        IPCDynamicPageView.a(this.hpw, false);
        IPCDynamicPageView.d(this.hpw).aye();
        IPCDynamicPageView.d(this.hpw).setTraceId(null);
        AppMethodBeat.o(11038);
    }
}
