mirror of https://github.com/M66B/FairEmail.git
Refactoring
This commit is contained in:
parent
9244fdffda
commit
855cf39d2a
|
@ -88,12 +88,16 @@ public class MediaPlayerHelper {
|
|||
// 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);
|
||||
return isInCall(mode);
|
||||
} catch (Throwable ex) {
|
||||
Log.e(ex);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static boolean isInCall(int mode) {
|
||||
return (mode == AudioManager.MODE_RINGTONE ||
|
||||
mode == AudioManager.MODE_IN_CALL ||
|
||||
mode == AudioManager.MODE_IN_COMMUNICATION);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue