Helium314 / Local-NLP-Backend

Yet another network location backend for the UnifiedNLP/microG project
GNU General Public License v3.0
64 stars 4 forks source link

Too many requests? #16

Closed ZJaume closed 1 year ago

ZJaume commented 1 year ago

Noticed that the app was doing requests to frequently. Location indicator shows up every 10-30 seconds while seated and not moving, so I guess scanned networks are barely changing. I'm using LocalNLPBackend in MicroG with location permission allowed always, Android 13, LineageOS4microg 20.0, "Use cell towers" enabled, "Use wifi locations" enabled, active mode off, active mode GPS timout 10.

This is a sample from the logcat grepping the app id:

05-17 17:41:55.221  4023  4023 D LocationFuser: Received no location from helium314.localbackend/org.fitchfamily.android.dejavu.BackendService
05-17 17:41:55.223  1699  2042 I WifiScanRequestProxy: Scan request from helium314.localbackend throttled
05-17 17:42:05.220  4023  4023 D LocationFuser: Received no location from helium314.localbackend/org.fitchfamily.android.dejavu.BackendService
05-17 17:42:05.222  1699  2042 I WifiScanRequestProxy: Scan request from helium314.localbackend throttled
05-17 17:42:15.220  4023  4023 D LocationFuser: Received no location from helium314.localbackend/org.fitchfamily.android.dejavu.BackendService
05-17 17:42:15.227  1699  2042 I WifiScanRequestProxy: Scan request from helium314.localbackend throttled
05-17 17:42:25.220  4023  4023 D LocationFuser: Received no location from helium314.localbackend/org.fitchfamily.android.dejavu.BackendService
05-17 17:42:25.222  1699  2042 I WifiScanRequestProxy: Scan request from helium314.localbackend throttled
05-17 17:42:35.226  4023  4023 D LocationFuser: Received no location from helium314.localbackend/org.fitchfamily.android.dejavu.BackendService
05-17 17:42:35.230  1699  2042 I WifiScanRequestProxy: Scan request from helium314.localbackend throttled
05-17 17:42:45.220  4023  4023 D LocationFuser: Received no location from helium314.localbackend/org.fitchfamily.android.dejavu.BackendService
05-17 17:42:45.238  1699  2042 I WifiScanRequestProxy: Scan request from helium314.localbackend throttled
05-17 17:42:55.221  1699  2042 I WifiScanRequestProxy: Scan request from helium314.localbackend throttled
05-17 17:42:55.222  4023  4023 D LocationFuser: Received no location from helium314.localbackend/org.fitchfamily.android.dejavu.BackendService
05-17 17:43:05.221  4023  4023 D LocationFuser: Received no location from helium314.localbackend/org.fitchfamily.android.dejavu.BackendService
05-17 17:43:05.224  1699  2042 I WifiScanRequestProxy: Scan request from helium314.localbackend throttled
05-17 17:43:15.220  4023  4023 D LocationFuser: Received no location from helium314.localbackend/org.fitchfamily.android.dejavu.BackendService
05-17 17:43:15.222  1699  2042 I WifiScanRequestProxy: Scan request from helium314.localbackend throttled
05-17 17:43:25.223  1699  2042 I WifiScanRequestProxy: Scan request from helium314.localbackend throttled
05-17 17:43:25.223  4023  4023 D LocationFuser: Received no location from helium314.localbackend/org.fitchfamily.android.dejavu.BackendService
05-17 17:43:35.221  4023  4023 D LocationFuser: Received no location from helium314.localbackend/org.fitchfamily.android.dejavu.BackendService
05-17 17:43:35.224  1699  2042 I WifiScanRequestProxy: Scan request from helium314.localbackend throttled
05-17 17:43:45.228  1699  2042 I WifiScanRequestProxy: Scan request from helium314.localbackend throttled
05-17 17:43:45.228  4023  4023 D LocationFuser: Received no location from helium314.localbackend/org.fitchfamily.android.dejavu.BackendService
05-17 17:43:55.221  4023  4023 D LocationFuser: Received no location from helium314.localbackend/org.fitchfamily.android.dejavu.BackendService
05-17 17:43:55.233  1699  2042 I WifiScanRequestProxy: Scan request from helium314.localbackend throttled
05-17 17:44:05.221  4023  4023 D LocationFuser: Received no location from helium314.localbackend/org.fitchfamily.android.dejavu.BackendService
05-17 17:44:05.223  1699  2042 I WifiScanRequestProxy: Scan request from helium314.localbackend throttled
05-17 17:44:15.221  1699  2042 I WifiScanRequestProxy: Scan request from helium314.localbackend throttled
05-17 17:44:15.223  4023  4023 D LocationFuser: Received no location from helium314.localbackend/org.fitchfamily.android.dejavu.BackendService
05-17 17:44:49.704  4023  4023 D LocationFuser: Received no location from helium314.localbackend/org.fitchfamily.android.dejavu.BackendService
05-17 17:44:49.705  4023  4023 D LocationFuser: Received no location from helium314.localbackend/org.fitchfamily.android.dejavu.BackendService
05-17 17:44:49.706  4023  4023 D LocationFuser: Received no location from helium314.localbackend/org.fitchfamily.android.dejavu.BackendService
05-17 17:44:49.706  1699  2042 I WifiScanRequestProxy: Scan request from helium314.localbackend throttled
05-17 17:44:55.220  4023  4023 D LocationFuser: Received no location from helium314.localbackend/org.fitchfamily.android.dejavu.BackendService
05-17 17:44:55.222  1699  2042 I WifiScanRequestProxy: Scan request from helium314.localbackend throttled
05-17 17:45:05.219  4023  4023 D LocationFuser: Received no location from helium314.localbackend/org.fitchfamily.android.dejavu.BackendService
05-17 17:45:05.221  1699  2042 I WifiScanRequestProxy: Scan request from helium314.localbackend throttled
05-17 17:45:15.220  4023  4023 D LocationFuser: Received no location from helium314.localbackend/org.fitchfamily.android.dejavu.BackendService
05-17 17:45:15.222  1699  2042 I WifiScanRequestProxy: Scan request from helium314.localbackend throttled
05-17 17:45:25.219  4023  4023 D LocationFuser: Received no location from helium314.localbackend/org.fitchfamily.android.dejavu.BackendService
05-17 17:45:25.222  1699  2042 I WifiScanRequestProxy: Scan request from helium314.localbackend throttled
05-17 17:45:35.220  4023  4023 D LocationFuser: Received no location from helium314.localbackend/org.fitchfamily.android.dejavu.BackendService
05-17 17:45:35.221  1699  2042 I WifiScanRequestProxy: Scan request from helium314.localbackend throttled

Is this something expected?

Helium314 commented 1 year ago

A WiFi scan is started if WiFi locations are enabled in the settings (enabled by default), and

To me it looks like either you have GPS on, or you have some app frequently requesting network locations, or the microG requests locations by itself, though that is not expected.

You can check why a scan is started if you use the debug version. You should either get update() - NLP asking for location or onGpsChanged() - accuracy <accuracy value> before the scan (attempt)