michkaravolos / android-scripting

Automatically exported from code.google.com/p/android-scripting
0 stars 0 forks source link

JSON builder problem with the incoming message as a raw PDU #554

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What device(s) are you experiencing the problem on?

Nexus S

What firmware version are you running on the device?

Official 2.3.4

What steps will reproduce the problem?

This is the program that cause the error:

ACTION="android.provider.Telephony.SMS_RECEIVED"
               self._droid.eventRegisterForBroadcast(ACTION, False)

               p = self._droid.startEventDispatcher()
               s = socket.socket()
               s.connect(("localhost", p.result))
               f = s.makefile()

               while not self._stopEvent.isSet():
                       event = self.parseEvent(f.readline())
                       self._droid.log(str(event))
               self._droid.eventUnregisterForBroadcast(ACTION)

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

In logcat:

W/System.err( 1308): org.json.JSONException: Failed to build JSON
result.
W/System.err( 1308):    at
com.googlecode.android_scripting.jsonrpc.JsonBuilder.build(JsonBuilder.java:
119)
W/System.err( 1308):    at
com.googlecode.android_scripting.jsonrpc.JsonBuilder.buildJsonBundle(JsonBuilder
.java:
167)
W/System.err( 1308):    at
com.googlecode.android_scripting.jsonrpc.JsonBuilder.build(JsonBuilder.java:
92)
W/System.err( 1308):    at
com.googlecode.android_scripting.facade.EventFacade
$BroadcastListener.onReceive(EventFacade.java:362)
W/System.err( 1308):    at android.app.LoadedApk$ReceiverDispatcher
$Args.run(LoadedApk.java:709)
W/System.err( 1308):    at
android.os.Handler.handleCallback(Handler.java:587)
W/System.err( 1308):    at
android.os.Handler.dispatchMessage(Handler.java:92)
W/System.err( 1308):    at android.os.Looper.loop(Looper.java:130)
W/System.err( 1308):    at
android.app.ActivityThread.main(ActivityThread.java:3683)
W/System.err( 1308):    at java.lang.reflect.Method.invokeNative(Native
Method)
W/System.err( 1308):    at java.lang.reflect.Method.invoke(Method.java:
507)
W/System.err( 1308):    at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:839)
W/System.err( 1308):    at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
W/System.err( 1308):    at dalvik.system.NativeStart.main(Native Method)
W/System.err( 1308): org.json.JSONException: Failed to build JSON
result.
W/System.err( 1308):    at
com.googlecode.android_scripting.jsonrpc.JsonBuilder.build(JsonBuilder.java:
119)
W/System.err( 1308):    at
com.googlecode.android_scripting.jsonrpc.JsonBuilder.buildJsonBundle(JsonBuilder
.java:
167)
W/System.err( 1308):    at
com.googlecode.android_scripting.jsonrpc.JsonBuilder.build(JsonBuilder.java:
92)
W/System.err( 1308):    at
com.googlecode.android_scripting.facade.EventFacade
$BroadcastListener.onReceive(EventFacade.java:362)
W/System.err( 1308):    at android.app.LoadedApk$ReceiverDispatcher
$Args.run(LoadedApk.java:709)
W/System.err( 1308):    at
android.os.Handler.handleCallback(Handler.java:587)
W/System.err( 1308):    at
android.os.Handler.dispatchMessage(Handler.java:92)
W/System.err( 1308):    at android.os.Looper.loop(Looper.java:130)
W/System.err( 1308):    at
android.app.ActivityThread.main(ActivityThread.java:3683)
W/System.err( 1308):    at java.lang.reflect.Method.invokeNative(Native
Method)
W/System.err( 1308):    at java.lang.reflect.Method.invoke(Method.java:
507)
W/System.err( 1308):    at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:839)
W/System.err( 1308):    at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
W/System.err( 1308):    at dalvik.system.NativeStart.main(Native Method)
What version of the product are you using? On what operating system?

unofficial release sl4a_r5x

Please provide any additional information below.

The response of Robbie Mathews:

It looks like the JSON builder is choking on the data coming back...
which I happen to know contains the incoming message as a raw PDU,
which could be the problem.
If you want to raise it as an issue, I'll look at it when I have some
time (probably in about at fortnight, at this rate.)

Original issue reported on code.google.com by jav...@gmail.com on 13 Jul 2011 at 3:15

GoogleCodeExporter commented 9 years ago
Fixed in r5x

Original comment by rjmatthews62 on 17 Aug 2011 at 2:23