Issue in Energy Profile on iOS 10.3

Originator:yogesh
Number:rdar://32511330 Date Originated:June 1 2017
Status:Open Resolved:
Product:iOS Product Version:10.3
Classification:Location Services Reproducible:Always
 
Summary:
We were trying to profile our application for battery consumption and were using Energy Log in Instruments. We are observing a strange phenomenon in the GPS metric and wanted to understand what is happening. We have a created minimum application to showcase this issue: 

- The min application simply has one button which starts/stops location services
- We start the application using Energy Log Instrument and start location services
- After 30secs, we stop location services

When we do the above on a device running iOS 9.3.5, we observe the GPS go from OFF to ON and back to OFF exactly when we turn location on/off. 

When the same experiment is run on a device with iOS 10.3.2, the GPS goes ON when we start location services. However, it takes about 5mins after invoking stopUpdatingLocation for the GPS to back to OFF. 

We have reproduced this issue on two version of XCode: 8.3.2 and 7.3.1

We have created screen grab videos of the process described above. You can find these videos and the project code along with the Instrument trace files here: https://drive.google.com/open?id=0B22BEECqThilRFJSSEwwSVUxeG8

Steps to Reproduce:
To reproduce, you need to monitor GPS state under Energy Log instrument of any simple app which using CLLocationManager. Invoke "startUpdatingLocation", wait 30secs and invoke "stopUpdatingLocation". 

We have created screen grab videos of the issue. You can find the videos, the project code and the Instrument trace files here: https://drive.google.com/open?id=0B22BEECqThilRFJSSEwwSVUxeG8

Expected Results:
GPS state should become "OFF" immediately after calling stopUpdatingLocation

Observed Results:
iOS 9 GPS state shows "OFF" immediately after calling stopUpdatingLocation but on iOS 10 it goes to "OFF" after approximately 5 minutes

Version:
iOS 10.2 and iOS 10.3

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com 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!