mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-25 01:07:47 +00:00
Don't set media volume to zero.
Not sure what SOA was thinking with this one. Fixes #4201 // FREEBIE
This commit is contained in:
parent
5b6f49c993
commit
cad8ff766a
@ -18,6 +18,7 @@
|
|||||||
package org.thoughtcrime.redphone.audio;
|
package org.thoughtcrime.redphone.audio;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
|
import android.annotation.TargetApi;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.media.AudioManager;
|
import android.media.AudioManager;
|
||||||
import android.media.MediaPlayer;
|
import android.media.MediaPlayer;
|
||||||
@ -94,7 +95,6 @@ public class IncomingRinger {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (player != null && ringerMode == AudioManager.RINGER_MODE_NORMAL ) {
|
if (player != null && ringerMode == AudioManager.RINGER_MODE_NORMAL ) {
|
||||||
audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, 0, 0);
|
|
||||||
audioManager.setMode(AudioManager.MODE_RINGTONE);
|
audioManager.setMode(AudioManager.MODE_RINGTONE);
|
||||||
try {
|
try {
|
||||||
if(!player.isPlaying()) {
|
if(!player.isPlaying()) {
|
||||||
@ -104,10 +104,7 @@ public class IncomingRinger {
|
|||||||
} else {
|
} else {
|
||||||
Log.d(TAG, "Ringtone is already playing, declining to restart.");
|
Log.d(TAG, "Ringtone is already playing, declining to restart.");
|
||||||
}
|
}
|
||||||
} catch (IllegalStateException e) {
|
} catch (IllegalStateException | IOException e) {
|
||||||
Log.w(TAG, e);
|
|
||||||
player = null;
|
|
||||||
} catch (IOException e) {
|
|
||||||
Log.w(TAG, e);
|
Log.w(TAG, e);
|
||||||
player = null;
|
player = null;
|
||||||
}
|
}
|
||||||
@ -136,7 +133,7 @@ public class IncomingRinger {
|
|||||||
return shouldVibrateOld(context);
|
return shouldVibrateOld(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("NewApi")
|
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
||||||
private boolean shouldVibrateNew(Context context) {
|
private boolean shouldVibrateNew(Context context) {
|
||||||
AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
|
AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
|
||||||
Vibrator vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
|
Vibrator vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user