super(context);
mService = service;
mProc = app;
Resources res = context.getResources();
setCancelable(false);
int resid;
CharSequence name1 = activity != null
? activity.info.loadLabel(context.getPackageManager())
: null;
CharSequence name2 = null;
if ((app.pkgList.size() == 1) &&
(name2=context.getPackageManager().getApplicationLabel(app.info)) != null) {
if (name1 != null) {
resid = com.android.internal.R.string.anr_activity_application;
} else {
name1 = name2;
name2 = app.processName;
resid = com.android.internal.R.string.anr_application_process;
}
} else {
if (name1 != null) {
name2 = app.processName;
resid = com.android.internal.R.string.anr_activity_process;
} else {
name1 = app.processName;
resid = com.android.internal.R.string.anr_process;
}
}
setMessage(name2 != null
? res.getString(resid, name1.toString(), name2.toString())
: res.getString(resid, name1.toString()));
setButton(res.getText(com.android.internal.R.string.force_close),
mHandler.obtainMessage(1));
setButton2(res.getText(com.android.internal.R.string.wait),
mHandler.obtainMessage(2));
setTitle(res.getText(com.android.internal.R.string.anr_title));
getWindow().addFlags(FLAG_SYSTEM_ERROR);
getWindow().setTitle("Application Not Responding: " + app.info.processName);