I'm having an issue with mock location providers. I have an app that needs to get accurate valid locations, and I don't want the user to be able to spoof them. So I have a check for the mock locations enabled setting, which works fine.
However there is a problem with the location provider. If you enable mock locations, set a location with a gps faker app, then disable mock locations and all other location providers, the location manager still has a reference to the mock location provider. So although mock locations are disabled, the location manager tells me that gps is enabled, and serves mocked location data.
I know that you can clear test providers from the location manager, but mock locations must be enabled to do this
Anyone ever come across this, or have a work around?