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

import android.content.DialogInterface;
import android.content.DialogInterface.OnDismissListener;
import android.os.Bundle;
import android.os.ResultReceiver;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.pluginsdk.ui.applet.q.a;
import com.tencent.mm.sdk.platformtools.bo;

class AppBrandProcessShareMessageProxyUI$a implements OnDismissListener, a {
    private boolean hvk = false;
    final /* synthetic */ AppBrandProcessShareMessageProxyUI iHh;

    AppBrandProcessShareMessageProxyUI$a(AppBrandProcessShareMessageProxyUI appBrandProcessShareMessageProxyUI) {
        this.iHh = appBrandProcessShareMessageProxyUI;
    }

    public final void a(boolean z, String str, int i) {
        AppMethodBeat.i(133014);
        if (z) {
            ad(-1, str);
            AppMethodBeat.o(133014);
            return;
        }
        ad(-2, null);
        AppMethodBeat.o(133014);
    }

    public final void onDismiss(DialogInterface dialogInterface) {
        AppMethodBeat.i(133015);
        this.iHh.finish();
        AppMethodBeat.o(133015);
    }

    private void ad(int i, String str) {
        AppMethodBeat.i(133016);
        if (this.hvk) {
            AppMethodBeat.o(133016);
            return;
        }
        this.hvk = true;
        ResultReceiver resultReceiver = (ResultReceiver) this.iHh.getIntent().getParcelableExtra("key_result_receiver");
        if (resultReceiver != null) {
            Bundle bundle = null;
            if (!bo.isNullOrNil(str)) {
                bundle = new Bundle();
                bundle.putString("message", str);
            }
            resultReceiver.send(i, bundle);
        }
        AppMethodBeat.o(133016);
    }
}
