OSDN Git Service

Don't time out startForegroundService when debugging the app
authorChristopher Tate <ctate@google.com>
Fri, 16 Feb 2018 19:07:12 +0000 (11:07 -0800)
committerChris Tate <ctate@android.com>
Fri, 9 Mar 2018 23:59:13 +0000 (23:59 +0000)
Change-Id: Ica022b028697335f60e5f52f6290b1f47ea0fb55
Fixes: 70870073
Test: manual

services/core/java/com/android/server/am/ActiveServices.java

index 26f83f5..eb4e32e 100644 (file)
@@ -3390,10 +3390,15 @@ public final class ActiveServices {
                 return;
             }
 
+            app = r.app;
+            if (app != null && app.debugging) {
+                // The app's being debugged; let it ride
+                return;
+            }
+
             if (DEBUG_BACKGROUND_CHECK) {
                 Slog.i(TAG, "Service foreground-required timeout for " + r);
             }
-            app = r.app;
             r.fgWaiting = false;
             stopServiceLocked(r);
         }