Merge pull request #5010 from ByteHamster/crash-fix
Various crash fixes reported in the beta
This commit is contained in:
commit
a49b4477a9
|
@ -137,13 +137,6 @@
|
|||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<service
|
||||
android:name=".core.service.PlayerWidgetJobService"
|
||||
android:permission="android.permission.BIND_JOB_SERVICE"
|
||||
android:enabled="true"
|
||||
android:exported="false">
|
||||
</service>
|
||||
|
||||
<receiver
|
||||
android:name=".core.receiver.PlayerWidget"
|
||||
android:exported="true">
|
||||
|
|
|
@ -53,6 +53,10 @@ public class ChaptersListAdapter extends RecyclerView.Adapter<ChaptersListAdapte
|
|||
@Override
|
||||
public void onBindViewHolder(@NonNull ChapterHolder holder, int position) {
|
||||
Chapter sc = getItem(position);
|
||||
if (sc == null) {
|
||||
holder.title.setText("Error");
|
||||
return;
|
||||
}
|
||||
holder.title.setText(sc.getTitle());
|
||||
holder.start.setText(Converter.getDurationStringLong((int) sc
|
||||
.getStart()));
|
||||
|
|
|
@ -105,7 +105,9 @@ public class ExoPlayerWrapper implements IPlayer {
|
|||
|
||||
@Override
|
||||
public void onSeekProcessed() {
|
||||
audioSeekCompleteListener.onSeekComplete(null);
|
||||
if (audioSeekCompleteListener != null) {
|
||||
audioSeekCompleteListener.onSeekComplete(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -174,7 +176,9 @@ public class ExoPlayerWrapper implements IPlayer {
|
|||
@Override
|
||||
public void seekTo(int i) throws IllegalStateException {
|
||||
exoPlayer.seekTo(i);
|
||||
audioSeekCompleteListener.onSeekComplete(null);
|
||||
if (audioSeekCompleteListener != null) {
|
||||
audioSeekCompleteListener.onSeekComplete(null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -208,7 +208,9 @@ public abstract class PlaybackController {
|
|||
handleStatus();
|
||||
} else {
|
||||
Log.w(TAG, "Couldn't receive status update: playbackService was null");
|
||||
bindToService();
|
||||
if (PlaybackService.isRunning) {
|
||||
bindToService();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -232,7 +234,7 @@ public abstract class PlaybackController {
|
|||
onBufferUpdate(progress);
|
||||
break;
|
||||
case PlaybackService.NOTIFICATION_TYPE_RELOAD:
|
||||
if (playbackService == null) {
|
||||
if (playbackService == null && PlaybackService.isRunning) {
|
||||
bindToService();
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue