We're not correctly disabling the ConnectionChangeReceiver listeners, and bumping analytics, when the app goes background while the device is running in low memory conditions. Also the variable mIsInBackground is not set to true.
Basically ApplicationLifecycleMonitor.onTrimMemory(final int level) is called with a level that's not the classic TRIM_MEMORY_UI_HIDDEN (level used when the process had been showing a user interface, and is no longer doing so), and then all of our code is not running.
In my test case that was called with TRIM_MEMORY_COMPLETE, but we should check all other available constants.
Note that onTrimMemory(final int level) could be called anytime if the device is running in low memory conditions. Don't think we can just redo the same thing we're already doing in TRIM_MEMORY_UI_HIDDEN.
Tested on [device], Android [version]
Nexus 5X, 6.X
We're not correctly disabling the
ConnectionChangeReceiverlisteners, and bumping analytics, when the app goes background while the device is running in low memory conditions. Also the variablemIsInBackgroundis not set to true.Basically
ApplicationLifecycleMonitor.onTrimMemory(final int level)is called with alevelthat's not the classicTRIM_MEMORY_UI_HIDDEN(level used when the process had been showing a user interface, and is no longer doing so), and then all of our code is not running.In my test case that was called with
TRIM_MEMORY_COMPLETE, but we should check all other available constants.Note that
onTrimMemory(final int level)could be called anytime if the device is running in low memory conditions. Don't think we can just redo the same thing we're already doing inTRIM_MEMORY_UI_HIDDEN.Tested on [device], Android [version]
Nexus 5X, 6.X