mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 00:37:47 +00:00
Reset audio mode on incoming ringer stop
Don't request audio focus in IncomingRinger either. Fixes #4548 Closes #4567 // FREEBIE
This commit is contained in:
parent
a8f4dadaf5
commit
64ee669728
@ -29,6 +29,8 @@ import android.os.Vibrator;
|
||||
import android.provider.Settings;
|
||||
import android.util.Log;
|
||||
|
||||
import org.thoughtcrime.securesms.util.ServiceUtil;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
@ -74,13 +76,7 @@ public class IncomingRinger {
|
||||
}
|
||||
|
||||
public void start() {
|
||||
AudioManager audioManager = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE);
|
||||
audioManager.requestAudioFocus(new AudioManager.OnAudioFocusChangeListener() {
|
||||
@Override
|
||||
public void onAudioFocusChange(int focusChange) {}
|
||||
},
|
||||
AudioManager.STREAM_MUSIC,
|
||||
AudioManager.AUDIOFOCUS_GAIN);
|
||||
AudioManager audioManager = ServiceUtil.getAudioManager(context);
|
||||
|
||||
if(player == null) {
|
||||
//retry player creation to pick up changed ringtones or audio server restarts
|
||||
@ -120,6 +116,9 @@ public class IncomingRinger {
|
||||
}
|
||||
Log.d(TAG, "Cancelling vibrator");
|
||||
vibrator.cancel();
|
||||
|
||||
AudioManager audioManager = ServiceUtil.getAudioManager(context);
|
||||
audioManager.setMode(AudioManager.MODE_NORMAL);
|
||||
}
|
||||
|
||||
private boolean shouldVibrate() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user