Closed Bug 776547 Opened 9 years ago Closed 9 years ago

Crash [@ java.lang.NullPointerException: at org.mozilla.gecko.TextSelection$


(Firefox for Android Graveyard :: Text Selection, defect)

Not set


(firefox15 unaffected, firefox16 fixed, firefox17 fixed)

Firefox 17
Tracking Status
firefox15 --- unaffected
firefox16 --- fixed
firefox17 --- fixed


(Reporter: aaronmt, Assigned: Margaret)


(Keywords: crash, reproducible, Whiteboard: [native-crash])

Crash Data


(1 file, 1 obsolete file)

This bug was filed from the Socorro interface and is 
report bp-c1cb660b-da22-4ce4-adb0-b39672120723 .

E/GeckoAppShell( 3801): java.lang.NullPointerException
E/GeckoAppShell( 3801): 	at org.mozilla.gecko.TextSelection$
E/GeckoAppShell( 3801): 	at android.os.Handler.handleCallback(
E/GeckoAppShell( 3801): 	at android.os.Handler.dispatchMessage(
E/GeckoAppShell( 3801): 	at android.os.Looper.loop(
E/GeckoAppShell( 3801): 	at
E/GeckoAppShell( 3801): 	at java.lang.reflect.Method.invokeNative(Native Method)
E/GeckoAppShell( 3801): 	at java.lang.reflect.Method.invoke(
E/GeckoAppShell( 3801): 	at$
E/GeckoAppShell( 3801): 	at
E/GeckoAppShell( 3801): 	at dalvik.system.NativeStart.main(Native Method)
I/WindowState(  307): WIN DEATH: Window{41f28430 SurfaceView paused=false}
I/ActivityManager(  307): Process org.mozilla.fennec:org.mozilla.fennec.WebApp0 (pid 3801) has died.
W/ActivityManager(  307): Force removing ActivityRecord{423a5f90 org.mozilla.fennec/.WebApps$WebApp0}: app died, no saved state
I/WindowState(  307): WIN DEATH: Window{41f16b70 org.mozilla.fennec/org.mozilla.fennec.WebApps$WebApp0 paused=false}


i), and 'Install' a WebApp
ii) Launch WebApp
iii) Create a selection on the far left hand side text; "Logged in users can..."
Samsung Galaxy Nexus (Android 4.1.1)
Nightly (07/23)
Keywords: reproducible
I assume this is because the text selection views aren't included in the gecko layout that web apps use, since this crash means that the handle views are null:

I'd think we just need to add the text selection layout to web_app.xml like:
Attached patch patch (obsolete) — Splinter Review
This patch adds the text selection handle layouts to web_app.xml, but I also added a null check in the TextSelection constructor so that we won't crash if we run into this problem again with another GeckoApp instance (text selection just won't work in that case).
Attachment #644977 - Flags: review?(wjohnston)
Comment on attachment 644977 [details] [diff] [review]

Review of attachment 644977 [details] [diff] [review]:

I'd like to move the shared stuff into one layout so that we (hopefully) don't have to keep dealing with this. Clearing review.
Attachment #644977 - Flags: review?(wjohnston)
The text_selection_handles layout is now only used in this shared layout. I feel like it's cleaner to keep it separate, but on the other hand it's nicer to minimize the number of XML files we have floating around. What do you think?
Attachment #644977 - Attachment is obsolete: true
Attachment #645046 - Flags: review?(wjohnston)
Comment on attachment 645046 [details] [diff] [review]
create shared layout

Review of attachment 645046 [details] [diff] [review]:

I like!

::: mobile/android/base/resources/layout/shared_ui_components.xml
@@ +1,5 @@
> +<?xml version="1.0" encoding="utf-8"?>
> +<!-- This Source Code Form is subject to the terms of the Mozilla Public
> +   - License, v. 2.0. If a copy of the MPL was not distributed with this
> +   - file, You can obtain one at -->
> +

Lets add a quick comment here explaining what this file is.
Attachment #645046 - Flags: review?(wjohnston) → review+
Comment on attachment 645046 [details] [diff] [review]
create shared layout

[Approval Request Comment]
Bug caused by (feature/regressing bug #): bug 774938 (native handles)
User impact if declined: webapps crash
Testing completed (on m-c, etc.): just landed on inbound
Risk to taking this patch (and alternatives if risky): low-risk inclusion of text selection handle layouts for webapps
String or UUID changes made by this patch: n/a
Attachment #645046 - Flags: approval-mozilla-beta?
Attachment #645046 - Flags: approval-mozilla-aurora?
Comment on attachment 645046 [details] [diff] [review]
create shared layout

approved for beta as part of the dep bugs for native handles for text selection.
Attachment #645046 - Flags: approval-mozilla-beta?
Attachment #645046 - Flags: approval-mozilla-beta+
Attachment #645046 - Flags: approval-mozilla-aurora?
Attachment #645046 - Flags: approval-mozilla-aurora+
Actually, this doesn't need to be on beta because web apps aren't there. I landed it on aurora, though:
tracking-fennec: ? → ---
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.