Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8e3e4457 authored by Hui Yu's avatar Hui Yu
Browse files

No service timeout when debbuger is attached

Don't trigger service timeout when debbuger is attached.
Also do not kill the process for isSilentAnr when app is under debugging.

Fix: 130307879
Test: Set a breakpoint in app's Service.onCreate(), debug the app, start
the service and hit the breakpoint. Make sure there is no ANR from the
service timeout.

Change-Id: I32075543fb864869c2719c3c022681a9a2318a60
parent f090b589
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -3830,8 +3830,11 @@ public final class ActiveServices {

    void serviceTimeout(ProcessRecord proc) {
        String anrMessage = null;

        synchronized(mAm) {
            if (proc.isDebugging()) {
                // The app's being debugged, ignore timeout.
                return;
            }
            if (proc.executingServices.size() == 0 || proc.thread == null) {
                return;
            }
+1 −1
Original line number Diff line number Diff line
@@ -1557,7 +1557,7 @@ class ProcessRecord implements WindowProcessListener {
                mService.mBatteryStatsService.noteProcessAnr(processName, uid);
            }

            if (isSilentAnr()) {
            if (isSilentAnr() && !isDebugging()) {
                kill("bg anr", true);
                return;
            }