1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-26 09:47:13 +00:00

Refactoring

This commit is contained in:
M66B 2022-06-17 22:00:21 +02:00
parent 9244fdffda
commit 855cf39d2a

View file

@ -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);
}
}