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

Commit a75c9e5a authored by Jing Ji's avatar Jing Ji
Browse files

Add missing lock in reschedulign service restart

Bug: 202268779
Test: atest FrameworksServicesTests:ServiceRestarterTest
Test: atest FrameworksMockingServicesTests:ActiveServicesTest
Change-Id: I72205ed34e238798cf07c5211e6534649a38235e
parent 0445e7bf
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -5000,12 +5000,15 @@ public final class ActiveServices {
                // Since we kicked off all its pending restarts, there could be some open slots
                // in the pending restarts list, schedule a check on it. We are posting to the same
                // handler, so by the time of the check, those immediate restarts should be done.
                mAm.mHandler.post(() ->
                mAm.mHandler.post(() -> {
                    final long now = SystemClock.uptimeMillis();
                    synchronized (mAm) {
                        rescheduleServiceRestartIfPossibleLocked(
                                getExtraRestartTimeInBetweenLocked(),
                                mAm.mConstants.SERVICE_MIN_RESTART_TIME_BETWEEN,
                                "other", SystemClock.uptimeMillis())
                );
                                "other", now);
                    }
                });
            }
        }
        return didSomething;