am 47c1cf4b: Merge "[ActivityManager] Fix ServiceRecord leakage"
* commit '47c1cf4b35616059409a0674382c2318494e877b': [ActivityManager] Fix ServiceRecord leakage
This commit is contained in:
@@ -2127,8 +2127,16 @@ public final class ActiveServices {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// First clear app state from services.
|
// Clean up any connections this application has to other services.
|
||||||
for (int i=app.services.size()-1; i>=0; i--) {
|
for (int i = app.connections.size() - 1; i >= 0; i--) {
|
||||||
|
ConnectionRecord r = app.connections.valueAt(i);
|
||||||
|
removeConnectionLocked(r, app, null);
|
||||||
|
}
|
||||||
|
updateServiceConnectionActivitiesLocked(app);
|
||||||
|
app.connections.clear();
|
||||||
|
|
||||||
|
// Clear app state from services.
|
||||||
|
for (int i = app.services.size() - 1; i >= 0; i--) {
|
||||||
ServiceRecord sr = app.services.valueAt(i);
|
ServiceRecord sr = app.services.valueAt(i);
|
||||||
synchronized (sr.stats.getBatteryStats()) {
|
synchronized (sr.stats.getBatteryStats()) {
|
||||||
sr.stats.stopLaunchedLocked();
|
sr.stats.stopLaunchedLocked();
|
||||||
@@ -2188,14 +2196,6 @@ public final class ActiveServices {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clean up any connections this application has to other services.
|
|
||||||
for (int i=app.connections.size()-1; i>=0; i--) {
|
|
||||||
ConnectionRecord r = app.connections.valueAt(i);
|
|
||||||
removeConnectionLocked(r, app, null);
|
|
||||||
}
|
|
||||||
updateServiceConnectionActivitiesLocked(app);
|
|
||||||
app.connections.clear();
|
|
||||||
|
|
||||||
ServiceMap smap = getServiceMap(app.userId);
|
ServiceMap smap = getServiceMap(app.userId);
|
||||||
|
|
||||||
// Now do remaining service cleanup.
|
// Now do remaining service cleanup.
|
||||||
|
|||||||
Reference in New Issue
Block a user