summaryrefslogtreecommitdiffstats
path: root/core/java/android/app
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2015-01-21 09:55:13 -0800
committerDianne Hackborn <hackbod@google.com>2015-01-21 09:55:13 -0800
commit455625e298204a27d3958eb56ff155f27562eec8 (patch)
treea43cdff7f280b13275a3cd0749ff8d7e3229772f /core/java/android/app
parent66f8d9bb693d5e410ac6f6ba3029cf6c7dc2f104 (diff)
downloadframeworks_base-455625e298204a27d3958eb56ff155f27562eec8.zip
frameworks_base-455625e298204a27d3958eb56ff155f27562eec8.tar.gz
frameworks_base-455625e298204a27d3958eb56ff155f27562eec8.tar.bz2
Work on issue #18201239: ANRs in com.google.process.gapps:
Reason: Executing service com.google.android.syncadapters.contacts /.SyncHighResPhotoIntentService Make the code more robust when destroying services, so that if the nesting count gets out of sync we don't just hang. Change-Id: If117d5ef242e7c148fd9576bd89a1a092583d6ad
Diffstat (limited to 'core/java/android/app')
-rw-r--r--core/java/android/app/ActivityThread.java17
1 files changed, 12 insertions, 5 deletions
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index b5c0e90..f2be45c 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -168,6 +168,13 @@ public final class ActivityThread {
private static final int LOG_ON_PAUSE_CALLED = 30021;
private static final int LOG_ON_RESUME_CALLED = 30022;
+ /** Type for IActivityManager.serviceDoneExecuting: anonymous operation */
+ public static final int SERVICE_DONE_EXECUTING_ANON = 0;
+ /** Type for IActivityManager.serviceDoneExecuting: done with an onStart call */
+ public static final int SERVICE_DONE_EXECUTING_START = 1;
+ /** Type for IActivityManager.serviceDoneExecuting: done stopping (destroying) service */
+ public static final int SERVICE_DONE_EXECUTING_STOP = 2;
+
private ContextImpl mSystemContext;
static IPackageManager sPackageManager;
@@ -2758,7 +2765,7 @@ public final class ActivityThread {
mServices.put(data.token, service);
try {
ActivityManagerNative.getDefault().serviceDoneExecuting(
- data.token, 0, 0, 0);
+ data.token, SERVICE_DONE_EXECUTING_ANON, 0, 0);
} catch (RemoteException e) {
// nothing to do.
}
@@ -2787,7 +2794,7 @@ public final class ActivityThread {
} else {
s.onRebind(data.intent);
ActivityManagerNative.getDefault().serviceDoneExecuting(
- data.token, 0, 0, 0);
+ data.token, SERVICE_DONE_EXECUTING_ANON, 0, 0);
}
ensureJitEnabled();
} catch (RemoteException ex) {
@@ -2815,7 +2822,7 @@ public final class ActivityThread {
data.token, data.intent, doRebind);
} else {
ActivityManagerNative.getDefault().serviceDoneExecuting(
- data.token, 0, 0, 0);
+ data.token, SERVICE_DONE_EXECUTING_ANON, 0, 0);
}
} catch (RemoteException ex) {
}
@@ -2897,7 +2904,7 @@ public final class ActivityThread {
try {
ActivityManagerNative.getDefault().serviceDoneExecuting(
- data.token, 1, data.startId, res);
+ data.token, SERVICE_DONE_EXECUTING_START, data.startId, res);
} catch (RemoteException e) {
// nothing to do.
}
@@ -2928,7 +2935,7 @@ public final class ActivityThread {
try {
ActivityManagerNative.getDefault().serviceDoneExecuting(
- token, 0, 0, 0);
+ token, SERVICE_DONE_EXECUTING_STOP, 0, 0);
} catch (RemoteException e) {
// nothing to do.
Slog.i(TAG, "handleStopService: unable to execute serviceDoneExecuting for "