Closed Bug 744668 Opened 8 years ago Closed 8 years ago

Control URI access NPE if Fennec not yet launched

Categories

(Firefox for Android :: General, defect, P1)

ARM
Android
defect

Tracking

()

RESOLVED FIXED
Firefox 14
Tracking Status
blocking-fennec1.0 --- beta+

People

(Reporter: rnewman, Assigned: gcp)

References

Details

Attachments

(1 file)

beta+: blocks a beta+.

Kinda inhibits utility :D

E DatabaseUtils(18589)        java.lang.NullPointerException
E DatabaseUtils(18589)        	at org.mozilla.gecko.ProfileMigrator.getPreferences(ProfileMigrator.java:224)
E DatabaseUtils(18589)        	at org.mozilla.gecko.ProfileMigrator.isBookmarksMigrated(ProfileMigrator.java:220)
E DatabaseUtils(18589)        	at org.mozilla.gecko.ProfileMigrator.hasMigrationFinished(ProfileMigrator.java:216)
E DatabaseUtils(18589)        	at org.mozilla.fennec_ncalexan.db.BrowserProvider.controlQuery(BrowserProvider.java:1503)
E DatabaseUtils(18589)        	at org.mozilla.fennec_ncalexan.db.BrowserProvider.query(BrowserProvider.java:1629)
E DatabaseUtils(18589)        	at android.content.ContentProvider$Transport.query(ContentProvider.java:178)
E DatabaseUtils(18589)        	at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:112)
Dupe of Bug 744644? Not sure from Nick's description if that's the cause of this NPE or a second bug.
Note a dupe - it's trying to use GeckoApp.mAppContext in a few places. It think we'll have to pass the context down instead.
Looks straightforward, but I don't have a setup yet to test this one, though.
Assignee: nobody → gpascutto
Attachment #614359 - Flags: review?(lucasr.at.mozilla)
Comment on attachment 614359 [details] [diff] [review]
Patch 1. Use supplied Context instead of relying on Gecko

Review of attachment 614359 [details] [diff] [review]:
-----------------------------------------------------------------

I wonder how this bug didn't appear before. Relying on GeckoApp.mAppContext inside the content provider is definitely not a good idea...
Attachment #614359 - Flags: review?(lucasr.at.mozilla) → review+
Because Migration runs after Gecko launch in the current code. It's only after the API for Sync was added that these bugs can start to show up.
(In reply to Gian-Carlo Pascutto (:gcp) from comment #3)

> Looks straightforward, but I don't have a setup yet to test this one, though.

Nick can verify this, either now or on inbound if you want to land this regardless.
Status: NEW → ASSIGNED
blocking-fennec1.0: ? → beta+
(In reply to Richard Newman [:rnewman] from comment #6)
> (In reply to Gian-Carlo Pascutto (:gcp) from comment #3)
> 
> > Looks straightforward, but I don't have a setup yet to test this one, though.
> 
> Nick can verify this, either now or on inbound if you want to land this
> regardless.

Verified here.  Yesterday's Fennec got NPE, today's Fennec does not.
https://hg.mozilla.org/mozilla-central/rev/acc03bee1e02
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 14
You need to log in before you can comment on or make changes to this bug.