mirror of
https://github.com/ultrasonic/ultrasonic
synced 2025-02-17 04:00:39 +01:00
Fixed pause on bluetooth disconnect, minor fixes
This commit is contained in:
parent
fdc1748f8a
commit
7dad738fce
@ -77,17 +77,22 @@ public class Downloader
|
||||
executorService = Executors.newSingleThreadScheduledExecutor();
|
||||
executorService.scheduleWithFixedDelay(downloadChecker, 5, 5, TimeUnit.SECONDS);
|
||||
Log.i(TAG, "Downloader created");
|
||||
|
||||
}
|
||||
|
||||
public void onDestroy()
|
||||
{
|
||||
executorService.shutdown();
|
||||
stop();
|
||||
clear();
|
||||
clearBackground();
|
||||
Log.i(TAG, "Downloader destroyed");
|
||||
}
|
||||
|
||||
public void stop()
|
||||
{
|
||||
executorService.shutdown();
|
||||
Log.i(TAG, "Downloader stopped");
|
||||
}
|
||||
|
||||
public synchronized void checkDownloads()
|
||||
{
|
||||
if (!Util.isExternalStoragePresent() || !externalStorageMonitor.isExternalStorageAvailable())
|
||||
|
@ -1081,7 +1081,7 @@ public class LocalMediaPlayer
|
||||
cachedPosition = mediaPlayer.getCurrentPosition();
|
||||
}
|
||||
|
||||
Util.sleepQuietly(25L);
|
||||
Util.sleepQuietly(50L);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
@ -96,7 +96,6 @@ public class MediaPlayerControllerImpl implements MediaPlayerController
|
||||
{
|
||||
externalStorageMonitor.onDestroy();
|
||||
context.stopService(new Intent(context, MediaPlayerService.class));
|
||||
shufflePlayBuffer.onDestroy();
|
||||
downloader.onDestroy();
|
||||
|
||||
Log.i(TAG, "MediaPlayerControllerImpl destroyed");
|
||||
|
@ -245,6 +245,9 @@ public class MediaPlayerLifecycleSupport
|
||||
mediaPlayerController.pause();
|
||||
mediaPlayerController.seekTo(0);
|
||||
break;
|
||||
case Constants.CMD_PAUSE:
|
||||
mediaPlayerController.pause();
|
||||
break;
|
||||
case Constants.CMD_PROCESS_KEYCODE:
|
||||
receiveIntent(intent);
|
||||
break;
|
||||
|
@ -194,6 +194,8 @@ public class MediaPlayerService extends Service
|
||||
downloadQueueSerializer.serializeDownloadQueueNow(downloader.downloadList,
|
||||
downloader.getCurrentPlayingIndex(), getPlayerPosition());
|
||||
localMediaPlayer.onDestroy();
|
||||
downloader.stop();
|
||||
shufflePlayBuffer.onDestroy();
|
||||
} catch (Throwable ignored) {
|
||||
}
|
||||
|
||||
|
@ -65,11 +65,13 @@ public class ShufflePlayBuffer
|
||||
}
|
||||
};
|
||||
executorService.scheduleWithFixedDelay(runnable, 1, 10, TimeUnit.SECONDS);
|
||||
Log.i(TAG, "ShufflePlayBuffer created");
|
||||
}
|
||||
|
||||
public void onDestroy()
|
||||
{
|
||||
executorService.shutdown();
|
||||
Log.i(TAG, "ShufflePlayBuffer destroyed");
|
||||
}
|
||||
|
||||
public List<MusicDirectory.Entry> get(int size)
|
||||
|
Loading…
x
Reference in New Issue
Block a user