catch platform bug when getting ringer mode
This commit is contained in:
parent
8b331895d1
commit
d02e24248f
|
@ -721,10 +721,15 @@ public class XmppConnectionService extends Service {
|
||||||
|
|
||||||
private boolean isPhoneSilenced() {
|
private boolean isPhoneSilenced() {
|
||||||
AudioManager audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
|
AudioManager audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
|
||||||
if (treatVibrateAsSilent()) {
|
try {
|
||||||
return audioManager.getRingerMode() != AudioManager.RINGER_MODE_NORMAL;
|
if (treatVibrateAsSilent()) {
|
||||||
} else {
|
return audioManager.getRingerMode() != AudioManager.RINGER_MODE_NORMAL;
|
||||||
return audioManager.getRingerMode() == AudioManager.RINGER_MODE_SILENT;
|
} else {
|
||||||
|
return audioManager.getRingerMode() == AudioManager.RINGER_MODE_SILENT;
|
||||||
|
}
|
||||||
|
} catch (Throwable throwable) {
|
||||||
|
Log.d(Config.LOGTAG,"platform bug in isPhoneSilenced ("+ throwable.getMessage()+")");
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue