[Android] getSettings() util method

Geoffrey Métais git at videolan.org
Fri Jan 26 15:16:42 CET 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Nov  6 17:37:00 2017 +0100| [e0b2e9253da53bbf17f4e498f762f4713438495f] | committer: Geoffrey Métais

getSettings() util method

> https://code.videolan.org/videolan/vlc-android/commit/e0b2e9253da53bbf17f4e498f762f4713438495f
---

 vlc-android/src/org/videolan/vlc/VLCApplication.java | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/VLCApplication.java b/vlc-android/src/org/videolan/vlc/VLCApplication.java
index 8d45e63d9..bf690f75d 100644
--- a/vlc-android/src/org/videolan/vlc/VLCApplication.java
+++ b/vlc-android/src/org/videolan/vlc/VLCApplication.java
@@ -68,7 +68,7 @@ public class VLCApplication extends Application {
 
     public static Calendar sPlayerSleepTime = null;
     private static boolean sTV;
-    private static SharedPreferences mSettings;
+    private static SharedPreferences sSettings;
 
     private static SimpleArrayMap<String, WeakReference<Object>> sDataMap = new SimpleArrayMap<>();
 
@@ -92,7 +92,7 @@ public class VLCApplication extends Application {
     public void onCreate() {
         instance = this;
         super.onCreate();
-        mSettings = PreferenceManager.getDefaultSharedPreferences(this);
+        sSettings = PreferenceManager.getDefaultSharedPreferences(this);
 
         setLocale();
 
@@ -159,8 +159,12 @@ public class VLCApplication extends Application {
         return instance.getResources();
     }
 
+    public static SharedPreferences getSettings() {
+        return sSettings;
+    }
+
     public static boolean showTvUi() {
-        return sTV || (mSettings != null && mSettings.getBoolean("tv_ui", false));
+        return sTV || (sSettings != null && sSettings.getBoolean("tv_ui", false));
     }
 
     public static void runBackground(Runnable runnable) {
@@ -244,7 +248,7 @@ public class VLCApplication extends Application {
 
     public static void setLocale(){
         // Are we using advanced debugging - locale?
-        String p = mSettings.getString("set_locale", "");
+        String p = sSettings.getString("set_locale", "");
         if (!p.equals("")) {
             Locale locale;
             // workaround due to region code



More information about the Android mailing list