Skip to content
Commit 74b85211 authored by Suprabh Shukla's avatar Suprabh Shukla
Browse files

Hold wakeup alarms for as long as possible

If the screen is off, but the CPU is awake and epoll_wait returns for a
non-wakeup alarm, sending any wakeup alarm within its eligibility window
would cause all the held non-wakeup alarms to also fire, which could:
1. Elongate the length of the time the CPU is awake.
2. Cause apps to wake up and perform work.

This change defers sending any wakeup alarm as long as it is possible to
defer all such eligible alarms to later.

Also, fixed a bug in sorting after adding multiple alarms to the store.

Test: atest CtsAlarmManagerTestCases
atest FrameworksMockingServicesTests:com.android.server.alarm

Bug: 161497385
Change-Id: I01f98255091baddf4e7529f88733776e27d090d7
parent 54df7500
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment