Closed Bug 991555 Opened 7 years ago Closed 7 years ago

Native prefs in the prefs screen are not written to shared prefs file

Categories

(Firefox for Android :: General, defect)

31 Branch
ARM
Android
defect
Not set
normal

Tracking

()

VERIFIED FIXED
Firefox 31
Tracking Status
firefox29 --- unaffected
firefox30 --- unaffected
firefox31 --- verified
fennec 31+ ---

People

(Reporter: TeoVermesan, Assigned: bnicholson)

References

Details

(Keywords: regression)

Attachments

(1 file)

Tested with:
Build: Firefox for Android 31.0a1 (2013-04-02)
Device: LG Nexus 4 
OS: Android 4.4.2

From Settings -> Customize -> Tab choose "Always restore"

Steps to Reproduce:
1. Open some web pages in different tabs
2. Exit Firefox from app menu or from Task Manager
3. Start firefox

Expected result:
- Tabs loaded at Step 1 are restored 

Actual Result:
- Tabs loaded at Step 1 are not restored.
The bug is also reproducible on HTC One X (Android 4.1.1)
Most likely a regression from 940575 (per-profile prefs).
Blocks: 940575
Keywords: regression
tracking-fennec: --- → ?
Assignee: nobody → bnicholson
tracking-fennec: ? → 31+
After choosing Always Restore, I found the pref gets saved to org.mozilla.fennec_brian_preferences.xml instead of GeckoApp.xml. Our prefs screen needs to be changed to use our custom shared prefs file.
Summary: Tabs are not restored with "Always restore" option enabled → Native prefs in the prefs screen are not written to shared prefs file
At first, I tried calling `PreferenceManager.setDefaultValues(this, GeckoSharedPrefs.APP_PREFS_NAME, Context.MODE_PRIVATE, R.xml.preferences, false);` from GeckoPreferences, but this had no effect. Accessing the PreferenceManager directly and setting the name seems to do the trick.
Attachment #8401586 - Flags: review?(rnewman)
BTW, if we're using preference headers, getPreferenceManager() returns null when called from the PreferenceActivity (https://groups.google.com/forum/#!topic/android-developers/O88vw6rCRes). This is why I had to do the call in two different places.
Attachment #8401586 - Flags: review?(rnewman) → review+
https://hg.mozilla.org/mozilla-central/rev/50d49ff44ddf
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 31
Verified fixed on:
Build: Firefox for Android 31.0a1 (2013-04-06)
Device: LG Nexus 4 
OS: Android 4.4.2
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.