ayoola-solomon / mytracks

Automatically exported from code.google.com/p/mytracks
0 stars 0 forks source link

IllegalArgumentException: in BluetoothDevice.<init>() any is not a valid Bluetooth address in #681

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The crash happens when execute 
...
line:139
    BluetoothDevice device = bluetoothAdapter.getRemoteDevice(address);
...
in BluetoothSensorManager. The address which get from SharedPreferences is 
"any".

Below is trace stack:
java.lang.RuntimeException: Unable to start activity 
ComponentInfo{com.google.android.maps.mytracks/com.google.android.apps.mytracks.
SensorStateActivity}: java.lang.IllegalArgumentException: any is not a valid 
Bluetooth address
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
at android.app.ActivityThread.access$2300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
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:871)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalArgumentException: any is not a valid Bluetooth 
address
at android.bluetooth.BluetoothDevice.<init>(BluetoothDevice.java:406)
at android.bluetooth.BluetoothAdapter.getRemoteDevice(BluetoothAdapter.java:355)
at 
com.google.android.apps.mytracks.services.sensors.BluetoothSensorManager.void 
setupChannel()(MT:139)
at com.google.android.apps.mytracks.services.sensors.SensorManager.void 
onStartTrack()(MT:88)
at com.google.android.apps.mytracks.SensorStateActivity.void 
updateState()(MT:160)
at com.google.android.apps.mytracks.SensorStateActivity.void 
onCreate(android.os.Bundle)(MT:111)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)

What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?

Please use labels and text to provide additional information.

Original issue reported on code.google.com by youtaol@google.com on 15 Dec 2011 at 9:12

GoogleCodeExporter commented 9 years ago
To reproduce, in Settings->Sensor
1. enable Bluetooth
2. pick a bluetooth option under "Sensor type"
Go to the Sensor State page.

Sandor, can you review the fix at
http://code.google.com/r/jshih-mytracks2/source/detail?r=80d4fffdbf0ff6d53432755
1cbac8045ab060f46

Original comment by jshih@google.com on 22 Dec 2011 at 1:39

GoogleCodeExporter commented 9 years ago

Original comment by jshih@google.com on 23 Dec 2011 at 8:30

GoogleCodeExporter commented 9 years ago
Same crashes still happens in 1.1.16. Did this change have been merged into 
main repository? Or should we check if the address equal with "any"?

Original comment by youtaol@google.com on 13 Apr 2012 at 7:46

GoogleCodeExporter commented 9 years ago
Let's reopen the bug. Want to confirm that the stack track for 1.1.16 is the 
same as above. How often does this bug occur. I suspect that there are phones 
that still have "any" as the value. If so, then we just need to check against 
address.equals("any").

Original comment by jshih@google.com on 13 Apr 2012 at 4:35

GoogleCodeExporter commented 9 years ago
The stack track for 1.1.16 is same as above.

Original comment by mytracks...@gmail.com on 16 Apr 2012 at 2:37

GoogleCodeExporter commented 9 years ago

Original comment by jshih@google.com on 16 May 2012 at 10:25