Notify thread on play/pause

This commit is contained in:
Coffeemakr 2016-12-27 15:58:17 +01:00
parent 659d0d6115
commit f22b5157f5
1 changed files with 3 additions and 3 deletions

View File

@ -266,8 +266,9 @@ public class BackgroundPlayer extends Service /*implements MediaPlayer.OnPrepare
mediaPlayer.setWakeMode(getApplicationContext(), PowerManager.PARTIAL_WAKE_LOCK); mediaPlayer.setWakeMode(getApplicationContext(), PowerManager.PARTIAL_WAKE_LOCK);
mediaPlayer.start(); mediaPlayer.start();
} }
noteBuilder.setIsPlaying(isPlaying); synchronized (PlayerThread.this) {
noteMgr.notify(noteID, noteBuilder.build()); PlayerThread.this.notifyAll();
}
break; break;
} }
case ACTION_REWIND: case ACTION_REWIND:
@ -275,7 +276,6 @@ public class BackgroundPlayer extends Service /*implements MediaPlayer.OnPrepare
synchronized (PlayerThread.this) { synchronized (PlayerThread.this) {
PlayerThread.this.notifyAll(); PlayerThread.this.notifyAll();
} }
// noteMgr.notify(noteID, note);
break; break;
case ACTION_STOP: case ACTION_STOP:
//this auto-releases CPU lock //this auto-releases CPU lock