Program: 62824
Project: 62824
Buggy source:
@Override public void onEvent(MediaPlayer.Event event){
switch (event.type) {
case MediaPlayer.Event.Playing:
    if (BuildConfig.DEBUG)     Log.i(TAG,"String_Node_Str");
  executeUpdate();
publishState();
executeUpdateProgress();
mHandler.sendEmptyMessage(SHOW_PROGRESS);
changeAudioFocus(true);
if (!mWakeLock.isHeld()) mWakeLock.acquire();
if (!mKeyguardManager.inKeyguardRestrictedInputMode() && !playlistManager.getVideoBackground() && playlistManager.switchToVideo()) {
hideNotification();
}
 else {
showPlayer();
showNotification();
}
break;
case MediaPlayer.Event.Paused:
if (BuildConfig.DEBUG) Log.i(TAG,"String_Node_Str");
executeUpdate();
publishState();
executeUpdateProgress();
showNotification();
mHandler.removeMessages(SHOW_PROGRESS);
if (mWakeLock.isHeld()) mWakeLock.release();
break;
case MediaPlayer.Event.Stopped:
if (BuildConfig.DEBUG) Log.i(TAG,"String_Node_Str");
onPlaybackStopped();
break;
case MediaPlayer.Event.EndReached:
executeUpdateProgress();
break;
case MediaPlayer.Event.EncounteredError:
showToast(getString(R.string.invalid_location,playlistManager.getCurrentMedia().getLocation()),Toast.LENGTH_SHORT);
executeUpdate();
executeUpdateProgress();
break;
case MediaPlayer.Event.TimeChanged:
break;
case MediaPlayer.Event.PositionChanged:
updateWidgetPosition(event.getPositionChanged());
publishState();
break;
case MediaPlayer.Event.Vout:
break;
case MediaPlayer.Event.ESAdded:
if (event.getEsChangedType() == Media.Track.Type.Video && (playlistManager.getVideoBackground() || !playlistManager.switchToVideo())) {
updateMetadata();
}
break;
case MediaPlayer.Event.ESDeleted:
break;
case MediaPlayer.Event.MediaChanged:
Log.d(TAG,"String_Node_Str");
}
synchronized (mCallbacks) {
for (Callback callback : mCallbacks) callback.onMediaPlayerEvent(event);
}
}

Fixed version (ground truth):
@Override public void onEvent(MediaPlayer.Event event){
switch (event.type) {
case MediaPlayer.Event.Playing:
    if (BuildConfig.DEBUG)     Log.i(TAG,"String_Node_Str");
  executeUpdate();
publishState();
executeUpdateProgress();
mHandler.sendEmptyMessage(SHOW_PROGRESS);
changeAudioFocus(true);
if (!mWakeLock.isHeld()) mWakeLock.acquire();
if (!mKeyguardManager.inKeyguardRestrictedInputMode() && !playlistManager.getVideoBackground() && playlistManager.switchToVideo()) {
hideNotification();
}
 else {
showPlayer();
showNotification();
}
break;
case MediaPlayer.Event.Paused:
if (BuildConfig.DEBUG) Log.i(TAG,"String_Node_Str");
executeUpdate();
publishState();
executeUpdateProgress();
showNotification();
mHandler.removeMessages(SHOW_PROGRESS);
if (mWakeLock.isHeld()) mWakeLock.release();
break;
case MediaPlayer.Event.Stopped:
if (BuildConfig.DEBUG) Log.i(TAG,"String_Node_Str");
onPlaybackStopped();
break;
case MediaPlayer.Event.EndReached:
executeUpdateProgress();
break;
case MediaPlayer.Event.EncounteredError:
executeUpdate();
executeUpdateProgress();
break;
case MediaPlayer.Event.TimeChanged:
break;
case MediaPlayer.Event.PositionChanged:
updateWidgetPosition(event.getPositionChanged());
publishState();
break;
case MediaPlayer.Event.Vout:
break;
case MediaPlayer.Event.ESAdded:
if (event.getEsChangedType() == Media.Track.Type.Video && (playlistManager.getVideoBackground() || !playlistManager.switchToVideo())) {
updateMetadata();
}
break;
case MediaPlayer.Event.ESDeleted:
break;
case MediaPlayer.Event.MediaChanged:
Log.d(TAG,"String_Node_Str");
}
synchronized (mCallbacks) {
for (Callback callback : mCallbacks) callback.onMediaPlayerEvent(event);
}
}