traccar-client-android
traccar-client-android copied to clipboard
Crash with the SOS shortcut
Confirmed with 5.11 from Google Play Store and master branch. Steps to reproduce:
- Install the client.
- Start the application, allow location requests. (No configuration changes are needed).
- Stop the application.
- Close the application.
- Make sure the phone's location services are turned OFF.
Then, using the application's shortcuts:
- Send SOS. Result is "Send failed".
- Start the service. Result is "Service started".
- Send SOS. Result is "Send failed".
- Stop the service. Result is "Service stopped".
- Send SOS. The application crashes.
Crash report:
09-01 19:03:13.359 12877-12877/org.traccar.client E/AndroidRuntime: FATAL EXCEPTION: main
Process: org.traccar.client, PID: 12877
java.lang.IllegalStateException: LostApiClient is not connected.
at com.mapzen.android.lost.internal.ApiImpl.throwIfNotConnected(ApiImpl.java:11)
at com.mapzen.android.lost.internal.FusedLocationProviderApiImpl.getLastLocation(FusedLocationProviderApiImpl.java:134)
at org.traccar.client.ShortcutActivity.onConnected(ShortcutActivity.java:115)
at com.mapzen.android.lost.internal.FusedLocationServiceConnectionManager.onServiceConnected(FusedLocationServiceConnectionManager.java:86)
at com.mapzen.android.lost.internal.FusedLocationProviderApiImpl.onServiceConnected(FusedLocationProviderApiImpl.java:94)
at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1634)
at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1663)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:251)
at android.app.ActivityThread.main(ActivityThread.java:6589)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Fix available in https://github.com/traccar/traccar-client-android/pull/348.
Please send separate pull requests for bug fixes.
Sure. Do you want particular branch names ?
Not really. Just make it something relevant to the problem.
Would bug_XXX be enough ?
Sure.