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

Commit e406be0d authored by louis_chang's avatar louis_chang Committed by Steve Kondik
Browse files

[ActivityManager] Bring up Service if not schedule to restart

Symptom:

A Service which has scheduled to restart, the
ServiceRecord.restartDelay will be set a value which is
greater than 0.

After the Service is restarted, the Service process got
killed again while client application invoked
unbindService(), there may have chances that results
DeadObjectException when schedule UnbindService to the
Service process  in removeConnectionLocked().

In that case, the Service would failed to scheduled restart.
(serviceProcessGoneLocked() -> serviceDoneExecutingLocked()
with finishing = true)

And the Service will unable to bring up afterward
whenever client applications invoked bindService()
because r.restartDelay > 0.

Solution:
Bring up Service if it was also not in the restarting list

Change-Id: I28b023f0ce36e496bd6b0c69fe71121a083be83b
parent 84abe100
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1369,7 +1369,7 @@ public final class ActiveServices {
            return null;
        }

        if (!whileRestarting && r.restartDelay > 0) {
        if (!whileRestarting && r.restartDelay > 0 && mRestartingServices.contains(r)) {
            // If waiting for a restart, then do nothing.
            return null;
        }