-Changed global Rx exception handling to no longer trigger error activity if the exception is undeliverable.

-Added debug settings to force reporting of undeliverable Rx exceptions.
-Changed back MediaSourceManager to use serial disposable for syncing.
This commit is contained in:
John Zhen Mo 2018-02-20 22:35:25 -08:00
parent cc7f27fb53
commit 1a92dfb019
6 changed files with 66 additions and 13 deletions

View file

@ -22,6 +22,7 @@ import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.annotations.NonNull;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.disposables.Disposable;
import io.reactivex.disposables.SerialDisposable;
import io.reactivex.functions.Consumer;
import io.reactivex.subjects.PublishSubject;
@ -45,7 +46,7 @@ public class MediaSourceManager {
private DynamicConcatenatingMediaSource sources;
private Subscription playQueueReactor;
private CompositeDisposable syncReactor;
private SerialDisposable syncReactor;
private PlayQueueItem syncedItem;
@ -69,7 +70,7 @@ public class MediaSourceManager {
this.windowSize = windowSize;
this.loadDebounceMillis = loadDebounceMillis;
this.syncReactor = new CompositeDisposable();
this.syncReactor = new SerialDisposable();
this.debouncedLoadSignal = PublishSubject.create();
this.debouncedLoader = getDebouncedLoader();
@ -251,7 +252,7 @@ public class MediaSourceManager {
final Disposable sync = currentItem.getStream()
.observeOn(AndroidSchedulers.mainThread())
.subscribe(onSuccess, onError);
syncReactor.add(sync);
syncReactor.set(sync);
}
}