[Android] Less intrusive reload notification
Geoffrey Métais
git at videolan.org
Mon Feb 27 18:42:31 CET 2017
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Feb 27 18:41:27 2017 +0100| [0d9005d4da04d40b026c0d611c91c3f5224ec7c3] | committer: Geoffrey Métais
Less intrusive reload notification
For reloads, like on regular app launch, we show notification only if
new media are parsed
> https://code.videolan.org/videolan/vlc-android/commit/0d9005d4da04d40b026c0d611c91c3f5224ec7c3
---
vlc-android/src/org/videolan/vlc/MediaParsingService.java | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/MediaParsingService.java b/vlc-android/src/org/videolan/vlc/MediaParsingService.java
index 42401e0..6144f71 100644
--- a/vlc-android/src/org/videolan/vlc/MediaParsingService.java
+++ b/vlc-android/src/org/videolan/vlc/MediaParsingService.java
@@ -119,7 +119,6 @@ public class MediaParsingService extends Service implements DevicesDiscoveryCb {
mMedialibrary.addDevice(isMainStorage ? "main-storage" : FileUtils.getFileNameFromPath(storage), storage, !isMainStorage);
}
if (mMedialibrary.init(VLCApplication.getAppContext())) {
- showNotification();
LocalBroadcastManager.getInstance(MediaParsingService.this).sendBroadcast(new Intent(VLCApplication.ACTION_MEDIALIBRARY_READY));
String[] foldersList = mMedialibrary.getFoldersList();
if (foldersList.length == 0) {
@@ -210,7 +209,8 @@ public class MediaParsingService extends Service implements DevicesDiscoveryCb {
@Override
public void onDiscoveryProgress(String entryPoint) {
mCurrentDiscovery = entryPoint;
- showNotification();
+ if (mReload == 0)
+ showNotification();
}
@Override
@@ -232,9 +232,6 @@ public class MediaParsingService extends Service implements DevicesDiscoveryCb {
public void onReloadStarted(String entryPoint) {
if (TextUtils.isEmpty(entryPoint))
++mReload;
- synchronized (this) {
- mLastNotificationTime = System.currentTimeMillis();
- }
}
@Override
More information about the Android
mailing list