Bug 1016161 - Flush prefs on handling a locale change event. r=mfinkle, a=lmandel
authorRichard Newman <rnewman@mozilla.com>
Tue, 10 Jun 2014 10:49:38 -0700
changeset 207120 beb8b71d7b9a8b83a05242ce0a1c807d8946aa63
parent 207119 75979b9fa1f349c8010ed355b83acc0a515dc2b7
child 207121 610390beb394f20bc2a86e44e65c920f231cd3f4
push id3741
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 20:25:18 +0000
treeherdermozilla-beta@4d6f46f5af68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle, lmandel
bugs1016161
milestone32.0a2
Bug 1016161 - Flush prefs on handling a locale change event. r=mfinkle, a=lmandel
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -1668,16 +1668,20 @@ var BrowserApp = {
           Services.prefs.setCharPref("general.useragent.locale", aData);
         } else {
           // Resetting.
           console.log("Switching to system locale.");
           Services.prefs.clearUserPref("general.useragent.locale");
         }
 
         Services.prefs.setBoolPref("intl.locale.matchOS", !aData);
+
+        // Ensure that this choice is immediately persisted, because
+        // Gecko won't be told again if it forgets.
+        Services.prefs.savePrefFile(null);
         break;
 
       default:
         dump('BrowserApp.observe: unexpected topic "' + aTopic + '"\n');
         break;
 
     }
   },