Main Thread Checker warns about UIApplication.shared.backgroundTimeRemaining

Number:rdar://33541766 Date Originated:26-Jul-2017 06:21 PM
Status:Duplicated/32255329 Resolved:
Product:iOS + SDK Product Version:9 beta 4
Classification:UI/Usability Reproducible:Always
The Main Thread Checker warns about accessing `UIApplication.shared.backgroundTimeRemaining` from a background thread but it’s unreasonable pretend this. That property is by definition something that should be checked by the app while performing background work.

In all the versions of iOS, accessing that property never generate issues or crashes.

Steps to Reproduce:
From an iOS app, in a background thread, read the value of UIApplication.shared.backgroundTimeRemaining

Expected Results:
No warning. Main Thread Checker should not fires any warning

Actual Results:
Main Thread Checker: UI API called on a background thread: -[UIApplication backgroundTimeRemaining]
PID: 74391, TID: 1010259, Thread name: (none), Queue name: <queue name>, QoS: 0

9 beta 4

backgroundTimeRemaining, applicationState and backgroundRefreshStatus should be whitelisted.


Today Apple's team reply to my report saying that this bug is duplicated. The original bug report is 32255329 and it is still open.

By alessandro.calzavara at Aug. 11, 2017, 6:26 a.m. (reply...)

Seems this is synced on backgroundTaskAssertionQueue which calls BKSProcessAssertionBackgroundTimeRemaining so it seems synced and likely is thread safe.

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!