traccar / traccar-client-android

Traccar Client for Android
https://www.traccar.org/client
Apache License 2.0
661 stars 729 forks source link

getProvider() test #364

Open oliv3 opened 6 years ago

oliv3 commented 6 years ago

Hi, https://github.com/traccar/traccar-client-android/blob/2a36e1aa6d8038793f2f968d915af56f3763e54a/app/src/main/java/org/traccar/client/Position.java#L37-L39 location.getProvider() will always return the string "fused", when previous versions returned LocationManager.GPS_PROVIDER or .NETWORK_PROVIDER.

So, testing with .equals() here will always fail. Hence, accuracy will always be set, regardless of the location provider.

No idea if this is intended ?

tananaev commented 6 years ago

I don't understand where fused provider comes from. We don't use it.

oliv3 commented 6 years ago

Oops I agree wrong title.

tananaev commented 6 years ago

I still don't understand how it could return "fused" value.

oliv3 commented 6 years ago

That's what getProvider() returns now:

POST /?id=1122334455&timestamp=1536800250&lat=49.27344199&lon=-0.26038954&batt=79.0&speed=0.971922&bearing=303.8&altitude=65.0&accuracy=21.44&provider=fused HTTP/1.1
tananaev commented 6 years ago

Interesting... what device are you using? And what Android version? And what accuracy setting?

oliv3 commented 6 years ago

@tananaev Updated https://github.com/traccar/traccar-client-android/pull/348.