mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-03 13:44:40 +00:00
Added failsafe
This commit is contained in:
parent
7b68dbf54a
commit
e070e08368
1 changed files with 11 additions and 6 deletions
|
@ -85,11 +85,16 @@ public class MediaPlayerHelper {
|
|||
if (am == null)
|
||||
return false;
|
||||
|
||||
// This doesn't require READ_PHONE_STATE permission
|
||||
int mode = am.getMode();
|
||||
EntityLog.log(context, "Audio mode=" + mode);
|
||||
return (mode == AudioManager.MODE_RINGTONE ||
|
||||
mode == AudioManager.MODE_IN_CALL ||
|
||||
mode == AudioManager.MODE_IN_COMMUNICATION);
|
||||
try {
|
||||
// This doesn't require READ_PHONE_STATE permission
|
||||
int mode = am.getMode();
|
||||
Log.i("Audio mode=" + mode);
|
||||
return (mode == AudioManager.MODE_RINGTONE ||
|
||||
mode == AudioManager.MODE_IN_CALL ||
|
||||
mode == AudioManager.MODE_IN_COMMUNICATION);
|
||||
} catch (Throwable ex) {
|
||||
Log.e(ex);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue