Bug 1460874 - Part 2: Rename instance variables to better match GeckoView code style. r=geckoview-reviewers,snorp
☠☠ backed out by cd616c3e3eea ☠ ☠
authorJan Henning <jh+bugzilla@buttercookie.de>
Wed, 13 Feb 2019 20:10:04 +0000
changeset 458944 d42e39761eb8
parent 458943 2d5e902b5b88
child 458945 c7fce6c79bef
push id35552
push usershindli@mozilla.com
push dateThu, 14 Feb 2019 04:39:44 +0000
treeherdermozilla-central@c6829642e2d0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgeckoview-reviewers, snorp
bugs1460874
milestone67.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 1460874 - Part 2: Rename instance variables to better match GeckoView code style. r=geckoview-reviewers,snorp Differential Revision: https://phabricator.services.mozilla.com/D17744
mobile/android/base/java/org/mozilla/gecko/GeckoFontScaleListener.java
--- a/mobile/android/base/java/org/mozilla/gecko/GeckoFontScaleListener.java
+++ b/mobile/android/base/java/org/mozilla/gecko/GeckoFontScaleListener.java
@@ -25,78 +25,78 @@ class GeckoFontScaleListener
     private static final String PREF_SYSTEM_FONT_SCALE = "font.size.systemFontScale";
     private static final String PREF_FONT_INFLATION = "font.size.inflation.minTwips";
     private static final int FONT_INFLATION_OFF = 0;
     private static final int FONT_INFLATION_ON_DEFAULT_VALUE = 120;
     private static final float DEFAULT_FONT_SCALE = 1.0f;
 
     // We're referencing the *application* context, so this is in fact okay.
     @SuppressLint("StaticFieldLeak")
-    private static final GeckoFontScaleListener listenerInstance = new GeckoFontScaleListener();
+    private static final GeckoFontScaleListener sInstance = new GeckoFontScaleListener();
 
-    private Context applicationContext;
-    private boolean initialized;
-    private boolean running;
+    private Context mApplicationContext;
+    private boolean mInitialized;
+    private boolean mRunning;
 
     public static GeckoFontScaleListener getInstance() {
-        return listenerInstance;
+        return sInstance;
     }
 
     private GeckoFontScaleListener() {
         super(null);
     }
 
     public synchronized void initialize(final Context context) {
-        if (initialized) {
+        if (mInitialized) {
             Log.w(LOGTAG, "Already initialized!");
             return;
         }
 
-        applicationContext = context.getApplicationContext();
-        SharedPreferences prefs = GeckoSharedPrefs.forApp(applicationContext);
+        mApplicationContext = context.getApplicationContext();
+        SharedPreferences prefs = GeckoSharedPrefs.forApp(mApplicationContext);
         prefs.registerOnSharedPreferenceChangeListener(this);
         onPrefChange(prefs);
-        initialized = true;
+        mInitialized = true;
     }
 
     public synchronized void shutdown() {
-        if (!initialized) {
+        if (!mInitialized) {
             Log.w(LOGTAG, "Already shut down!");
             return;
         }
 
-        GeckoSharedPrefs.forApp(applicationContext).unregisterOnSharedPreferenceChangeListener(this);
+        GeckoSharedPrefs.forApp(mApplicationContext).unregisterOnSharedPreferenceChangeListener(this);
         stop();
-        applicationContext = null;
-        initialized = false;
+        mApplicationContext = null;
+        mInitialized = false;
     }
 
     private synchronized void start() {
-        if (running) {
+        if (mRunning) {
             return;
         }
 
-        ContentResolver contentResolver = applicationContext.getContentResolver();
+        ContentResolver contentResolver = mApplicationContext.getContentResolver();
         Uri fontSizeSetting = Settings.System.getUriFor(Settings.System.FONT_SCALE);
         contentResolver.registerContentObserver(fontSizeSetting, false, this);
         onSystemFontScaleChange(contentResolver, false);
 
-        running = true;
+        mRunning = true;
     }
 
     private synchronized void stop() {
-        if (!running) {
+        if (!mRunning) {
             return;
         }
 
-        ContentResolver contentResolver = applicationContext.getContentResolver();
+        ContentResolver contentResolver = mApplicationContext.getContentResolver();
         contentResolver.unregisterContentObserver(this);
         onSystemFontScaleChange(contentResolver, /*stopping*/ true);
 
-        running = false;
+        mRunning = false;
     }
 
     private void onSystemFontScaleChange(final ContentResolver contentResolver, boolean stopping) {
         float fontScale;
         int fontInflation;
 
         if (!stopping) { // Pref was flipped to "On" or system font scale changed.
             fontScale = Settings.System.getFloat(contentResolver, Settings.System.FONT_SCALE, DEFAULT_FONT_SCALE);
@@ -117,17 +117,17 @@ class GeckoFontScaleListener
             start();
         } else {
             stop();
         }
     }
 
     @Override
     public void onChange(boolean selfChange) {
-        onSystemFontScaleChange(applicationContext.getContentResolver(), false);
+        onSystemFontScaleChange(mApplicationContext.getContentResolver(), false);
     }
 
     @UiThread // According to the docs.
     @Override
     public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
         if (!GeckoPreferences.PREFS_SYSTEM_FONT_SIZE.equals(key)) {
             return;
         }