Fix remaining warnings in MediaPlayerLifecycleSupport

This commit is contained in:
tzugen 2021-05-21 19:20:21 +02:00
parent f596dc77c1
commit 05cb82921d
No known key found for this signature in database
GPG Key ID: 61E9C34BC10EC930

View File

@ -44,7 +44,7 @@ import org.moire.ultrasonic.util.Util;
public class MediaPlayerLifecycleSupport public class MediaPlayerLifecycleSupport
{ {
private boolean created = false; private boolean created = false;
private DownloadQueueSerializer downloadQueueSerializer; // From DI private final DownloadQueueSerializer downloadQueueSerializer; // From DI
private final MediaPlayerController mediaPlayerController; // From DI private final MediaPlayerController mediaPlayerController; // From DI
private final Downloader downloader; // From DI private final Downloader downloader; // From DI
@ -205,9 +205,7 @@ public class MediaPlayerLifecycleSupport
keyCode == KeyEvent.KEYCODE_MEDIA_NEXT); keyCode == KeyEvent.KEYCODE_MEDIA_NEXT);
// We can receive intents (e.g. MediaButton) when everything is stopped, so we need to start // We can receive intents (e.g. MediaButton) when everything is stopped, so we need to start
onCreate(autoStart, new Runnable() { onCreate(autoStart, () -> {
@Override
public void run() {
switch (keyCode) switch (keyCode)
{ {
case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE: case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE:
@ -257,7 +255,6 @@ public class MediaPlayerLifecycleSupport
default: default:
break; break;
} }
}
}); });
} }
@ -278,9 +275,7 @@ public class MediaPlayerLifecycleSupport
intentAction.equals(Constants.CMD_NEXT)); intentAction.equals(Constants.CMD_NEXT));
// We can receive intents when everything is stopped, so we need to start // We can receive intents when everything is stopped, so we need to start
onCreate(autoStart, new Runnable() { onCreate(autoStart, () -> {
@Override
public void run() {
switch(intentAction) switch(intentAction)
{ {
case Constants.CMD_PLAY: case Constants.CMD_PLAY:
@ -308,7 +303,6 @@ public class MediaPlayerLifecycleSupport
mediaPlayerController.pause(); mediaPlayerController.pause();
break; break;
} }
}
}); });
} }
} }