Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1b9dfda1 authored by Makoto Onuki's avatar Makoto Onuki
Browse files

bringDownServiceLocked() shouldn't complain when mServicesByName...

doesn't contain the given record, which is what happens when this method
is called by bringUpServiceLocked().

Bug 37746449
Test: bit CtsAppTestCases:ServiceTest

Change-Id: Ie540f634a0a1d2a1f16df382f1ea09a083ffa483
parent 2d5c0d89
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -2150,7 +2150,10 @@ public final class ActiveServices {

        final ServiceMap smap = getServiceMapLocked(r.userId);
        ServiceRecord found = smap.mServicesByName.remove(r.name);
        if (found != r) {

        // Note when this method is called by bringUpServiceLocked(), the service is not found
        // in mServicesByName and found will be null.
        if (found != null && found != r) {
            // This is not actually the service we think is running...  this should not happen,
            // but if it does, fail hard.
            smap.mServicesByName.put(r.name, found);