Commit 59d40bdb authored by Gautier Pelloux-Prayer's avatar Gautier Pelloux-Prayer
Browse files

backgroundtask.m: fix invalid logging of remaining time

parent d5c088ac
......@@ -57,8 +57,9 @@ unsigned long belle_sip_begin_background_task(const char *name, belle_sip_backgr
return 0;
}
if (app.applicationState != UIApplicationStateBackground) {
belle_sip_message("Background task %s started. Unknown remaining time since application is not in background.", name);
// backgroundTimeRemaining is properly set only when running background... but not immediately!
if (app.applicationState != UIApplicationStateBackground || (app.backgroundTimeRemaining == DBL_MAX)) {
belle_sip_message("Background task %s started. Unknown remaining time since application is not fully in background.", name);
} else {
belle_sip_message("Background task %s started. Remaining time %.1f secs", name, app.backgroundTimeRemaining);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment