public AppErrorDialog(android.content.Context context, AppErrorResult result, ProcessRecord app, int flags, String shortMsg, String longMsg)
super(context);
Resources res = context.getResources();
mProc = app;
mResult = result;
CharSequence name;
if ((app.pkgList.size() == 1) &&
(name=context.getPackageManager().getApplicationLabel(app.info)) != null) {
setMessage(res.getString(
com.android.internal.R.string.aerr_application,
name.toString(), app.info.processName));
} else {
name = app.processName;
setMessage(res.getString(
com.android.internal.R.string.aerr_process,
name.toString()));
}
setCancelable(false);
setButton(res.getText(com.android.internal.R.string.force_close),
mHandler.obtainMessage(FORCE_QUIT));
if ((flags&1) != 0) {
setButton(res.getText(com.android.internal.R.string.debug),
mHandler.obtainMessage(DEBUG));
}
setTitle(res.getText(com.android.internal.R.string.aerr_title));
getWindow().addFlags(FLAG_SYSTEM_ERROR);
getWindow().setTitle("Application Error: " + app.info.processName);
// After the timeout, pretend the user clicked the quit button
mHandler.sendMessageDelayed(
mHandler.obtainMessage(FORCE_QUIT),
DISMISS_TIMEOUT);
|