set FLAG_RANDOM for songs picked automatically
This commit is contained in:
parent
ca3ce0897c
commit
0729e4d96a
@ -575,7 +575,7 @@ public class MediaUtils {
|
|||||||
*
|
*
|
||||||
* @param resolver A ContentResolver to use.
|
* @param resolver A ContentResolver to use.
|
||||||
*/
|
*/
|
||||||
public static Song randomSong(ContentResolver resolver)
|
public static Song getRandomSong(ContentResolver resolver)
|
||||||
{
|
{
|
||||||
long[] songs = sAllSongs;
|
long[] songs = sAllSongs;
|
||||||
|
|
||||||
@ -591,6 +591,7 @@ public class MediaUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Song result = getSongByTypeId(resolver, MediaUtils.TYPE_SONG, sAllSongs[sAllSongsIdx]);
|
Song result = getSongByTypeId(resolver, MediaUtils.TYPE_SONG, sAllSongs[sAllSongsIdx]);
|
||||||
|
result.flags |= Song.FLAG_RANDOM;
|
||||||
sAllSongsIdx++;
|
sAllSongsIdx++;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -554,7 +554,7 @@ public final class SongTimeline {
|
|||||||
return null;
|
return null;
|
||||||
} else if (pos == size) {
|
} else if (pos == size) {
|
||||||
if (mFinishAction == FINISH_RANDOM) {
|
if (mFinishAction == FINISH_RANDOM) {
|
||||||
song = MediaUtils.randomSong(mContext.getContentResolver());
|
song = MediaUtils.getRandomSong(mContext.getContentResolver());
|
||||||
if (song == null)
|
if (song == null)
|
||||||
return null;
|
return null;
|
||||||
timeline.add(song);
|
timeline.add(song);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user