Closed paulfthomas closed 4 years ago
Hi @paulfthomas,
Thanks for the issue report, we appreciate the logs and additional context information. We'll investigate the issue and I'll update when we know more.
For context, is 2.8.4 the first version of the SDK integrated into your application, or is this a new issue after an upgrade?
Thanks, @gwhelanLD
Hi @gwhelanLD,
This issue is not new and was also occurring with the version 2.5.3
we were previously using.
Thanks!
Hi @paulfthomas,
Firstly let me thank you for your patience as we made the time to investigate this issue. At this time we are unable to replicate a manner in which the Android SDK would create multiple alarms. The referenced stack overflow post shows an issue caused by using PendingIntent.FLAG_CANCEL_CURRENT
on PendingIntent.getBroadcast
which prevents the AlarmManager.cancel(PendingIntent)
call from removing the alarm. The Android SDK does not use this flag and cancels the alarm directly, as well as uses an identical Intent
and alarmCode
to prevent duplicate alarms. Due to this we suspect that the process may already have 500 alarms through some other source, causing this error to occur on the Samsung devices that enforce this limit.
The solution we'll be including in the next release is to catch this exception to prevent killing the Application, but in the case this is triggered the background polling will not have been able to set up the alarm to trigger polling. I'll leave this issue open until we release that change.
Thanks, @gwhelanLD
Thanks for your patience on this issue. We've just released version 2.9.1, which addresses this issue in the manner discussed in my previous comment.
Thanks again, @gwhelanLD
Describe the bug Crash only impacting Samsung devices, probably related to the way the
PendingIntent
is retrieved in thePollingUpdater
. See https://github.com/launchdarkly/android-client-sdk/blob/master/launchdarkly-android-client-sdk/src/main/java/com/launchdarkly/android/PollingUpdater.java#L56Logs
SDK version 2.8.4
Additional context https://stackoverflow.com/questions/29344971/java-lang-securityexception-too-many-alarms-500-registered-from-pid-10790-u