Closed GoogleCodeExporter closed 8 years ago
Here's the log:
Note: I used GPS location changed as the event.
Original comment by renc...@gmail.com
on 27 Jul 2010 at 2:39
Attachments:
Apparently, having a very long text message has the same effect but the logs
show a different place of failure:
D/AndroidRuntime( 570): Shutting down VM
W/dalvikvm( 570): threadid=3: thread exiting with uncaught exception
(group=0x4001b188)
E/AndroidRuntime( 570): Uncaught handler: thread main exiting due to uncaught
exception
E/AndroidRuntime( 570): java.lang.RuntimeException: Error receiving broadcast
Intent { act=SMS_SENT } in
edu.nyu.cs.omnidroid.app.controller.external.actions.SMSService$1@43c01ad8
E/AndroidRuntime( 570): at
android.app.ActivityThread$PackageInfo$ReceiverDispatcher$Args.run(ActivityThrea
d.java:765)
E/AndroidRuntime( 570): at android.os.Handler.handleCallback(Handler.java:587)
E/AndroidRuntime( 570): at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime( 570): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 570): at
android.app.ActivityThread.main(ActivityThread.java:4363)
E/AndroidRuntime( 570): at java.lang.reflect.Method.invokeNative(Native
Method)
E/AndroidRuntime( 570): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 570): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
E/AndroidRuntime( 570): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
E/AndroidRuntime( 570): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 570): Caused by: java.lang.NullPointerException
E/AndroidRuntime( 570): at
edu.nyu.cs.omnidroid.app.controller.ResultProcessor.process(ResultProcessor.java
:70)
E/AndroidRuntime( 570): at
edu.nyu.cs.omnidroid.app.controller.external.actions.SMSService$1.onReceive(SMSS
ervice.java:104)
P.S. This is the exact sms message I used:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa12345678901234
5678901234567890088765543321jjjjjjjjjjjiiiiiiiooooooiiiioooo99998887765443345776
4345678hygdrrdtvvvrgvfhltrdgfrgfcdv
Original comment by renc...@gmail.com
on 27 Jul 2010 at 3:55
Attachments:
Just to make sure, you're running this on the emulator or the test phone?
If the test phone, this could be caused by Issue 125.
I would think the long text message problem is probably a separate issue.
Original comment by case.and...@gmail.com
on 27 Jul 2010 at 4:10
Emulator running on API level 7.
Original comment by renc...@gmail.com
on 27 Jul 2010 at 4:14
Original comment by case.and...@gmail.com
on 28 Jul 2010 at 9:11
Original comment by renc...@gmail.com
on 28 Jul 2010 at 11:09
This seems like something that is tailor made for some unit tests. If you're
feeling up to it, see if you cna provide unit tests with this fix. If you
aren't feeling up to it, a TODO comment for them to be made in the future.
Original comment by case.and...@gmail.com
on 28 Jul 2010 at 11:22
Force close on 2nd log will be fixed by the changes made by issue 18 on
SMSService.java.
Caused by:
The intent passed to the ResultProcessor is the one passed from the
PendingIntent, which was different from the intent that started the SMSService,
therefore, it does not have Action.ACTION_TYPE extra bundled with it. This will
cause the actionType at ResultProcessor to be null, thus, attempting to call
actionType.equals eventually triggers the Null Exception.
Fixed by:
The intent that started the SMSService was the one passed to the
ResultProcessor.
Investigation will then proceed to the bug on the first log.
Original comment by renc...@gmail.com
on 30 Jul 2010 at 2:59
Code review:
http://codereview.appspot.com/1868050
Caused by:
Although this is not officially documented in the Android API, attempting to
send sms message with more than 160 charaters with SmsManager.sendTextMessage
will cause a null pointer exception. This is confirmed through experimentation
and in various forums in the net.
Fix detail:
Split the sms message into managable chunks before sending them.
Test Cases:
1. Check that the correct SMS message is received at the receiving end and use
logs to confirm that the contents of the original intent that started the
SMSService is properly received at the ResultReceiver for the following cases:
1.1 Create a rule with SMS action with SMS message > 160 characters and trigger the rule.
1.2 Create a rule with SMS action with SMS message < 160 characters and trigger the rule.
Original comment by renc...@gmail.com
on 30 Jul 2010 at 6:20
Checked-in @ r845.
Original comment by renc...@gmail.com
on 31 Jul 2010 at 9:48
Original issue reported on code.google.com by
renc...@gmail.com
on 27 Jul 2010 at 2:36