CompanyGateways / mytracks

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

Intent being re-handled by send to Google #509

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Request send to Google such that it goes to a different activity (e.g. by 
selecting an existing map)
2. Come back to the SendActivity (e.g. by selecting a map)

What is the expected output? What do you see instead?
Expected - it'd just go from there.
Actual - it goes from there, and starts the process over again in parallel.

This also eventually results in a crash like this, if the first process 
finishes before the other one got to its last stage:
07-05 13:35:20.647 E/AndroidRuntime(17851): java.lang.IllegalArgumentException: 
no dialog with id 2 was ever shown via Activity#showDialog
07-05 13:35:20.647 E/AndroidRuntime(17851):     at 
android.app.Activity.missingDialog(Activity.java:2600)
07-05 13:35:20.647 E/AndroidRuntime(17851):     at 
android.app.Activity.dismissDialog(Activity.java:2585)
07-05 13:35:20.647 E/AndroidRuntime(17851):     at 
com.google.android.apps.mytracks.io.sendtogoogle.SendActivity$6.run(SendActivity
.java:567)
07-05 13:35:20.647 E/AndroidRuntime(17851):     at 
android.app.Activity.runOnUiThread(Activity.java:3717)
07-05 13:35:20.647 E/AndroidRuntime(17851):     at 
com.google.android.apps.mytracks.io.sendtogoogle.SendActivity.onSendToGoogleDone
(SendActivity.java:563)
07-05 13:35:20.647 E/AndroidRuntime(17851):     at 
com.google.android.apps.mytracks.io.sendtogoogle.SendActivity.executeState(SendA
ctivity.java:328)
07-05 13:35:20.647 E/AndroidRuntime(17851):     at 
com.google.android.apps.mytracks.io.sendtogoogle.SendActivity.executeStateMachin
e(SendActivity.java:294)
07-05 13:35:20.647 E/AndroidRuntime(17851):     at 
com.google.android.apps.mytracks.io.sendtogoogle.SendActivity.access$1(SendActiv
ity.java:284)
07-05 13:35:20.647 E/AndroidRuntime(17851):     at 
com.google.android.apps.mytracks.io.sendtogoogle.SendActivity$5.run(SendActivity
.java:547)
07-05 13:35:20.647 E/AndroidRuntime(17851):     at 
android.os.Handler.handleCallback(Handler.java:587)
07-05 13:35:20.647 E/AndroidRuntime(17851):     at 
android.os.Handler.dispatchMessage(Handler.java:92)
07-05 13:35:20.647 E/AndroidRuntime(17851):     at 
android.os.Looper.loop(Looper.java:130)
07-05 13:35:20.647 E/AndroidRuntime(17851):     at 
android.app.ActivityThread.main(ActivityThread.java:3683)
07-05 13:35:20.647 E/AndroidRuntime(17851):     at 
java.lang.reflect.Method.invokeNative(Native Method)
07-05 13:35:20.647 E/AndroidRuntime(17851):     at 
java.lang.reflect.Method.invoke(Method.java:507)
07-05 13:35:20.647 E/AndroidRuntime(17851):     at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
07-05 13:35:20.647 E/AndroidRuntime(17851):     at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
07-05 13:35:20.647 E/AndroidRuntime(17851):     at 
dalvik.system.NativeStart.main(Native Method)
07-05 13:35:20.657 W/ActivityManager(   94):   Force finishing activity 
com.google.android.maps.mytracks/com.google.android.apps.mytracks.MyTracks

or

07-05 22:30:14.549: ERROR/AndroidRuntime(22921): FATAL EXCEPTION: main
07-05 22:30:14.549: ERROR/AndroidRuntime(22921): java.lang.NullPointerException
07-05 22:30:14.549: ERROR/AndroidRuntime(22921):     at 
com.google.android.apps.mytracks.io.sendtogoogle.SendActivity.onSendToGoogleMaps
Done(SendActivity.java:448)
07-05 22:30:14.549: ERROR/AndroidRuntime(22921):     at 
com.google.android.apps.mytracks.io.sendtogoogle.SendActivity.executeState(SendA
ctivity.java:315)
07-05 22:30:14.549: ERROR/AndroidRuntime(22921):     at 
com.google.android.apps.mytracks.io.sendtogoogle.SendActivity.executeStateMachin
e(SendActivity.java:297)
07-05 22:30:14.549: ERROR/AndroidRuntime(22921):     at 
com.google.android.apps.mytracks.io.sendtogoogle.SendActivity.access$1(SendActiv
ity.java:289)
07-05 22:30:14.549: ERROR/AndroidRuntime(22921):     at 
com.google.android.apps.mytracks.io.sendtogoogle.SendActivity$3.onSendCompleted(
SendActivity.java:431)
07-05 22:30:14.549: ERROR/AndroidRuntime(22921):     at 
com.google.android.apps.mytracks.io.SendToMyMaps$1.run(SendToMyMaps.java:191)
07-05 22:30:14.549: ERROR/AndroidRuntime(22921):     at 
android.os.Handler.handleCallback(Handler.java:587)
07-05 22:30:14.549: ERROR/AndroidRuntime(22921):     at 
android.os.Handler.dispatchMessage(Handler.java:92)
07-05 22:30:14.549: ERROR/AndroidRuntime(22921):     at 
android.os.Looper.loop(Looper.java:130)
07-05 22:30:14.549: ERROR/AndroidRuntime(22921):     at 
android.app.ActivityThread.main(ActivityThread.java:3683)
07-05 22:30:14.549: ERROR/AndroidRuntime(22921):     at 
java.lang.reflect.Method.invokeNative(Native Method)
07-05 22:30:14.549: ERROR/AndroidRuntime(22921):     at 
java.lang.reflect.Method.invoke(Method.java:507)
07-05 22:30:14.549: ERROR/AndroidRuntime(22921):     at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
07-05 22:30:14.549: ERROR/AndroidRuntime(22921):     at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)

Original issue reported on code.google.com by rdama...@google.com on 6 Jul 2011 at 1:46

GoogleCodeExporter commented 9 years ago
Ok, it appears it's not just the intent - there's some state mishandling 
somewhere.

Original comment by rdama...@google.com on 6 Jul 2011 at 2:25

GoogleCodeExporter commented 9 years ago
And here's a more detailed trace (I added stack traces for the points that are 
starting the state machine).

This one clearly shows the state machine running the same state many times when 
it shouldn't.

Original comment by rdama...@google.com on 12 Jul 2011 at 8:09

Attachments:

GoogleCodeExporter commented 9 years ago
Agh, I feel silly - it was a missing break statement which made it fall thru to 
another case that also executed the state machine. Will clean up and send for 
review soon.

Original comment by rdama...@google.com on 12 Jul 2011 at 8:24

GoogleCodeExporter commented 9 years ago
Please review...in my clean-up I ended up refactoring a bit further :p 

http://code.google.com/r/rdamazio-mytracks-staging2/source/detail?r=ab60d06eb5d6
57af23c86930984059988804bc5e

http://code.google.com/r/rdamazio-mytracks-staging2/source/detail?r=6636ea9c5c7d
aa0e6f16758cae1390ceae2ae32e

http://code.google.com/r/rdamazio-mytracks-staging2/source/detail?r=9a5e492e5057
bfb65c80fd835376175ec98506d5

Btw, in the first revision I had been careful to use hg record to separate the 
changes, but then I used ammend to add the second file, and this screwed up the 
record, so a little bit of the auth dance change is in the first one, hope 
that's ok.

Original comment by rdama...@google.com on 12 Jul 2011 at 11:48

GoogleCodeExporter commented 9 years ago
Ping? This is a fix for a release blocker, btw

Original comment by rdama...@google.com on 15 Jul 2011 at 3:08

GoogleCodeExporter commented 9 years ago

Original comment by rdama...@google.com on 20 Jul 2011 at 4:39