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

Commit d9c28d7d authored by Mao Jinlong's avatar Mao Jinlong Committed by Steve Kondik
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 e2d2dde0
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1348,7 +1348,8 @@ class AlarmManagerService extends IAlarmManager.Stub {
                    mClockReceiver.scheduleTimeTickEvent();
                    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);
                    mContext.sendBroadcastAsUser(intent, UserHandle.ALL);
                }