[Android] Remove dead code

Geoffrey Métais git at videolan.org
Wed Apr 19 17:32:11 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Apr 19 16:06:20 2017 +0200| [5f79e0b6d6718d3a11527e7b6b94d8b1ccdcf749] | committer: Geoffrey Métais

Remove dead code

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

 .../videolan/vlc/gui/video/VideoGridFragment.java  | 37 ----------------------
 .../src/org/videolan/vlc/media/MediaUtils.java     | 16 ----------
 2 files changed, 53 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
index e27608a..73abf94 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
@@ -22,10 +22,7 @@ package org.videolan.vlc.gui.video;
 
 import android.annotation.TargetApi;
 import android.app.Activity;
-import android.content.BroadcastReceiver;
-import android.content.Context;
 import android.content.Intent;
-import android.content.IntentFilter;
 import android.content.SharedPreferences;
 import android.content.res.Configuration;
 import android.content.res.Resources;
@@ -35,7 +32,6 @@ import android.os.Handler;
 import android.os.Message;
 import android.preference.PreferenceManager;
 import android.support.annotation.MainThread;
-import android.support.v4.content.LocalBroadcastManager;
 import android.support.v7.view.ActionMode;
 import android.support.v7.widget.DividerItemDecoration;
 import android.support.v7.widget.RecyclerView;
@@ -131,20 +127,6 @@ public class VideoGridFragment extends MediaBrowserFragment implements MediaUpda
         return v;
     }
 
-    @Override
-    public void onViewCreated(View view, Bundle savedInstanceState) {
-        super.onViewCreated(view, savedInstanceState);
-
-        // init the information for the scan (2/2)
-        IntentFilter filter = new IntentFilter();
-        filter.addAction(MediaUtils.ACTION_SCAN_START);
-        filter.addAction(MediaUtils.ACTION_SCAN_STOP);
-        LocalBroadcastManager.getInstance(getActivity()).registerReceiver(messageReceiverVideoListFragment, filter);
-        if (mMediaLibrary.isWorking()) {
-            MediaUtils.actionScanStart();
-        }
-    }
-
 
     public void onStart() {
         super.onStart();
@@ -183,12 +165,6 @@ public class VideoGridFragment extends MediaBrowserFragment implements MediaUpda
     }
 
     @Override
-    public void onDestroyView() {
-        LocalBroadcastManager.getInstance(getActivity()).unregisterReceiver(messageReceiverVideoListFragment);
-        super.onDestroyView();
-    }
-
-    @Override
     public void onDestroy() {
         super.onDestroy();
         mVideoAdapter.clear();
@@ -426,19 +402,6 @@ public class VideoGridFragment extends MediaBrowserFragment implements MediaUpda
         mGroup = prefix;
     }
 
-    private final BroadcastReceiver messageReceiverVideoListFragment = new BroadcastReceiver() {
-        @Override
-        public void onReceive(Context context, Intent intent) {
-            String action = intent.getAction();
-
-            if (action.equalsIgnoreCase(MediaUtils.ACTION_SCAN_START)) {
-                mLayoutFlipperLoading.setVisibility(View.VISIBLE);
-            } else if (action.equalsIgnoreCase(MediaUtils.ACTION_SCAN_STOP)) {
-                mLayoutFlipperLoading.setVisibility(View.INVISIBLE);
-            }
-        }
-    };
-
     @Override
     public void onRefresh() {
         getActivity().startService(new Intent(MediaParsingService.ACTION_RELOAD, null, getActivity(), MediaParsingService.class));
diff --git a/vlc-android/src/org/videolan/vlc/media/MediaUtils.java b/vlc-android/src/org/videolan/vlc/media/MediaUtils.java
index 2c986d3..a66f1b3 100644
--- a/vlc-android/src/org/videolan/vlc/media/MediaUtils.java
+++ b/vlc-android/src/org/videolan/vlc/media/MediaUtils.java
@@ -4,11 +4,9 @@ import android.app.Activity;
 import android.app.ProgressDialog;
 import android.content.Context;
 import android.content.DialogInterface;
-import android.content.Intent;
 import android.database.Cursor;
 import android.net.Uri;
 import android.provider.MediaStore;
-import android.support.v4.content.LocalBroadcastManager;
 import android.text.TextUtils;
 
 import org.videolan.libvlc.util.AndroidUtil;
@@ -27,17 +25,9 @@ import java.util.Arrays;
 import java.util.List;
 
 public class MediaUtils {
-    public static final String ACTION_SCAN_START = Strings.buildPkgString("gui.ScanStart");
-    public static final String ACTION_SCAN_STOP = Strings.buildPkgString("gui.ScanStop");
 
     private static SubtitlesDownloader sSubtitlesDownloader;
 
-    public static void actionScanStart() {
-        Intent intent = new Intent();
-        intent.setAction(ACTION_SCAN_START);
-        LocalBroadcastManager.getInstance(VLCApplication.getAppContext()).sendBroadcast(intent);
-    }
-
     public static void getSubs(Activity activity, List<MediaWrapper> mediaList) {
         getSubs(activity, mediaList, null);
     }
@@ -66,12 +56,6 @@ public class MediaUtils {
             sSubtitlesDownloader.setActivity(activity);
     }
 
-    public static void actionScanStop() {
-        Intent intent = new Intent();
-        intent.setAction(ACTION_SCAN_STOP);
-        LocalBroadcastManager.getInstance(VLCApplication.getAppContext()).sendBroadcast(intent);
-    }
-
     public static void appendMedia(final Context context, final List<MediaWrapper> media){
         if (media == null)
             return;



More information about the Android mailing list