removing a redundant function
This commit is contained in:
parent
482acedf4c
commit
bd76b43b0e
1 changed files with 2 additions and 17 deletions
|
@ -62,7 +62,6 @@ class MusicService : Service(), MediaPlayer.OnPreparedListener, MediaPlayer.OnEr
|
|||
var mTracks = ArrayList<Track>()
|
||||
private var mHeadsetPlugReceiver = HeadsetPlugReceiver()
|
||||
private var mPlayer: MediaPlayer? = null
|
||||
private var mPlayedTrackIndexes = ArrayList<Int>()
|
||||
private var mProgressHandler = Handler()
|
||||
private var mSleepTimer: CountDownTimer? = null
|
||||
private var mAudioManager: AudioManager? = null
|
||||
|
@ -174,7 +173,7 @@ class MusicService : Service(), MediaPlayer.OnPreparedListener, MediaPlayer.OnEr
|
|||
mTracks.add(track)
|
||||
}
|
||||
} else {
|
||||
getSortedTracks()
|
||||
mTracks = getQueuedTracks()
|
||||
|
||||
val wantedTrackId = intent?.getLongExtra(TRACK_ID, -1L)
|
||||
mCurrTrack = mTracks.firstOrNull { it.id == wantedTrackId }
|
||||
|
@ -246,7 +245,7 @@ class MusicService : Service(), MediaPlayer.OnPreparedListener, MediaPlayer.OnEr
|
|||
private fun handleRefreshList(intent: Intent) {
|
||||
mTracks.clear()
|
||||
ensureBackgroundThread {
|
||||
getSortedTracks()
|
||||
mTracks = getQueuedTracks()
|
||||
EventBus.getDefault().post(Events.PlaylistUpdated(mTracks))
|
||||
|
||||
if (intent.getBooleanExtra(CALL_SETUP_AFTER, false)) {
|
||||
|
@ -402,20 +401,6 @@ class MusicService : Service(), MediaPlayer.OnPreparedListener, MediaPlayer.OnEr
|
|||
}
|
||||
}
|
||||
|
||||
private fun getSortedTracks() {
|
||||
if (config.currentPlaylist == ALL_TRACKS_PLAYLIST_ID) {
|
||||
getAllDeviceTracks()
|
||||
}
|
||||
|
||||
mTracks = getQueuedTracks()
|
||||
|
||||
/*Track.sorting = config.sorting
|
||||
try {
|
||||
mTracks.sort()
|
||||
} catch (ignored: Exception) {
|
||||
}*/
|
||||
}
|
||||
|
||||
private fun setupEqualizer() {
|
||||
try {
|
||||
mEqualizer = Equalizer(1, mPlayer!!.audioSessionId)
|
||||
|
|
Loading…
Reference in a new issue