mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
better fix of background task remain time
This commit is contained in:
parent
b97ecd8f7c
commit
f3c381b56b
2 changed files with 6 additions and 4 deletions
|
|
@ -2208,8 +2208,8 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) {
|
|||
[[UIApplication sharedApplication] endBackgroundTask:pushBgTaskCall];
|
||||
pushBgTaskCall = 0;
|
||||
}];
|
||||
LOGI(@"Call long running task started for call-id [%@], remaining [%g s] because a push has been received",
|
||||
callId, [[UIApplication sharedApplication] backgroundTimeRemaining]);
|
||||
LOGI(@"Call long running task started for call-id [%@], remaining [%@ s] because a push has been received",
|
||||
callId, [LinphoneUtils intervalToString:[[UIApplication sharedApplication] backgroundTimeRemaining]]);
|
||||
} else if ([loc_key isEqualToString:@"IC_SIL"]) {
|
||||
[[UIApplication sharedApplication] endBackgroundTask:pushBgTaskRefer];
|
||||
pushBgTaskRefer = 0;
|
||||
|
|
@ -2225,8 +2225,8 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) {
|
|||
[[UIApplication sharedApplication] endBackgroundTask:pushBgTaskRefer];
|
||||
pushBgTaskRefer = 0;
|
||||
}];
|
||||
LOGI(@"Refer long running task started for call-id [%@], remaining [%g s] because a push has been received",
|
||||
callId, [[UIApplication sharedApplication] backgroundTimeRemaining]);
|
||||
LOGI(@"Refer long running task started for call-id [%@], remaining [%@ s] because a push has been received",
|
||||
callId, [LinphoneUtils intervalToString:[[UIApplication sharedApplication] backgroundTimeRemaining]]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -76,6 +76,8 @@
|
|||
+ (NSString *) intervalToString:(NSTimeInterval)interval {
|
||||
NSDateComponentsFormatter *formatter = [[NSDateComponentsFormatter alloc] init];
|
||||
formatter.allowedUnits = NSCalendarUnitSecond;
|
||||
formatter.unitsStyle = NSDateComponentsFormatterUnitsStyleAbbreviated;
|
||||
formatter.zeroFormattingBehavior = NSDateComponentsFormatterZeroFormattingBehaviorDropAll;
|
||||
return [formatter stringFromTimeInterval:interval];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue