зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1460874 - Part 1: Cleanups. r=geckoview-reviewers,snorp
The GeckoFontScaleListener is intended to live as long as the app (and there- fore Gecko) remains alive and consequently keeps a reference to the *application* context, so the linter warning can be safely suppressed. Also reorder imports to match coding style. Differential Revision: https://phabricator.services.mozilla.com/D17743 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
2928c19d63
Коммит
f83531d710
|
@ -5,17 +5,18 @@
|
|||
|
||||
package org.mozilla.gecko;
|
||||
|
||||
import org.mozilla.gecko.preferences.GeckoPreferences;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.database.ContentObserver;
|
||||
import android.content.SharedPreferences;
|
||||
import android.database.ContentObserver;
|
||||
import android.net.Uri;
|
||||
import android.provider.Settings;
|
||||
import android.support.annotation.UiThread;
|
||||
import android.util.Log;
|
||||
|
||||
import org.mozilla.gecko.preferences.GeckoPreferences;
|
||||
|
||||
class GeckoFontScaleListener
|
||||
extends ContentObserver
|
||||
implements SharedPreferences.OnSharedPreferenceChangeListener {
|
||||
|
@ -27,6 +28,8 @@ class GeckoFontScaleListener
|
|||
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 Context applicationContext;
|
||||
|
|
Загрузка…
Ссылка в новой задаче