[Android] Remove App Context access synchronization

Geoffrey Métais git at videolan.org
Wed May 24 10:01:08 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed May 24 09:57:34 2017 +0200| [8cb685876ae725e0df9cb628adcb7d10db77aec8] | committer: Geoffrey Métais

Remove App Context access synchronization

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

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

diff --git a/vlc-android/src/org/videolan/vlc/VLCApplication.java b/vlc-android/src/org/videolan/vlc/VLCApplication.java
index ccb54ed6d..8973f5d93 100644
--- a/vlc-android/src/org/videolan/vlc/VLCApplication.java
+++ b/vlc-android/src/org/videolan/vlc/VLCApplication.java
@@ -85,10 +85,8 @@ public class VLCApplication extends Application {
 
     @Override
     public void onCreate() {
-        synchronized (getClass()) {
-            super.onCreate();
-            instance = this;
-        }
+        super.onCreate();
+        instance = this;
 
         // Are we using advanced debugging - locale?
         mSettings = PreferenceManager.getDefaultSharedPreferences(this);
@@ -162,7 +160,7 @@ public class VLCApplication extends Application {
     /**
      * @return the main context of the Application
      */
-    public static synchronized Context getAppContext() {
+    public static Context getAppContext() {
         return instance;
     }
 
@@ -246,7 +244,7 @@ public class VLCApplication extends Application {
                 .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
     }
 
-    public static synchronized Medialibrary getMLInstance() {
+    public static Medialibrary getMLInstance() {
         if (sMedialibraryInstance == null) {
             VLCInstance.get(); // ensure VLC is loaded before medialibrary
             sMedialibraryInstance = Medialibrary.getInstance(instance);



More information about the Android mailing list