Loading services/core/java/com/android/server/am/ActiveServices.java +6 −6 Original line number Diff line number Diff line Loading @@ -793,7 +793,7 @@ public final class ActiveServices { // Asked to only stop if done with all work. Note that // to avoid leaks, we will take this as dropping all // start items up to and including this one. ServiceRecord.StartItem si = r.findDeliveredStart(startId, false); ServiceRecord.StartItem si = r.findDeliveredStart(startId, false, false); if (si != null) { while (r.deliveredStarts.size() > 0) { ServiceRecord.StartItem cur = r.deliveredStarts.remove(0); Loading Loading @@ -2869,14 +2869,14 @@ public final class ActiveServices { case Service.START_STICKY_COMPATIBILITY: case Service.START_STICKY: { // We are done with the associated start arguments. r.findDeliveredStart(startId, true); r.findDeliveredStart(startId, false, true); // Don't stop if killed. r.stopIfKilled = false; break; } case Service.START_NOT_STICKY: { // We are done with the associated start arguments. r.findDeliveredStart(startId, true); r.findDeliveredStart(startId, false, true); if (r.getLastStartId() == startId) { // There is no more work, and this service // doesn't want to hang around if killed. Loading @@ -2888,7 +2888,7 @@ public final class ActiveServices { // We'll keep this item until they explicitly // call stop for it, but keep track of the fact // that it was delivered. ServiceRecord.StartItem si = r.findDeliveredStart(startId, false); ServiceRecord.StartItem si = r.findDeliveredStart(startId, false, false); if (si != null) { si.deliveryCount = 0; si.doneExecutingCount++; Loading @@ -2900,7 +2900,7 @@ public final class ActiveServices { case Service.START_TASK_REMOVED_COMPLETE: { // Special processing for onTaskRemoved(). Don't // impact normal onStartCommand() processing. r.findDeliveredStart(startId, true); r.findDeliveredStart(startId, true, true); break; } default: Loading Loading @@ -3187,7 +3187,7 @@ public final class ActiveServices { stopServiceLocked(sr); } else { sr.pendingStarts.add(new ServiceRecord.StartItem(sr, true, sr.makeNextStartId(), baseIntent, null, 0)); sr.getLastStartId(), baseIntent, null, 0)); if (sr.app != null && sr.app.thread != null) { // We always run in the foreground, since this is called as // part of the "remove task" UI operation. Loading services/core/java/com/android/server/am/ServiceRecord.java +2 −2 Original line number Diff line number Diff line Loading @@ -550,11 +550,11 @@ final class ServiceRecord extends Binder { restartTime = 0; } public StartItem findDeliveredStart(int id, boolean remove) { public StartItem findDeliveredStart(int id, boolean taskRemoved, boolean remove) { final int N = deliveredStarts.size(); for (int i=0; i<N; i++) { StartItem si = deliveredStarts.get(i); if (si.id == id) { if (si.id == id && si.taskRemoved == taskRemoved) { if (remove) deliveredStarts.remove(i); return si; } Loading Loading
services/core/java/com/android/server/am/ActiveServices.java +6 −6 Original line number Diff line number Diff line Loading @@ -793,7 +793,7 @@ public final class ActiveServices { // Asked to only stop if done with all work. Note that // to avoid leaks, we will take this as dropping all // start items up to and including this one. ServiceRecord.StartItem si = r.findDeliveredStart(startId, false); ServiceRecord.StartItem si = r.findDeliveredStart(startId, false, false); if (si != null) { while (r.deliveredStarts.size() > 0) { ServiceRecord.StartItem cur = r.deliveredStarts.remove(0); Loading Loading @@ -2869,14 +2869,14 @@ public final class ActiveServices { case Service.START_STICKY_COMPATIBILITY: case Service.START_STICKY: { // We are done with the associated start arguments. r.findDeliveredStart(startId, true); r.findDeliveredStart(startId, false, true); // Don't stop if killed. r.stopIfKilled = false; break; } case Service.START_NOT_STICKY: { // We are done with the associated start arguments. r.findDeliveredStart(startId, true); r.findDeliveredStart(startId, false, true); if (r.getLastStartId() == startId) { // There is no more work, and this service // doesn't want to hang around if killed. Loading @@ -2888,7 +2888,7 @@ public final class ActiveServices { // We'll keep this item until they explicitly // call stop for it, but keep track of the fact // that it was delivered. ServiceRecord.StartItem si = r.findDeliveredStart(startId, false); ServiceRecord.StartItem si = r.findDeliveredStart(startId, false, false); if (si != null) { si.deliveryCount = 0; si.doneExecutingCount++; Loading @@ -2900,7 +2900,7 @@ public final class ActiveServices { case Service.START_TASK_REMOVED_COMPLETE: { // Special processing for onTaskRemoved(). Don't // impact normal onStartCommand() processing. r.findDeliveredStart(startId, true); r.findDeliveredStart(startId, true, true); break; } default: Loading Loading @@ -3187,7 +3187,7 @@ public final class ActiveServices { stopServiceLocked(sr); } else { sr.pendingStarts.add(new ServiceRecord.StartItem(sr, true, sr.makeNextStartId(), baseIntent, null, 0)); sr.getLastStartId(), baseIntent, null, 0)); if (sr.app != null && sr.app.thread != null) { // We always run in the foreground, since this is called as // part of the "remove task" UI operation. Loading
services/core/java/com/android/server/am/ServiceRecord.java +2 −2 Original line number Diff line number Diff line Loading @@ -550,11 +550,11 @@ final class ServiceRecord extends Binder { restartTime = 0; } public StartItem findDeliveredStart(int id, boolean remove) { public StartItem findDeliveredStart(int id, boolean taskRemoved, boolean remove) { final int N = deliveredStarts.size(); for (int i=0; i<N; i++) { StartItem si = deliveredStarts.get(i); if (si.id == id) { if (si.id == id && si.taskRemoved == taskRemoved) { if (remove) deliveredStarts.remove(i); return si; } Loading