package com.tencent.mm.performance.wxperformancetool;

import android.annotation.TargetApi;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.os.Bundle;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.cf.b;
import com.tencent.mm.sdk.platformtools.ak;

@TargetApi(17)
public class MemoryLeakActivity extends Activity {
    private AlertDialog ggr;
    private ak mHandler = new 1(this);
    private String mKey;

    public void onWindowFocusChanged(boolean z) {
        super.onWindowFocusChanged(z);
        AppMethodBeat.at(this, z);
    }

    public MemoryLeakActivity() {
        AppMethodBeat.i(76886);
        AppMethodBeat.o(76886);
    }

    /* Access modifiers changed, original: protected */
    public void onCreate(Bundle bundle) {
        AppMethodBeat.i(76887);
        super.onCreate(bundle);
        setContentView(2130968794);
        Builder builder = new Builder(this);
        builder.setTitle("memory leak");
        this.mKey = getIntent().getStringExtra("key");
        String stringExtra = getIntent().getStringExtra("tag");
        String stringExtra2 = getIntent().getStringExtra("class");
        if (stringExtra2.contains(" ")) {
            stringExtra2 = stringExtra2.substring(stringExtra2.indexOf(" "));
        }
        String replace = stringExtra2.replace(".", "_");
        builder.setMessage(stringExtra + stringExtra2 + "\n\npath:" + b.ydz + replace + ".zip");
        builder.setCancelable(true);
        builder.setPositiveButton("dumphprof", new 2(this, replace));
        builder.setNegativeButton("cancel", new 3(this));
        builder.setOnDismissListener(new 4(this));
        this.ggr = builder.create();
        b.dvS();
        this.mHandler.sendEmptyMessageDelayed(0, 200);
        AppMethodBeat.o(76887);
    }

    /* Access modifiers changed, original: protected */
    public void onDestroy() {
        AppMethodBeat.i(76888);
        super.onDestroy();
        a.ggu.remove(this.mKey);
        this.mHandler.removeCallbacksAndMessages(null);
        if (this.ggr != null && this.ggr.isShowing()) {
            this.ggr.dismiss();
            this.ggr = null;
        }
        AppMethodBeat.o(76888);
    }
}
