[Android] Set nicer priorities for recommendations
Geoffrey Métais
git at videolan.org
Tue Apr 7 10:45:14 CEST 2015
vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Apr 2 16:34:05 2015 +0200| [86853da6a7be62db95e8efbd178acbf36ef4461d] | committer: Geoffrey Métais
Set nicer priorities for recommendations
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=86853da6a7be62db95e8efbd178acbf36ef4461d
---
.../tv/src/org/videolan/vlc/gui/tv/RecommendationsService.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/vlc-android/tv/src/org/videolan/vlc/gui/tv/RecommendationsService.java b/vlc-android/tv/src/org/videolan/vlc/gui/tv/RecommendationsService.java
index 6f65822..f8b9710 100644
--- a/vlc-android/tv/src/org/videolan/vlc/gui/tv/RecommendationsService.java
+++ b/vlc-android/tv/src/org/videolan/vlc/gui/tv/RecommendationsService.java
@@ -71,7 +71,7 @@ public class RecommendationsService extends IntentService {
MediaLibrary.getInstance().loadMediaItems();
}
}
- private static void buildRecommendation(MediaWrapper movie, int id) {
+ private static void buildRecommendation(MediaWrapper movie, int id, int priority) {
if (movie == null)
return;
@@ -92,7 +92,7 @@ public class RecommendationsService extends IntentService {
.setContentText(movie.getDescription())
.setContentInfo("VLC")
// .setSortKey("0.8")
- .setPriority(7)
+ .setPriority(priority)
.setLocalOnly(true)
.setOngoing(true)
.setColor(sContext.getResources().getColor(R.color.orange500))
@@ -142,7 +142,7 @@ public class RecommendationsService extends IntentService {
String last = Uri.decode(PreferenceManager.getDefaultSharedPreferences(sContext).getString(PreferencesActivity.VIDEO_LAST, null));
int id = 0;
if (last != null) {
- buildRecommendation(MediaLibrary.getInstance().getMediaItem(last), id);
+ buildRecommendation(MediaLibrary.getInstance().getMediaItem(last), id, Notification.PRIORITY_HIGH);
}
ArrayList<MediaWrapper> videoList = MediaLibrary.getInstance().getVideoItems();
if (videoList == null || videoList.isEmpty())
@@ -154,7 +154,7 @@ public class RecommendationsService extends IntentService {
continue;
pic = sMediaDatabase.getPicture(sContext, mediaWrapper.getLocation());
if (pic != null && pic.getByteCount() > 4 && mediaWrapper.getTime() == 0) {
- buildRecommendation(mediaWrapper, ++id);
+ buildRecommendation(mediaWrapper, ++id, Notification.PRIORITY_DEFAULT);
}
if (id == 3)
return true;
More information about the Android
mailing list