Backout 9ebed437d78f, 606c4b4ab77f, 686b4b5a5be3, c46514ce6886, 9cbe6533c480 due to critical breakage in bug 945723

This commit is contained in:
Mark Finkle
2013-12-03 10:15:26 -05:00
parent 1c9d2dec2f
commit 92472d585d
19 changed files with 228 additions and 553 deletions

View File

@@ -229,7 +229,8 @@ public class GeckoAppShell
}
if (e instanceof OutOfMemoryError) {
SharedPreferences prefs = getSharedPreferences();
SharedPreferences prefs =
getContext().getSharedPreferences(GeckoApp.PREFS_NAME, 0);
SharedPreferences.Editor editor = prefs.edit();
editor.putBoolean(GeckoApp.PREFS_OOM_EXCEPTION, true);
editor.commit();
@@ -1586,6 +1587,45 @@ public class GeckoAppShell
}
}
@WrapElementForJNI
public static void setSelectedLocale(String localeCode) {
/* Bug 713464: This method is still called from Gecko side.
Earlier we had an option to run Firefox in a language other than system's language.
However, this is not supported as of now.
Gecko resets the locale to en-US by calling this function with an empty string.
This affects GeckoPreferences activity in multi-locale builds.
N.B., if this code ever becomes live again, you need to hook it up to locale
recording in BrowserHealthRecorder: we track the current app and OS locales
as part of the recorded environment.
See similar note in GeckoApp.java for the startup path.
//We're not using this, not need to save it (see bug 635342)
SharedPreferences settings =
getContext().getPreferences(Activity.MODE_PRIVATE);
settings.edit().putString(getContext().getPackageName() + ".locale",
localeCode).commit();
Locale locale;
int index;
if ((index = localeCode.indexOf('-')) != -1 ||
(index = localeCode.indexOf('_')) != -1) {
String langCode = localeCode.substring(0, index);
String countryCode = localeCode.substring(index + 1);
locale = new Locale(langCode, countryCode);
} else {
locale = new Locale(localeCode);
}
Locale.setDefault(locale);
Resources res = getContext().getBaseContext().getResources();
Configuration config = res.getConfiguration();
config.locale = locale;
res.updateConfiguration(config, res.getDisplayMetrics());
*/
}
@WrapElementForJNI(stubName = "GetSystemColoursWrapper")
public static int[] getSystemColors() {
// attrsAppearance[] must correspond to AndroidSystemColors structure in android/AndroidBridge.h
@@ -2106,13 +2146,6 @@ public class GeckoAppShell
sContextGetter = cg;
}
public static SharedPreferences getSharedPreferences() {
if (sContextGetter == null) {
throw new IllegalStateException("No ContextGetter; cannot fetch prefs.");
}
return sContextGetter.getSharedPreferences();
}
public interface AppStateListener {
public void onPause();
public void onResume();