diff options
| author | 2021-03-31 14:42:53 +0000 | |
|---|---|---|
| committer | 2021-03-31 17:47:40 +0000 | |
| commit | 867e305d8879b281a36eff564b0b1eb243569fd3 (patch) | |
| tree | 57b856d6a27a1cd1a10acb21978c3aa3da54cfc2 | |
| parent | 64f83419987f126fe7bd1a0edfe95caa7076f8ac (diff) | |
[incremental] fix metrics logging during ANR
aInfo is null; should use mApp.info instead.
Test: atest android.cts.statsdatom.statsd.IncrementalAtomTests#testAppAnrIncremental
BUG: 182205656
Change-Id: If9ce31f69a34f5cbf8d2f295bac5b365303a717a
| -rw-r--r-- | services/core/java/com/android/server/am/ProcessErrorStateRecord.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/services/core/java/com/android/server/am/ProcessErrorStateRecord.java b/services/core/java/com/android/server/am/ProcessErrorStateRecord.java index ab4a2d59ed90..00184f9d396a 100644 --- a/services/core/java/com/android/server/am/ProcessErrorStateRecord.java +++ b/services/core/java/com/android/server/am/ProcessErrorStateRecord.java @@ -303,17 +303,17 @@ class ProcessErrorStateRecord { float loadingProgress = 1; IncrementalMetrics incrementalMetrics = null; final PackageManagerInternal packageManagerInternal = mService.getPackageManagerInternal(); - if (aInfo != null && aInfo.packageName != null) { + if (mApp.info != null && mApp.info.packageName != null) { IncrementalStatesInfo incrementalStatesInfo = packageManagerInternal.getIncrementalStatesInfo( - aInfo.packageName, mApp.uid, mApp.userId); + mApp.info.packageName, mApp.uid, mApp.userId); if (incrementalStatesInfo != null) { loadingProgress = incrementalStatesInfo.getProgress(); } - final String codePath = aInfo.getCodePath(); + final String codePath = mApp.info.getCodePath(); if (IncrementalManager.isIncrementalPath(codePath)) { // Report in the main log that the incremental package is still loading - Slog.e(TAG, "App crashed on incremental package " + aInfo.packageName + Slog.e(TAG, "App ANR on incremental package " + mApp.info.packageName + " which is " + ((int) (loadingProgress * 100)) + "% loaded."); final IBinder incrementalService = ServiceManager.getService( Context.INCREMENTAL_SERVICE); @@ -418,7 +418,6 @@ class ProcessErrorStateRecord { mService.mProcessList.mAppExitInfoTracker.scheduleLogAnrTrace( pid, mApp.uid, mApp.getPackageList(), tracesFile, offsets[0], offsets[1]); } - FrameworkStatsLog.write(FrameworkStatsLog.ANR_OCCURRED, mApp.uid, mApp.processName, activityShortComponentName == null ? "unknown" : activityShortComponentName, annotation, |