summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-03-01 14:36:12 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-03-01 14:36:12 -0800
commitfd938f323c7507405e18b997173e0b5b2ebe9717 (patch)
tree50920c7b01bc20804d69b25ce19f2a4719fb2c10 /services
parent6910f429cdfa000628b82e164131a47a8748c8af (diff)
parent3a28f22eb65c57342749fa9535bc7ff53e550117 (diff)
downloadframeworks_base-fd938f323c7507405e18b997173e0b5b2ebe9717.zip
frameworks_base-fd938f323c7507405e18b997173e0b5b2ebe9717.tar.gz
frameworks_base-fd938f323c7507405e18b997173e0b5b2ebe9717.tar.bz2
Merge "Fix Issue 14340: Sticky Service killed with onDestroy not called, not restarted."
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/am/ActivityManagerService.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java
index 8d30868..ea49661 100644
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -9114,15 +9114,17 @@ public final class ActivityManagerService extends ActivityManagerNative
ServiceRecord.StartItem si = r.pendingStarts.remove(0);
if (DEBUG_SERVICE) Slog.v(TAG, "Sending arguments to: "
+ r + " " + r.intent + " args=" + si.intent);
- if (si.intent == null) {
- // If somehow we got a dummy start at the front, then
- // just drop it here.
+ if (si.intent == null && N > 1) {
+ // If somehow we got a dummy null intent in the middle,
+ // then skip it. DO NOT skip a null intent when it is
+ // the only one in the list -- this is to support the
+ // onStartCommand(null) case.
continue;
}
si.deliveredTime = SystemClock.uptimeMillis();
r.deliveredStarts.add(si);
si.deliveryCount++;
- if (si.targetPermissionUid >= 0) {
+ if (si.targetPermissionUid >= 0 && si.intent != null) {
grantUriPermissionUncheckedFromIntentLocked(si.targetPermissionUid,
r.packageName, si.intent, si.getUriPermissionsLocked());
}