Loading services/core/java/com/android/server/am/AnrHelper.java +5 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,11 @@ class AnrHelper { WindowProcessController parentProcess, boolean aboveSystem, String annotation) { final int incomingPid = anrProcess.mPid; synchronized (mAnrRecords) { if (incomingPid == 0) { // Extreme corner case such as zygote is no response to return pid for the process. Slog.i(TAG, "Skip zero pid ANR, process=" + anrProcess.processName); return; } if (mProcessingPid == incomingPid) { Slog.i(TAG, "Skip duplicated ANR, pid=" + incomingPid + " " + annotation); return; Loading services/tests/servicestests/src/com/android/server/am/AnrHelperTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -70,6 +70,7 @@ public class AnrHelperTest { final Context context = getInstrumentation().getTargetContext(); runWithDexmakerShareClassLoader(() -> { mAnrApp = mock(ProcessRecord.class); mAnrApp.mPid = 12345; final ProcessErrorStateRecord errorState = mock(ProcessErrorStateRecord.class); setFieldValue(ProcessErrorStateRecord.class, errorState, "mProcLock", new ActivityManagerProcLock()); Loading Loading @@ -130,7 +131,6 @@ public class AnrHelperTest { }).when(mAnrApp.mErrorState).appNotResponding(anyString(), any(), any(), any(), anyBoolean(), anyString(), anyBoolean()); final ApplicationInfo appInfo = new ApplicationInfo(); mAnrApp.mPid = 12345; final Runnable reportAnr = () -> mAnrHelper.appNotResponding(mAnrApp, "activityShortComponentName", appInfo, "parentShortComponentName", null /* parentProcess */, false /* aboveSystem */, "annotation"); Loading Loading
services/core/java/com/android/server/am/AnrHelper.java +5 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,11 @@ class AnrHelper { WindowProcessController parentProcess, boolean aboveSystem, String annotation) { final int incomingPid = anrProcess.mPid; synchronized (mAnrRecords) { if (incomingPid == 0) { // Extreme corner case such as zygote is no response to return pid for the process. Slog.i(TAG, "Skip zero pid ANR, process=" + anrProcess.processName); return; } if (mProcessingPid == incomingPid) { Slog.i(TAG, "Skip duplicated ANR, pid=" + incomingPid + " " + annotation); return; Loading
services/tests/servicestests/src/com/android/server/am/AnrHelperTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -70,6 +70,7 @@ public class AnrHelperTest { final Context context = getInstrumentation().getTargetContext(); runWithDexmakerShareClassLoader(() -> { mAnrApp = mock(ProcessRecord.class); mAnrApp.mPid = 12345; final ProcessErrorStateRecord errorState = mock(ProcessErrorStateRecord.class); setFieldValue(ProcessErrorStateRecord.class, errorState, "mProcLock", new ActivityManagerProcLock()); Loading Loading @@ -130,7 +131,6 @@ public class AnrHelperTest { }).when(mAnrApp.mErrorState).appNotResponding(anyString(), any(), any(), any(), anyBoolean(), anyString(), anyBoolean()); final ApplicationInfo appInfo = new ApplicationInfo(); mAnrApp.mPid = 12345; final Runnable reportAnr = () -> mAnrHelper.appNotResponding(mAnrApp, "activityShortComponentName", appInfo, "parentShortComponentName", null /* parentProcess */, false /* aboveSystem */, "annotation"); Loading