Android-Rocks / openintents

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

Exceptions on reconnect #543

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Connect to SensorSimulator, read some data, disconnect
2. Connect again.

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

There are few problems with reconnect. Sometimes application hangs, especially 
when no "Disconnect()" is logged in the LogCat console. Even if reconnecting 
after this log message was received the client crashes with couple of the 
exceptions.

First:

05-31 12:01:16.871: E/AndroidRuntime(607): java.lang.NumberFormatException: 
Invalid int: "0.0"
05-31 12:01:16.871: E/AndroidRuntime(607):  at 
java.lang.Integer.invalidInt(Integer.java:138)
05-31 12:01:16.871: E/AndroidRuntime(607):  at 
java.lang.Integer.parse(Integer.java:375)
05-31 12:01:16.871: E/AndroidRuntime(607):  at 
java.lang.Integer.parseInt(Integer.java:366)
05-31 12:01:16.871: E/AndroidRuntime(607):  at 
java.lang.Integer.parseInt(Integer.java:332)
05-31 12:01:16.871: E/AndroidRuntime(607):  at 
org.openintents.sensorsimulator.hardware.SensorSimulatorClient.readSensor(Sensor
SimulatorClient.java:664)
05-31 12:01:16.871: E/AndroidRuntime(607):  at 
org.openintents.sensorsimulator.hardware.SensorSimulatorClient.readSensor(Sensor
SimulatorClient.java:571)
05-31 12:01:16.871: E/AndroidRuntime(607):  at 
org.openintents.sensorsimulator.hardware.SensorSimulatorClient.access$1000(Senso
rSimulatorClient.java:53)
05-31 12:01:16.871: E/AndroidRuntime(607):  at 
org.openintents.sensorsimulator.hardware.SensorSimulatorClient$1.handleMessage(S
ensorSimulatorClient.java:505)

Second:

05-31 11:46:11.996: E/AndroidRuntime(4444): 
java.util.ConcurrentModificationException

05-31 11:46:11.996: E/AndroidRuntime(4444):     at 
java.util.ArrayList$ArrayListIterator.next(ArrayList.java:569)
05-31 11:46:11.996: E/AndroidRuntime(4444):     at 
org.openintents.sensorsimulator.hardware.SensorSimulatorClient$1.handleMessage(S
ensorSimulatorClient.java:495)

Not telling about the threading issues in the latest Android SDK. 
SensorSimulator demo code works only after disabling StrictMode:

StrictMode.setThreadPolicy(new 
StrictMode.ThreadPolicy.Builder().permitAll().build());

Original issue reported on code.google.com by roland...@gmail.com on 31 May 2013 at 12:11