mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-26 09:47:13 +00:00
Refactoring
This commit is contained in:
parent
9244fdffda
commit
855cf39d2a
1 changed files with 7 additions and 3 deletions
|
@ -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 a new issue