[Android] Use mountpoint folder name as UUI

Geoffrey Métais git at videolan.org
Fri Jan 6 18:37:48 CET 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Jan  6 18:36:00 2017 +0100| [9b3e14b047faca95fd6f51e37aaf1b247bdb51c2] | committer: Geoffrey Métais

Use mountpoint folder name as UUI

On some firmwares, it's the actual device UUID

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

 vlc-android/src/org/videolan/vlc/gui/tv/browser/BaseTvActivity.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/browser/BaseTvActivity.java b/vlc-android/src/org/videolan/vlc/gui/tv/browser/BaseTvActivity.java
index cd31883..3727aaf 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/browser/BaseTvActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/browser/BaseTvActivity.java
@@ -108,11 +108,12 @@ public abstract class BaseTvActivity extends PlaybackServiceActivity {
 
             } else if (action.equalsIgnoreCase(Intent.ACTION_MEDIA_MOUNTED)) {
                 String path = intent.getData().getPath();
-                mMediaLibrary.addDevice(path, path, true);
+                String uuid = intent.getData().getLastPathSegment();
+                mMediaLibrary.addDevice(uuid, path, true);
                 mMediaLibrary.discover(path);
                 mStorageHandlerHandler.sendEmptyMessageDelayed(ACTION_MEDIA_MOUNTED, 500);
             } else if (action.equalsIgnoreCase(Intent.ACTION_MEDIA_EJECT) || action.equalsIgnoreCase(Intent.ACTION_MEDIA_REMOVED)) {
-                mMediaLibrary.removeDevice(intent.getData().getPath());
+                mMediaLibrary.removeDevice(intent.getData().getLastPathSegment());
                 mMediaLibrary.reload();
                 mStorageHandlerHandler.sendEmptyMessageDelayed(ACTION_MEDIA_UNMOUNTED, 2000); //Delay to cancel it in case of MOUNT
             }



More information about the Android mailing list