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

Skip to content
Commit 04bf84e2 authored by Suprabh Shukla's avatar Suprabh Shukla
Browse files

Remove exact listener alarms when uid gets cached

Listener alarms are only meant to be used within the duration of a valid
lifecycle. Once the app goes out of lifecycle, it can be killed
arbitrarily and the alarm will be removed. Therefore, no apps should be
relying on receiving an alarm after they go out of lifecycle.

Besides, apps can be frozen when they end up in the cached state. This
breaks the alarm delivery guarantees for listener based exact alarms.

So even though dropping the alarm while the app is frozen can cause
inconsistencies in the app's view of the world, this is now done
explicitly as per the contract of the listener exact alarm APIs: Exact
alarms expecting a callback on a listener will now be dropped as soon
as the app goes into cached state. This is done to ensure consistency
and reliability of behavior.

Test: atest FrameworksMockingServicesTests:AlarmManagerServiceTest
Test: atest FrameworksMockingServicesTests:AppStateTrackerTest

Bug: 265195908
Change-Id: If95a0aa7416c4233b244144b353e471322c303a2
parent 0085edf0
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