Loading services/core/java/com/android/server/am/ProcessErrorStateRecord.java +16 −14 Original line number Original line Diff line number Diff line Loading @@ -329,6 +329,22 @@ class ProcessErrorStateRecord { info.append("Package is ").append((int) (loadingProgress * 100)).append("% loaded.\n"); info.append("Package is ").append((int) (loadingProgress * 100)).append("% loaded.\n"); } } // Retrieve controller with max ANR delay from AnrControllers // Note that we retrieve the controller before dumping stacks because dumping stacks can // take a few seconds, after which the cause of the ANR delay might have completed and // there might no longer be a valid ANR controller to cancel the dialog in that case AnrController anrController = mService.mActivityTaskManager.getAnrController(aInfo); long anrDialogDelayMs = 0; if (anrController != null) { String packageName = aInfo.packageName; int uid = aInfo.uid; anrDialogDelayMs = anrController.getAnrDelayMillis(packageName, uid); // Might execute an async binder call to a system app to show an interim // ANR progress UI anrController.onAnrDelayStarted(packageName, uid); Slog.i(TAG, "ANR delay of " + anrDialogDelayMs + "ms started for " + packageName); } StringBuilder report = new StringBuilder(); StringBuilder report = new StringBuilder(); report.append(MemoryPressureUtil.currentPsiState()); report.append(MemoryPressureUtil.currentPsiState()); ProcessCpuTracker processCpuTracker = new ProcessCpuTracker(true); ProcessCpuTracker processCpuTracker = new ProcessCpuTracker(true); Loading Loading @@ -417,20 +433,6 @@ class ProcessErrorStateRecord { return; return; } } // Retrieve max ANR delay from AnrControllers without the mService lock since the // controllers might in turn call into apps AnrController anrController = mService.mActivityTaskManager.getAnrController(aInfo); long anrDialogDelayMs = 0; if (anrController != null) { String packageName = aInfo.packageName; int uid = aInfo.uid; anrDialogDelayMs = anrController.getAnrDelayMillis(packageName, uid); // Might execute an async binder call to a system app to show an interim // ANR progress UI anrController.onAnrDelayStarted(packageName, uid); Slog.i(TAG, "ANR delay of " + anrDialogDelayMs + "ms started for " + packageName); } synchronized (mService) { synchronized (mService) { // mBatteryStatsService can be null if the AMS is constructed with injector only. This // mBatteryStatsService can be null if the AMS is constructed with injector only. This // will only happen in tests. // will only happen in tests. Loading Loading
services/core/java/com/android/server/am/ProcessErrorStateRecord.java +16 −14 Original line number Original line Diff line number Diff line Loading @@ -329,6 +329,22 @@ class ProcessErrorStateRecord { info.append("Package is ").append((int) (loadingProgress * 100)).append("% loaded.\n"); info.append("Package is ").append((int) (loadingProgress * 100)).append("% loaded.\n"); } } // Retrieve controller with max ANR delay from AnrControllers // Note that we retrieve the controller before dumping stacks because dumping stacks can // take a few seconds, after which the cause of the ANR delay might have completed and // there might no longer be a valid ANR controller to cancel the dialog in that case AnrController anrController = mService.mActivityTaskManager.getAnrController(aInfo); long anrDialogDelayMs = 0; if (anrController != null) { String packageName = aInfo.packageName; int uid = aInfo.uid; anrDialogDelayMs = anrController.getAnrDelayMillis(packageName, uid); // Might execute an async binder call to a system app to show an interim // ANR progress UI anrController.onAnrDelayStarted(packageName, uid); Slog.i(TAG, "ANR delay of " + anrDialogDelayMs + "ms started for " + packageName); } StringBuilder report = new StringBuilder(); StringBuilder report = new StringBuilder(); report.append(MemoryPressureUtil.currentPsiState()); report.append(MemoryPressureUtil.currentPsiState()); ProcessCpuTracker processCpuTracker = new ProcessCpuTracker(true); ProcessCpuTracker processCpuTracker = new ProcessCpuTracker(true); Loading Loading @@ -417,20 +433,6 @@ class ProcessErrorStateRecord { return; return; } } // Retrieve max ANR delay from AnrControllers without the mService lock since the // controllers might in turn call into apps AnrController anrController = mService.mActivityTaskManager.getAnrController(aInfo); long anrDialogDelayMs = 0; if (anrController != null) { String packageName = aInfo.packageName; int uid = aInfo.uid; anrDialogDelayMs = anrController.getAnrDelayMillis(packageName, uid); // Might execute an async binder call to a system app to show an interim // ANR progress UI anrController.onAnrDelayStarted(packageName, uid); Slog.i(TAG, "ANR delay of " + anrDialogDelayMs + "ms started for " + packageName); } synchronized (mService) { synchronized (mService) { // mBatteryStatsService can be null if the AMS is constructed with injector only. This // mBatteryStatsService can be null if the AMS is constructed with injector only. This // will only happen in tests. // will only happen in tests. Loading