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

Commit 305d339b authored by Mao Jinlong's avatar Mao Jinlong Committed by Gerrit - the friendly Code Review server
Browse files

AlarmMangerService: Fix the delay of ACTION_TIME_CHANGED for time-services

After boot completed, if low memory condition happens or some ordered
broadcasts have time out, it will cause delay for some receivers to
receive ordered broadcasts. Adding FLAG_RECEIVER_FOREGROUND into
time changed action will make TimeServiceBroadcastReceiver receive
ACTION_TIME_CHANGED in time.

CRs-Fixed: 630982
Change-Id: Id789d0b3c969af6b92f62612602ba119613382ab
parent ea1eecb4
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1837,7 +1837,8 @@ class AlarmManagerService extends SystemService {
                    }
                    Intent intent = new Intent(Intent.ACTION_TIME_CHANGED);
                    intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING
                            | Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
                            | Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT
                            | Intent.FLAG_RECEIVER_FOREGROUND);
                    getContext().sendBroadcastAsUser(intent, UserHandle.ALL);
                }