[Android] ML: Return if device is new

Geoffrey Métais git at videolan.org
Fri May 19 15:54:06 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri May 19 15:46:17 2017 +0200| [b9fb8e416d5dd5949f68bef38e6845c2c1bad241] | committer: Geoffrey Métais

ML: Return if device is new

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

 medialibrary/jni/AndroidMediaLibrary.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/medialibrary/jni/AndroidMediaLibrary.cpp b/medialibrary/jni/AndroidMediaLibrary.cpp
index 8444389..7e41e38 100644
--- a/medialibrary/jni/AndroidMediaLibrary.cpp
+++ b/medialibrary/jni/AndroidMediaLibrary.cpp
@@ -71,7 +71,8 @@ bool
 AndroidMediaLibrary::addDevice(const std::string& uuid, const std::string& path, bool removable, bool notify)
 {
     p_lister->addDevice(uuid, path, removable);
-    return notify && p_DeviceListerCb != nullptr && p_DeviceListerCb->onDevicePlugged(uuid, path);
+    return p_DeviceListerCb != nullptr && notify ? p_DeviceListerCb->onDevicePlugged(uuid, path)
+                                                 : !p_DeviceListerCb->isDeviceKnown(uuid);
 }
 
 std::vector<std::tuple<std::string, std::string, bool>>



More information about the Android mailing list