Navigation apps use network location instead mock
Problem: In the new versions of Android, it is impossible to use mock location while the location service is not enabled (the fused location provider is available). Therefore, applications like com.yandex.maps and com.yandex.navigator (possibly others as well) display a mock location from Bluetooth GNSS for a while, then switch to network location because the fused location provider is active and can process application requests. It is impossible to revoke COARSE_LOCATION from the application via appops, leaving only FINE_LOCATION.
Possible reasons:
- Lack of accuracy (Bluetooth GNSS sets the accuracy for mock location much higher than PDOP).
- Absence of some typical GPS parameters (speed, course, possibly something else) in the mock location, which causes the navigation application to "suspect" that it is a mock and switch to a more trusted provider.
Solutions:
- Create a test build that transmits a floating accuracy within 1-2 meters to check the reaction of navigation applications. It is possible to mathematically adjust the accuracy currently provided by Bluetooth GNSS to a range of 1..2m or 2..3m, but not more. Higher values are considered unreliable in navigation programs.
- Along with mock GPS, transmit mock network. Create an additional setting for this. All this functionality is available in the Bluetooth GPS Provider app (de.mobilej.btgps), with the options "Use GPS position for Network Provider" and "RAW HDOP." However, it is very old and does not work on Android 15. //https://l-36.com/bluetooth_gps_provider.php
I have an external receiver, but I can't actually use it in Yandex applications. I tried using all available applications Bluetooth receiver -> mock location, but the behavior is the same everywhere; after some time, Yandex switches to network location. Making a build with fixed accuracy is a matter of 10 minutes. Please help me.
Hello,
Thanks for the detailed issue report.
Please try reducing device CEP in the settings of latest release (it will set accuracy as HDOP x CEP and also show in the connected screen UI how much accuracy was actually set) seems to have solved for the qfield app for a similar issue. Below is the latest release pls try: https://github.com/ykasidit/bluetooth_gnss/releases/tag/v3.0.4
In Yandex Maps, the problem is not with the update frequency or the accuracy of the coordinates. It's somewhere else. Two phones, both receiving coordinates from the same receiver, frequency 2Hz, accuracy less than a meter:
- Global firmware, tightly integrated Google services (not possible to disable or revoke some app ops), Android-15 NebulaOS1.0.5 - com.yandex.maps shows the location based on mock location, then after 10-20 seconds switches to coordinates from coarse location with very low accuracy. After a while, it may return to mock (or it may not), at most for a minute, and it keeps jumping back and forth. In Google Maps, the location is reliably shown strictly according to mock.
- Chinese firmware, disable-able Google services (but they work), the same Android-15 on ColorOS15.0 - com.yandex.maps reliably holds the coordinates from mock location, nothing jumps around. I can turn on wi-fi/bt scanning + improved google location, nothing changed - yandex maps show mock location.
I'm somewhat at a dead end; I'll have to compare the phone configurations in detail and try to find the differences, while they already exist - a different geolocation stack. (1) has only gms, while (2) has com.oplus.location+gms.
Please try this:
-
keep phone location on - this is required - apps it will use location from mock when mock is on and Bluetooth gnss is connected, (I already mock gms location as per open source package recommend by izzyondroid)
-
to test the location is from mock of Bluetooth gnss mock and not from phone internal gps, go to map tab of Bluetooth gnss app > long tap on somewhere very far away until it changes, this will add offset to mock location, then go to your other app see if location change to same location and stays there or not, if it does then it is good and confirms that it is using mock location not internal gps. (Then you can clear lat lon offset in Bluetooth gnss settings tab later). This test works with Google Maps I tried earlier on my phone.
Please try this:
Already. The ability to "shift" the mock coordinates is very helpful, thank you. With these settings, it jumps less often, but it still jumps (00:20..03:10)
adb shell settings put secure location_mode 1
adb shell settings put secure location_providers_allowed "gps"
adb shell settings put secure mock_location 1
adb shell settings put global location_ignore_settings_package_whitelist=com.google.android.dialer
I'm confused by the absence of degree in mock, but I saw in the source code that there seem to be reasons for this.
Top result is 04:20 of mock position