mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-22 10:46:50 +00:00
Fix issue with media controller lifecycle.
We were connecting and disconnecting in onStart and onStop, which can get called in different orders depending on what the system does. This results in sometimes trying to connect to an already connected media session.
This commit is contained in:
@@ -105,19 +105,16 @@ public class VoiceNoteMediaController implements DefaultLifecycleObserver {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart(@NonNull LifecycleOwner owner) {
|
||||
public void onResume(@NonNull LifecycleOwner owner) {
|
||||
if (!mediaBrowser.isConnected()) {
|
||||
mediaBrowser.connect();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume(@NonNull LifecycleOwner owner) {
|
||||
activity.setVolumeControlStream(AudioManager.STREAM_MUSIC);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop(@NonNull LifecycleOwner owner) {
|
||||
public void onPause(@NonNull LifecycleOwner owner) {
|
||||
clearProgressEventHandler();
|
||||
|
||||
if (MediaControllerCompat.getMediaController(activity) != null) {
|
||||
|
||||
Reference in New Issue
Block a user