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

Commit 5191964d authored by lijilou's avatar lijilou Committed by Jilou li
Browse files

Watchdog:do not need add or clear operation when mMonitorQueue is empty.

Bug: 374920072
Flag: EXEMPT minor optimization
Change-Id: I5a90968cdf35917c6ce8a9fe65ea5643975484a8
parent e37b8ffd
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -289,7 +289,7 @@ public class Watchdog implements Dumpable {
        public void scheduleCheckLocked(long handlerCheckerTimeoutMillis) {
        public void scheduleCheckLocked(long handlerCheckerTimeoutMillis) {
            mWaitMaxMillis = handlerCheckerTimeoutMillis;
            mWaitMaxMillis = handlerCheckerTimeoutMillis;


            if (mCompleted) {
            if (mCompleted && !mMonitorQueue.isEmpty()) {
                // Safe to update monitors in queue, Handler is not in the middle of work
                // Safe to update monitors in queue, Handler is not in the middle of work
                mMonitors.addAll(mMonitorQueue);
                mMonitors.addAll(mMonitorQueue);
                mMonitorQueue.clear();
                mMonitorQueue.clear();