mirror of
https://github.com/bitwarden/android.git
synced 2025-01-13 11:47:33 +03:00
PM-3350 Commented event collection upload on the timer and when sending the app to background to see if that prevents the app from crashing on release mode.
This commit is contained in:
parent
05677f93c5
commit
c74636ffa5
1 changed files with 29 additions and 27 deletions
|
@ -462,20 +462,21 @@ namespace Bit.iOS
|
|||
_eventTimer?.Invalidate();
|
||||
_eventTimer?.Dispose();
|
||||
_eventTimer = null;
|
||||
MainThread.BeginInvokeOnMainThread(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
_eventTimer = NSTimer.CreateScheduledTimer(60, true, timer =>
|
||||
{
|
||||
_eventService?.UploadEventsAsync().FireAndForget();
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LoggerHelper.LogEvenIfCantBeResolved(ex);
|
||||
}
|
||||
});
|
||||
// TODO: Uncomment, this is just a test to see if this is causing the background crash on release when sending the app to background
|
||||
//MainThread.BeginInvokeOnMainThread(() =>
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// _eventTimer = NSTimer.CreateScheduledTimer(60, true, timer =>
|
||||
// {
|
||||
// _eventService?.UploadEventsAsync().FireAndForget();
|
||||
// });
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// LoggerHelper.LogEvenIfCantBeResolved(ex);
|
||||
// }
|
||||
//});
|
||||
}
|
||||
|
||||
private async Task StopEventTimerAsync()
|
||||
|
@ -485,19 +486,20 @@ namespace Bit.iOS
|
|||
_eventTimer?.Invalidate();
|
||||
_eventTimer?.Dispose();
|
||||
_eventTimer = null;
|
||||
if (_eventBackgroundTaskId > 0)
|
||||
{
|
||||
UIApplication.SharedApplication.EndBackgroundTask(_eventBackgroundTaskId);
|
||||
_eventBackgroundTaskId = 0;
|
||||
}
|
||||
_eventBackgroundTaskId = UIApplication.SharedApplication.BeginBackgroundTask(() =>
|
||||
{
|
||||
UIApplication.SharedApplication.EndBackgroundTask(_eventBackgroundTaskId);
|
||||
_eventBackgroundTaskId = 0;
|
||||
});
|
||||
await _eventService.UploadEventsAsync();
|
||||
UIApplication.SharedApplication.EndBackgroundTask(_eventBackgroundTaskId);
|
||||
_eventBackgroundTaskId = 0;
|
||||
// TODO: Uncomment, this is just a test to see if this is causing the background crash on release when sending the app to background
|
||||
//if (_eventBackgroundTaskId > 0)
|
||||
//{
|
||||
// UIApplication.SharedApplication.EndBackgroundTask(_eventBackgroundTaskId);
|
||||
// _eventBackgroundTaskId = 0;
|
||||
//}
|
||||
//_eventBackgroundTaskId = UIApplication.SharedApplication.BeginBackgroundTask(() =>
|
||||
//{
|
||||
// UIApplication.SharedApplication.EndBackgroundTask(_eventBackgroundTaskId);
|
||||
// _eventBackgroundTaskId = 0;
|
||||
//});
|
||||
//await _eventService.UploadEventsAsync();
|
||||
//UIApplication.SharedApplication.EndBackgroundTask(_eventBackgroundTaskId);
|
||||
//_eventBackgroundTaskId = 0;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue