[Android] MediaParsingService only discovers new device

Geoffrey Métais git at videolan.org
Fri Apr 14 17:29:05 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Apr 13 14:10:08 2017 +0200| [a1a3e349f09f96a978b56aaacc44171bfa4d15e1] | committer: Geoffrey Métais

MediaParsingService only discovers new device

Device adding is automated

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

 vlc-android/src/org/videolan/vlc/MediaParsingService.java          | 7 ++-----
 vlc-android/src/org/videolan/vlc/gui/DialogActivity.java           | 1 -
 .../src/org/videolan/vlc/gui/dialogs/ExternalStorageDialog.java    | 3 +--
 3 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/MediaParsingService.java b/vlc-android/src/org/videolan/vlc/MediaParsingService.java
index 73a6ede..5fad65c 100644
--- a/vlc-android/src/org/videolan/vlc/MediaParsingService.java
+++ b/vlc-android/src/org/videolan/vlc/MediaParsingService.java
@@ -119,18 +119,16 @@ public class MediaParsingService extends Service implements DevicesDiscoveryCb {
                 discover(intent.getStringExtra(EXTRA_PATH));
                 break;
             case ACTION_DISCOVER_DEVICE:
-                discoverStorage(intent.getStringExtra(EXTRA_PATH), intent.getStringExtra(EXTRA_UUID));
+                discoverStorage(intent.getStringExtra(EXTRA_PATH));
                 break;
         }
         return START_NOT_STICKY;
     }
 
-    private void discoverStorage(final String path, final String uuid) {
+    private void discoverStorage(final String path) {
         mThreadPool.execute(new Runnable() {
             @Override
             public void run() {
-                if (!TextUtils.isEmpty(uuid))
-                    mMedialibrary.addDevice(uuid, path, true);
                 for (String folder : Medialibrary.getBlackList())
                     mMedialibrary.banFolder(path + folder);
                 mMedialibrary.discover(path);
@@ -144,7 +142,6 @@ public class MediaParsingService extends Service implements DevicesDiscoveryCb {
         mThreadPool.execute(new Runnable() {
             @Override
             public void run() {
-                addDeviceIfNeeded(path);
                 mMedialibrary.discover(path);
             }
         });
diff --git a/vlc-android/src/org/videolan/vlc/gui/DialogActivity.java b/vlc-android/src/org/videolan/vlc/gui/DialogActivity.java
index 1aac7a2..85d5b25 100644
--- a/vlc-android/src/org/videolan/vlc/gui/DialogActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/DialogActivity.java
@@ -67,7 +67,6 @@ public class DialogActivity extends BaseActivity {
         ExternalStorageDialog dialog = new ExternalStorageDialog();
         Bundle b = new Bundle(2);
         b.putString(MediaParsingService.EXTRA_PATH, getIntent().getStringExtra(MediaParsingService.EXTRA_PATH));
-        b.putString(MediaParsingService.EXTRA_UUID, getIntent().getStringExtra(MediaParsingService.EXTRA_UUID));
         dialog.setArguments(b);
         dialog.show(getSupportFragmentManager(), "fragment_storage");
     }
diff --git a/vlc-android/src/org/videolan/vlc/gui/dialogs/ExternalStorageDialog.java b/vlc-android/src/org/videolan/vlc/gui/dialogs/ExternalStorageDialog.java
index 16b551a..549a1bf 100644
--- a/vlc-android/src/org/videolan/vlc/gui/dialogs/ExternalStorageDialog.java
+++ b/vlc-android/src/org/videolan/vlc/gui/dialogs/ExternalStorageDialog.java
@@ -37,8 +37,7 @@ public class ExternalStorageDialog extends AppCompatDialogFragment {
                 .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
                     public void onClick(DialogInterface dialog, int id) {
                         Intent serviceInent = new Intent(MediaParsingService.ACTION_DISCOVER_DEVICE, null, getActivity(), MediaParsingService.class)
-                            .putExtra(MediaParsingService.EXTRA_PATH, path)
-                            .putExtra(MediaParsingService.EXTRA_UUID, uuid);
+                            .putExtra(MediaParsingService.EXTRA_PATH, path);
                         if (getActivity() != null) {
                             getActivity().startService(serviceInent);
                             getActivity().finish();



More information about the Android mailing list