Stop proximity sensor on pause.
This commit is contained in:
parent
2290a6c0df
commit
8df6e95781
1 changed files with 2 additions and 1 deletions
|
@ -144,14 +144,15 @@ public class VoiceNotePlaybackService extends MediaBrowserServiceCompat {
|
||||||
switch (playbackState) {
|
switch (playbackState) {
|
||||||
case Player.STATE_BUFFERING:
|
case Player.STATE_BUFFERING:
|
||||||
case Player.STATE_READY:
|
case Player.STATE_READY:
|
||||||
voiceNoteProximityManager.onPlayerReady();
|
|
||||||
voiceNoteNotificationManager.showNotification(player);
|
voiceNoteNotificationManager.showNotification(player);
|
||||||
|
|
||||||
if (!playWhenReady) {
|
if (!playWhenReady) {
|
||||||
stopForeground(false);
|
stopForeground(false);
|
||||||
becomingNoisyReceiver.unregister();
|
becomingNoisyReceiver.unregister();
|
||||||
|
voiceNoteProximityManager.onPlayerEnded();
|
||||||
} else {
|
} else {
|
||||||
becomingNoisyReceiver.register();
|
becomingNoisyReceiver.register();
|
||||||
|
voiceNoteProximityManager.onPlayerReady();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Add table
Reference in a new issue