[Android] Report ML paused state
Geoffrey Métais
git at videolan.org
Wed Feb 1 13:59:19 CET 2017
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Feb 1 13:53:27 2017 +0100| [1cdd7cb23163f9b6cf5646d0ac1d300204d3eaa2] | committer: Geoffrey Métais
Report ML paused state
> https://code.videolan.org/videolan/vlc-android/commit/1cdd7cb23163f9b6cf5646d0ac1d300204d3eaa2
---
medialibrary/jni/AndroidMediaLibrary.cpp | 4 +++-
medialibrary/jni/AndroidMediaLibrary.h | 1 +
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/medialibrary/jni/AndroidMediaLibrary.cpp b/medialibrary/jni/AndroidMediaLibrary.cpp
index 3f74065..24c5a8a 100644
--- a/medialibrary/jni/AndroidMediaLibrary.cpp
+++ b/medialibrary/jni/AndroidMediaLibrary.cpp
@@ -111,13 +111,14 @@ AndroidMediaLibrary::entryPoints()
bool
AndroidMediaLibrary::isWorking()
{
- return m_nbDiscovery > 0 || (m_progress > 0 && m_progress < 100);
+ return !m_paused && (m_nbDiscovery > 0 || (m_progress > 0 && m_progress < 100));
}
void
AndroidMediaLibrary::pauseBackgroundOperations()
{
p_ml->pauseBackgroundOperations();
+ m_paused = true;
}
void
@@ -136,6 +137,7 @@ void
AndroidMediaLibrary::resumeBackgroundOperations()
{
p_ml->resumeBackgroundOperations();
+ m_paused = false;
}
void
diff --git a/medialibrary/jni/AndroidMediaLibrary.h b/medialibrary/jni/AndroidMediaLibrary.h
index 8606614..194cd71 100644
--- a/medialibrary/jni/AndroidMediaLibrary.h
+++ b/medialibrary/jni/AndroidMediaLibrary.h
@@ -122,6 +122,7 @@ private:
medialibrary::IDeviceListerCb* p_DeviceListerCb = nullptr;
std::string mainStorage = "";
bool discoveryEnded = false;
+ bool m_paused = false;
uint32_t m_nbDiscovery = 0, m_progress = 0, m_mediaAddedType = 0, m_mediaUpdatedType = 0;
};
#endif // ANDROIDMEDIALIBRARY_H
More information about the Android
mailing list