Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reuse intent for alarms #400

Merged
merged 2 commits into from
May 17, 2019
Merged

Reuse intent for alarms #400

merged 2 commits into from
May 17, 2019

Conversation

andrlee
Copy link
Contributor

@andrlee andrlee commented May 17, 2019

This PR addresses SecurityException thrown by AlarmManager system service, which can be configured by OEMs (like Samsung) to limit number of alarms per process and as a result user would experience: Fatal Exception: java.lang.SecurityException: !@Too many alarms (500) registered from pid 9869 uid 10230. Since we're using alarms as triggers for data uploads, we could potentially hit 500 limit.

Solution is to reuse pending intent which effectively means a single alarm will be reused for a single telemetry stream (we currently maintain 3 at most). In future the plan is to migrate to single alarm as trigger for data upload from all active telemetry data streams. Tested change with Samsung device in the cloud.

Reuse the same intent for alarm and prevent hitting 500
alarms per process limit on Samsung devices
@codecov
Copy link

codecov bot commented May 17, 2019

Codecov Report

Merging #400 into master will increase coverage by 1.23%.
The diff coverage is 100%.

@@             Coverage Diff              @@
##             master     #400      +/-   ##
============================================
+ Coverage     68.14%   69.37%   +1.23%     
- Complexity      348      349       +1     
============================================
  Files            63       61       -2     
  Lines          2009     1979      -30     
  Branches        150      148       -2     
============================================
+ Hits           1369     1373       +4     
+ Misses          552      518      -34     
  Partials         88       88

@andrlee andrlee requested a review from alfwatt May 17, 2019 04:01
@andrlee andrlee merged commit 7d989c9 into master May 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants