Bug 1060496 - Make search activity locale-aware. r=margaret
authorRichard Newman <rnewman@mozilla.com>
Tue, 02 Sep 2014 15:31:24 -0700
changeset 203213 e58cd57dde2f0e234c3bf23feb1966a78d4dbfc9
parent 203212 013d88f8949f4bd468e07af1207ca05bdbed9355
child 203214 4650bedd769150b8d8ecceb9c37cc462a1d19b00
push id27424
push userryanvm@gmail.com
push dateWed, 03 Sep 2014 19:35:53 +0000
treeherdermozilla-central@bfef88becbba [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs1060496
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1060496 - Make search activity locale-aware. r=margaret
mobile/android/search/java/org/mozilla/search/MainActivity.java
mobile/android/search/java/org/mozilla/search/SearchPreferenceActivity.java
--- a/mobile/android/search/java/org/mozilla/search/MainActivity.java
+++ b/mobile/android/search/java/org/mozilla/search/MainActivity.java
@@ -15,29 +15,30 @@ import android.view.View;
 import android.view.animation.AccelerateDecelerateInterpolator;
 import android.view.animation.Interpolator;
 import android.widget.TextView;
 
 import com.nineoldandroids.animation.Animator;
 import com.nineoldandroids.animation.AnimatorSet;
 import com.nineoldandroids.animation.ObjectAnimator;
 
+import org.mozilla.gecko.LocaleAware;
 import org.mozilla.gecko.Telemetry;
 import org.mozilla.gecko.TelemetryContract;
 import org.mozilla.gecko.db.BrowserContract.SearchHistory;
 import org.mozilla.search.autocomplete.ClearableEditText;
 import org.mozilla.search.autocomplete.SuggestionsFragment;
 
 /**
  * The main entrance for the Android search intent.
  * <p/>
  * State management is delegated to child fragments. Fragments communicate
  * with each other by passing messages through this activity.
  */
-public class MainActivity extends FragmentActivity implements AcceptsSearchQuery {
+public class MainActivity extends LocaleAware.LocaleAwareFragmentActivity implements AcceptsSearchQuery {
 
     private static final String KEY_SEARCH_STATE = "search_state";
     private static final String KEY_EDIT_STATE = "edit_state";
     private static final String KEY_QUERY = "query";
 
     static enum SearchState {
         PRESEARCH,
         POSTSEARCH
--- a/mobile/android/search/java/org/mozilla/search/SearchPreferenceActivity.java
+++ b/mobile/android/search/java/org/mozilla/search/SearchPreferenceActivity.java
@@ -13,16 +13,17 @@ import android.os.Bundle;
 import android.preference.ListPreference;
 import android.preference.Preference;
 import android.preference.PreferenceActivity;
 import android.text.TextUtils;
 import android.util.Log;
 import android.widget.Toast;
 
 import org.mozilla.gecko.GeckoSharedPrefs;
+import org.mozilla.gecko.LocaleAware;
 import org.mozilla.gecko.Telemetry;
 import org.mozilla.gecko.TelemetryContract;
 import org.mozilla.gecko.db.BrowserContract;
 import org.mozilla.search.providers.SearchEngine;
 import org.mozilla.search.providers.SearchEngineManager;
 
 import java.util.List;
 
@@ -44,16 +45,17 @@ public class SearchPreferenceActivity ex
     public static final String PREF_CLEAR_HISTORY_KEY = "search.not_a_preference.clear_history";
     public static final String PREF_SEARCH_ENGINE_KEY = "search.engines.default";
 
     private SearchEngineManager searchEngineManager;
 
     @Override
     @SuppressWarnings("deprecation")
     protected void onCreate(Bundle savedInstanceState) {
+        LocaleAware.initializeLocale(getApplicationContext());
         super.onCreate(savedInstanceState);
 
         getPreferenceManager().setSharedPreferencesName(GeckoSharedPrefs.APP_PREFS_NAME);
 
         searchEngineManager = new SearchEngineManager(this);
 
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
             if (getActionBar() != null) {