Couzzo / hackerskeyboard

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

Crash when opening long-press popup #150

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Reported on Google+ for 1.28rc21 on Xoom (US wifi version running official 
3.2.1) :

Reproducing my crash is now harder, but still possible, so here is the stack 
trace:

D/dalvikvm( 4484): GC_EXPLICIT freed 1028K, 15% free 8185K/9607K, paused 4ms+3ms
I/LatinKeyboardBaseView( 7966): Creating new LatinKeyboardBaseView
I/LatinKeyboardBaseView( 7966): new mPreviewPopup 
android.widget.PopupWindow@40f62eb0
D/dalvikvm( 7626): GC_EXPLICIT freed 11K, 10% free 7169K/7879K, paused 5ms+2ms
I/LatinKeyboardBaseView( 7966): Creating new LatinKeyboardBaseView
I/LatinKeyboardBaseView( 7966): new mPreviewPopup 
android.widget.PopupWindow@40f214b0
D/AndroidRuntime( 7966): Shutting down VM
W/dalvikvm( 7966): threadid=1: thread exiting with uncaught exception 
(group=0x400bc760)
W/WindowManager( 143): Attempted to add window with token that is a sub-window: 
android.os.BinderProxy@40cf0ec8. Aborting.
E/AndroidRuntime( 7966): FATAL EXCEPTION: main
E/AndroidRuntime( 7966): android.view.WindowManager$BadTokenException: Unable 
to add window -- token android.view.ViewRoot$W@40f251f0 is not valid; is your 
activity running?
E/AndroidRuntime( 7966): at android.view.ViewRoot.setView(ViewRoot.java:447)
E/AndroidRuntime( 7966): at 
android.view.WindowManagerImpl.addView(WindowManagerImpl.java:283)
E/AndroidRuntime( 7966): at 
android.view.WindowManagerImpl.addView(WindowManagerImpl.java:193)
E/AndroidRuntime( 7966): at 
android.view.WindowManagerImpl$CompatModeWrapper.addView(WindowManagerImpl.java:
118)
E/AndroidRuntime( 7966): at 
android.widget.PopupWindow.invokePopup(PopupWindow.java:943)
E/AndroidRuntime( 7966): at 
android.widget.PopupWindow.showAtLocation(PopupWindow.java:803)
E/AndroidRuntime( 7966): at 
org.pocketworkstation.pckeyboard.LatinKeyboardBaseView.onLongPress(LatinKeyboard
BaseView.java:1474)
E/AndroidRuntime( 7966): at 
org.pocketworkstation.pckeyboard.LatinKeyboardBaseView.openPopupIfRequired(Latin
KeyboardBaseView.java:1307)
E/AndroidRuntime( 7966): at 
org.pocketworkstation.pckeyboard.LatinKeyboardBaseView.access$300(LatinKeyboardB
aseView.java:80)
E/AndroidRuntime( 7966): at 
org.pocketworkstation.pckeyboard.LatinKeyboardBaseView$UIHandler.handleMessage(L
atinKeyboardBaseView.java:304)
E/AndroidRuntime( 7966): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 7966): at android.os.Looper.loop(Looper.java:132)
E/AndroidRuntime( 7966): at 
android.app.ActivityThread.main(ActivityThread.java:4123)
E/AndroidRuntime( 7966): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 7966): at java.lang.reflect.Method.invoke(Method.java:491)
E/AndroidRuntime( 7966): at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
E/AndroidRuntime( 7966): at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
E/AndroidRuntime( 7966): at dalvik.system.NativeStart.main(Native Method)
I/InputDispatcher( 143): Application is not responding: Window{4073c768 
InputMethod paused=false}. 5006.2ms since event, 5005.6ms since wait started
I/WindowManager( 143): Input event dispatching timed out sending to InputMethod

AFAIKT it no longer crashes on the first try and seemingly no longer on all the 
Popup keys, but longpressing a sticky.shifted A on the English keyboard still 
triggers it.

Input connection details:
com.google.android.plus 
type=TEXT.LONG_MESSAGE|AUTO_COMPLETE|AUTO_CORRECT|CAP_SENTENCES|MULTI_LINE

Original issue reported on code.google.com by Klaus.We...@gmail.com on 9 Jan 2012 at 5:44

GoogleCodeExporter commented 9 years ago
Possibly fixed in the refactoring from revision f664b6e775b6, included in 
1.28rc22. Though I'm not entirely sure what was going on here, the original 
code seemed wasteful by recreating lots of views on the fly.

Original comment by Klaus.We...@gmail.com on 10 Jan 2012 at 5:15

GoogleCodeExporter commented 9 years ago
Sadly, it still crashes. New stack trace:

I/LatinKeyboardBaseView(14330): Creating new LatinKeyboardBaseView 
org.pocketworkstation.pckeyboard.LatinKeyboardBaseView@40c9a9f8
I/LatinKeyboardBaseView(14330): new mPreviewPopup 
android.widget.PopupWindow@40d71278 from 
org.pocketworkstation.pckeyboard.LatinKeyboardBaseView@40c9a9f8
I/LatinKeyboardBaseView(14330): new mMiniKeyboardPopup 
android.widget.PopupWindow@40748f58 from 
org.pocketworkstation.pckeyboard.LatinKeyboardBaseView@40c9a9f8
I/LatinKeyboardBaseView(14330): Creating new LatinKeyboardBaseView 
org.pocketworkstation.pckeyboard.LatinKeyboardBaseView@40d166b8
I/LatinKeyboardBaseView(14330): new mPreviewPopup 
android.widget.PopupWindow@40d6a250 from 
org.pocketworkstation.pckeyboard.LatinKeyboardBaseView@40d166b8
I/LatinKeyboardBaseView(14330): new mMiniKeyboardPopup 
android.widget.PopupWindow@40d61bf8 from 
org.pocketworkstation.pckeyboard.LatinKeyboardBaseView@40d166b8
W/WindowManager(  143): Attempted to add window with token that is a 
sub-window: android.os.BinderProxy@4134ce18.  Aborting.
D/AndroidRuntime(14330): Shutting down VM
W/dalvikvm(14330): threadid=1: thread exiting with uncaught exception 
(group=0x400bc760)
E/AndroidRuntime(14330): FATAL EXCEPTION: main
E/AndroidRuntime(14330): android.view.WindowManager$BadTokenException: Unable 
to add window -- token android.view.ViewRoot$W@40d51830 is not valid; is your 
activity running?
E/AndroidRuntime(14330):    at android.view.ViewRoot.setView(ViewRoot.java:447)
E/AndroidRuntime(14330):    at 
android.view.WindowManagerImpl.addView(WindowManagerImpl.java:283)
E/AndroidRuntime(14330):    at 
android.view.WindowManagerImpl.addView(WindowManagerImpl.java:193)
E/AndroidRuntime(14330):    at 
android.view.WindowManagerImpl$CompatModeWrapper.addView(WindowManagerImpl.java:
118)
E/AndroidRuntime(14330):    at 
android.widget.PopupWindow.invokePopup(PopupWindow.java:943)
E/AndroidRuntime(14330):    at 
android.widget.PopupWindow.showAtLocation(PopupWindow.java:803)
E/AndroidRuntime(14330):    at 
org.pocketworkstation.pckeyboard.LatinKeyboardBaseView.onLongPress(LatinKeyboard
BaseView.java:1483)
E/AndroidRuntime(14330):    at 
org.pocketworkstation.pckeyboard.LatinKeyboardBaseView.openPopupIfRequired(Latin
KeyboardBaseView.java:1314)
E/AndroidRuntime(14330):    at 
org.pocketworkstation.pckeyboard.LatinKeyboardBaseView.access$300(LatinKeyboardB
aseView.java:80)
E/AndroidRuntime(14330):    at 
org.pocketworkstation.pckeyboard.LatinKeyboardBaseView$UIHandler.handleMessage(L
atinKeyboardBaseView.java:306)
E/AndroidRuntime(14330):    at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(14330):    at android.os.Looper.loop(Looper.java:132)
E/AndroidRuntime(14330):    at 
android.app.ActivityThread.main(ActivityThread.java:4123)
E/AndroidRuntime(14330):    at java.lang.reflect.Method.invokeNative(Native 
Method)
E/AndroidRuntime(14330):    at java.lang.reflect.Method.invoke(Method.java:491)
E/AndroidRuntime(14330):    at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
E/AndroidRuntime(14330):    at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
E/AndroidRuntime(14330):    at dalvik.system.NativeStart.main(Native Method)
I/InputDispatcher(  143): Application is not responding: Window{40b189b0 
InputMethod paused=false}.  5017.9ms since event, 5005.2ms since wait started

Original comment by catel...@gmail.com on 10 Jan 2012 at 7:15

GoogleCodeExporter commented 9 years ago
Can you try the following version? It's the same code, but has more debugging 
info added. Don't use it for online banking.

http://code.google.com/p/hackerskeyboard/downloads/detail?name=hackerskeyboard-v
1028rc22-test1.apk

It would be ideal if you could attach the full debug output for a session 
starting from the "onCreate" message, to help keep track of which views it's 
creating and using.

Also, can you let me know your settings for the following, and maybe try 
changing them to see if that makes a difference?

- Drawing mode (direct draw / default / hw accelerated)?
- key feedback popups?

Original comment by Klaus.We...@gmail.com on 11 Jan 2012 at 12:03

GoogleCodeExporter commented 9 years ago
I've attached a log with everything from installation, over a switch to G+, 
longpressing an initial a that didn't have a sticky shift and then the sticky 
shift that crashes.

Drawing mode: was hw acc, changing to sw still crashes and so does Direct Draw
Key feedback popup on keypress was off, turning it on also crashes (with sw 
drawing).

Hope this helps!

Original comment by catel...@gmail.com on 11 Jan 2012 at 6:31

Attachments:

GoogleCodeExporter commented 9 years ago
Yes, this helps a lot. It is getting confused about the views and apparently 
trying to open a popup from within a popup. 

I think I found the problem, looks like you're using the "Stone" theme and that 
has a slightly defective theme definition, it's supposed to disable popups for 
popup keyboards but doesn't. I still can't reproduce it on my phone, but a 
theme-specific bug would explain why it's been a bit elusive.

First, can you try with your current -test1 version if the problem goes away if 
you switch to a different theme?

Then, can you try the following build which has a corrected "Stone" theme 
definition:
http://hackerskeyboard.googlecode.com/files/hackerskeyboard-v1028rc22-test2.apk 
. If that still crashes with the "Stone" theme active, can you please add a 
fresh log from that build?

Original comment by Klaus.We...@gmail.com on 11 Jan 2012 at 8:29

GoogleCodeExporter commented 9 years ago
You are right: the ICS theme on test1 works fine as far as I can tell!

test2 still crashes using Stone. New log attached.

Original comment by jo...@petersson.se on 11 Jan 2012 at 8:45

Attachments:

GoogleCodeExporter commented 9 years ago
Grumble. The original code is really confusing with its distinction between 
LatinKeyboardBaseView and the derived LatinKeyboardView - the former class is 
used for popups, the latter for the regular keyboard view. Neither should be 
confused with the Keyboard/LatinKeyboard classes which represent abstract key 
grids for use by the keyboard views, and the LatinIME and KeyboardSwitcher 
classes which tie them together.

Inexplicably, the code for adding long-press popups is in LatinKeyboardBaseView 
even though only the regular keyboard should be doing this. Android doesn't 
permit popup windows to be opened from popup windows, and due to unexpected 
default values apparently the base class decides to do so anyway.

Anyway, here's a new test version - I've started moving some of the code which 
should never be run for popup keyboards to LatinKeyboardView, though this is 
messy to untangle. Thanks for your patience! 
http://hackerskeyboard.googlecode.com/files/hackerskeyboard-v1028rc22-test3.apk

Original comment by Klaus.We...@gmail.com on 11 Jan 2012 at 11:34

GoogleCodeExporter commented 9 years ago
FYI, the recent workarounds are now included in the new prerelease 1.28rc23, 
and I've disabled the extra debugging in that one. Let me know if it's still 
crashing for you, and please use the -test3 version for logs if it does.

Original comment by Klaus.We...@gmail.com on 13 Jan 2012 at 1:15

GoogleCodeExporter commented 9 years ago
Sorry for my slow response, but for some obscure reason I had 3 download 
failures on rc24 so I had to give up and was pretty busy during the weekend 
(relatives visiting). Still, I just successfully downloaded rc24 to my Xoom and 
none of the tricks that have triggered the crash in the past can now repeat the 
trick. It also seems to work fine on my Galaxy Nexus after the 4.0.2 upgrade 
that was pushed out in the mean time (though, I've seen two random reboots 
already), so I think we have a winner.
I've had to be picky, I'd say the § key in Swedish mode where two fractions 
are displayed behind the primary characters are somewhat hard to read, but I 
can hardly complain since I've configured it for maximum display.
It seems that I can't close this issue myself, but from my perspective: feel 
free!
Thanks!

Original comment by catel...@gmail.com on 15 Jan 2012 at 10:30

GoogleCodeExporter commented 9 years ago
Glad to hear it. Thanks for confirming, and especially for patiently testing 
the prereleases with detailed bug reports.

Original comment by Klaus.We...@gmail.com on 17 Jan 2012 at 6:09

GoogleCodeExporter commented 9 years ago
Bulk update - changing "Fixed" to "Verified" for old bugs.

(Background: I'm changing the "Fixed" status to be considered open, the next 
steps in the lifecycle will be the closed states "FixInTest" and "Verified". 
This lets me mark issues as "Fixed" in commit messages without hiding them from 
the issue tracker.)

Original comment by Klaus.We...@gmail.com on 22 Jan 2013 at 7:33

GoogleCodeExporter commented 9 years ago
Bulk update - changing "Fixed" to "Verified" for old bugs.

Original comment by Klaus.We...@gmail.com on 22 Jan 2013 at 7:34