Closed Bug 816902 Opened 10 years ago Closed 10 years ago

java.lang.NullPointerException: at org.mozilla.gecko.AllPagesTab.setSuggestionsEnabled(


(Firefox for Android Graveyard :: General, defect)

Not set


(firefox17 unaffected, firefox18 verified, firefox19 verified, firefox20 verified)

Firefox 20
Tracking Status
firefox17 --- unaffected
firefox18 --- verified
firefox19 --- verified
firefox20 --- verified


(Reporter: scoobidiver, Assigned: bnicholson)



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

Crash Data


(1 file)

There are one crash in 20.0a1/20121122, bp-3d1aad0f-dd7e-4943-a05a-a82af2121125, and ten crashes in 18.0b1.

	at org.mozilla.gecko.AllPagesTab.setSuggestionsEnabled(
	at org.mozilla.gecko.AllPagesTab.access$1200(
	at org.mozilla.gecko.AllPagesTab$6.onClick(
	at android.view.View.performClick(
	at android.view.View$
	at android.os.Handler.handleCallback(
	at android.os.Handler.dispatchMessage(
	at android.os.Looper.loop(
	at java.lang.reflect.Method.invokeNative(Native Method)
	at java.lang.reflect.Method.invoke(
	at dalvik.system.NativeStart.main(Native Method)

More reports at:
Assignee: nobody → bnicholson
Looks like this is happening on this line, which indicates that mSuggestionsOptInPrompt is null:

setSuggestionsEnabled() is only called in the onClick() callbacks set in showSuggestionsOptIn(). These callbacks are registered by calling findViewById() on mSuggestionsOptInPrompt; this means that mSuggestionsOptInPrompt is non-null at this point in time (or else we would crash here).

The only way I think we can hit this crash is if we call setSuggestionsEnabled() after we've set mSuggestionsOptInPrompt back to null, which we do here: This is weird, though, since setSuggestionsEnabled() shouldn't be running more than once - maybe users are able to double-click the yes/no buttons in the prompt?
On the Galaxy S and Galaxy Note, the hit area for the buttons stays in one place, even during the animation. In other words, if I hit the "yes" button to opt-in, and the entire row has been animated to the right of the screen and is no longer visible, I can still tap where the "yes" button was. Usually, this just starts the animation over, but if I time it just right (hitting it right after the row is off the screen), I'm able to reproduce this crash.

To prevent the buttons from being clicked more than once, we can remove the listeners in the click callbacks.
Attachment #687319 - Flags: review?(mark.finkle)
Blocks: 769145
Attachment #687319 - Flags: review?(mark.finkle) → review+
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 20
Comment on attachment 687319 [details] [diff] [review]
Prevent suggestion prompt buttons from being clicked multiple times

[Approval Request Comment]
Bug caused by (feature/regressing bug #): bug 769145 (Fx18)
User impact if declined: can crash in awesomescreen if opt-in button is clicked more than once
Testing completed (on m-c, etc.): m-c
Risk to taking this patch (and alternatives if risky): low risk - just removes listener from button once it's clicked
String or UUID changes made by this patch: none
Attachment #687319 - Flags: approval-mozilla-beta?
Attachment #687319 - Flags: approval-mozilla-aurora?
Comment on attachment 687319 [details] [diff] [review]
Prevent suggestion prompt buttons from being clicked multiple times

looks like a good crash to avoid shipping to users, approving uplift.
Attachment #687319 - Flags: approval-mozilla-beta?
Attachment #687319 - Flags: approval-mozilla-beta+
Attachment #687319 - Flags: approval-mozilla-aurora?
Attachment #687319 - Flags: approval-mozilla-aurora+
Depends on: 828480
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.