brok85 / omnidroid

Automatically exported from code.google.com/p/omnidroid
Apache License 2.0
0 stars 0 forks source link

LocationManager.getLastKnownLocation() java.lang.IllegalArgumentException #168

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
From the Market:

Aug 6, 2010 12:29:55 AM
0.2.0
force close on start up, droid froyo

java.lang.RuntimeException: Unable to start service 
edu.nyu.cs.omnidroid.app.controller.HandlerService@44759380 with Intent { 
act=SERVICE_AVAILABLE flg=0x10000000 
cmp=edu.nyu.cs.omnidroid.app/.controller.HandlerService (has extras) }: 
java.lang.IllegalArgumentException: provider==null
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3063)
at android.app.ActivityThread.access$3600(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2096)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalArgumentException: provider==null
at 
android.location.LocationManager.getLastKnownLocation(LocationManager.java:953)
at 
edu.nyu.cs.omnidroid.app.controller.HandlerService.insertLocationData(HandlerSer
vice.java:247)
at 
edu.nyu.cs.omnidroid.app.controller.HandlerService.addGlobalAttributesToIntent(H
andlerService.java:220)
at 
edu.nyu.cs.omnidroid.app.controller.HandlerService.onStart(HandlerService.java:1
29)
at android.app.Service.onStartCommand(Service.java:420)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3053)
... 10 more

Original issue reported on code.google.com by omnidroi...@gmail.com on 7 Aug 2010 at 2:15

GoogleCodeExporter commented 9 years ago
I'm wondering if this happens when the last known location is null (maybe after 
the phone is booted but GPS hasn't been enabled).

Original comment by case.and...@gmail.com on 7 Aug 2010 at 2:21

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r858.

Original comment by case.and...@gmail.com on 7 Aug 2010 at 4:10

GoogleCodeExporter commented 9 years ago
Bypassed the codereview process so I could patch ASAP.  Please let me know if 
you think there are any problems with this fix, it's very simple.  The 
bestProvider was being set to null.  So I'm just catching that and logging it.

Original comment by case.and...@gmail.com on 7 Aug 2010 at 4:30