Search in sources :

Example 1 with ApplicationErrorReport

use of android.app.ApplicationErrorReport in project android_frameworks_base by ParanoidAndroid.

the class ActivityManagerService method createAppErrorReportLocked.

private ApplicationErrorReport createAppErrorReportLocked(ProcessRecord r, long timeMillis, ApplicationErrorReport.CrashInfo crashInfo) {
    if (r.errorReportReceiver == null) {
        return null;
    }
    if (!r.crashing && !r.notResponding && !r.forceCrashReport) {
        return null;
    }
    ApplicationErrorReport report = new ApplicationErrorReport();
    report.packageName = r.info.packageName;
    report.installerPackageName = r.errorReportReceiver.getPackageName();
    report.processName = r.processName;
    report.time = timeMillis;
    report.systemApp = (r.info.flags & ApplicationInfo.FLAG_SYSTEM) != 0;
    if (r.crashing || r.forceCrashReport) {
        report.type = ApplicationErrorReport.TYPE_CRASH;
        report.crashInfo = crashInfo;
    } else if (r.notResponding) {
        report.type = ApplicationErrorReport.TYPE_ANR;
        report.anrInfo = new ApplicationErrorReport.AnrInfo();
        report.anrInfo.activity = r.notRespondingReport.tag;
        report.anrInfo.cause = r.notRespondingReport.shortMsg;
        report.anrInfo.info = r.notRespondingReport.longMsg;
    }
    return report;
}
Also used : ApplicationErrorReport(android.app.ApplicationErrorReport)

Example 2 with ApplicationErrorReport

use of android.app.ApplicationErrorReport in project android_frameworks_base by ResurrectionRemix.

the class AppErrors method createAppErrorIntentLocked.

Intent createAppErrorIntentLocked(ProcessRecord r, long timeMillis, ApplicationErrorReport.CrashInfo crashInfo) {
    ApplicationErrorReport report = createAppErrorReportLocked(r, timeMillis, crashInfo);
    if (report == null) {
        return null;
    }
    Intent result = new Intent(Intent.ACTION_APP_ERROR);
    result.setComponent(r.errorReportReceiver);
    result.putExtra(Intent.EXTRA_BUG_REPORT, report);
    result.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    return result;
}
Also used : ApplicationErrorReport(android.app.ApplicationErrorReport) Intent(android.content.Intent)

Example 3 with ApplicationErrorReport

use of android.app.ApplicationErrorReport in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class PowerUsageDetail method reportBatteryUse.

private void reportBatteryUse() {
    if (mPackages == null)
        return;
    ApplicationErrorReport report = new ApplicationErrorReport();
    report.type = ApplicationErrorReport.TYPE_BATTERY;
    report.packageName = mPackages[0];
    report.installerPackageName = mInstaller.getPackageName();
    report.processName = mPackages[0];
    report.time = System.currentTimeMillis();
    report.systemApp = (mApp.flags & ApplicationInfo.FLAG_SYSTEM) != 0;
    final Bundle args = getArguments();
    ApplicationErrorReport.BatteryInfo batteryInfo = new ApplicationErrorReport.BatteryInfo();
    batteryInfo.usagePercent = args.getInt(EXTRA_PERCENT, 1);
    batteryInfo.durationMicros = args.getLong(EXTRA_USAGE_DURATION, 0);
    batteryInfo.usageDetails = args.getString(EXTRA_REPORT_DETAILS);
    batteryInfo.checkinDetails = args.getString(EXTRA_REPORT_CHECKIN_DETAILS);
    report.batteryInfo = batteryInfo;
    Intent result = new Intent(Intent.ACTION_APP_ERROR);
    result.setComponent(mInstaller);
    result.putExtra(Intent.EXTRA_BUG_REPORT, report);
    result.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    startActivity(result);
}
Also used : ApplicationErrorReport(android.app.ApplicationErrorReport) Bundle(android.os.Bundle) Intent(android.content.Intent)

Example 4 with ApplicationErrorReport

use of android.app.ApplicationErrorReport in project android_frameworks_base by DirtyUnicorns.

the class AppErrors method createAppErrorReportLocked.

private ApplicationErrorReport createAppErrorReportLocked(ProcessRecord r, long timeMillis, ApplicationErrorReport.CrashInfo crashInfo) {
    if (r.errorReportReceiver == null) {
        return null;
    }
    if (!r.crashing && !r.notResponding && !r.forceCrashReport) {
        return null;
    }
    ApplicationErrorReport report = new ApplicationErrorReport();
    report.packageName = r.info.packageName;
    report.installerPackageName = r.errorReportReceiver.getPackageName();
    report.processName = r.processName;
    report.time = timeMillis;
    report.systemApp = (r.info.flags & ApplicationInfo.FLAG_SYSTEM) != 0;
    if (r.crashing || r.forceCrashReport) {
        report.type = ApplicationErrorReport.TYPE_CRASH;
        report.crashInfo = crashInfo;
    } else if (r.notResponding) {
        report.type = ApplicationErrorReport.TYPE_ANR;
        report.anrInfo = new ApplicationErrorReport.AnrInfo();
        report.anrInfo.activity = r.notRespondingReport.tag;
        report.anrInfo.cause = r.notRespondingReport.shortMsg;
        report.anrInfo.info = r.notRespondingReport.longMsg;
    }
    return report;
}
Also used : ApplicationErrorReport(android.app.ApplicationErrorReport)

Example 5 with ApplicationErrorReport

use of android.app.ApplicationErrorReport in project android_frameworks_base by DirtyUnicorns.

the class AppErrors method createAppErrorIntentLocked.

Intent createAppErrorIntentLocked(ProcessRecord r, long timeMillis, ApplicationErrorReport.CrashInfo crashInfo) {
    ApplicationErrorReport report = createAppErrorReportLocked(r, timeMillis, crashInfo);
    if (report == null) {
        return null;
    }
    Intent result = new Intent(Intent.ACTION_APP_ERROR);
    result.setComponent(r.errorReportReceiver);
    result.putExtra(Intent.EXTRA_BUG_REPORT, report);
    result.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    return result;
}
Also used : ApplicationErrorReport(android.app.ApplicationErrorReport) Intent(android.content.Intent)

Aggregations

ApplicationErrorReport (android.app.ApplicationErrorReport)18 Intent (android.content.Intent)11 PendingIntent (android.app.PendingIntent)2 PrintWriter (java.io.PrintWriter)2 StringWriter (java.io.StringWriter)2 Bundle (android.os.Bundle)1