diff options
author | Brandon Maxwell <maxwelb@google.com> | 2016-01-29 17:49:28 -0800 |
---|---|---|
committer | Brandon Maxwell <maxwelb@google.com> | 2016-01-29 18:43:55 -0800 |
commit | 249c755441938ead47c01d27c168c4096e0d9769 (patch) | |
tree | 26cfe0ece4c8e622a314c613478ce97b36308456 /InCallUI/src/com/android/incallui/ringtone/DialerRingtoneManager.java | |
parent | cc7e5a7a71ecd3037802668be19935270f9c0216 (diff) |
Adding method to check if call waiting tone should be played
+ This method will be used in StatusBarNotifier to determine when
call waiting tones should be played instead of the standard ringtone
Change-Id: I4ad55f3870de5e63d03f4a5e8534680fa24556bd
Diffstat (limited to 'InCallUI/src/com/android/incallui/ringtone/DialerRingtoneManager.java')
-rw-r--r-- | InCallUI/src/com/android/incallui/ringtone/DialerRingtoneManager.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/InCallUI/src/com/android/incallui/ringtone/DialerRingtoneManager.java b/InCallUI/src/com/android/incallui/ringtone/DialerRingtoneManager.java index ad580cb0d..8d4d068e1 100644 --- a/InCallUI/src/com/android/incallui/ringtone/DialerRingtoneManager.java +++ b/InCallUI/src/com/android/incallui/ringtone/DialerRingtoneManager.java @@ -53,6 +53,19 @@ public class DialerRingtoneManager { return mForceDialerRingingEnabled || IS_DIALER_RINGING_ENABLED; } + /** + * Determines if a call waiting tone should be played for the the given call state + * (see {@link State}). + * + * @param callState the call state for the call being checked. + * @return {@code true} if the call waiting tone should be played, {@code false} otherwise. + */ + public boolean shouldPlayCallWaitingTone(int callState) { + return CompatUtils.isNCompatible() + && isDialerRingingEnabled() + && callState == State.CALL_WAITING; + } + @NeededForTesting void forceDialerRingingEnabled() { mForceDialerRingingEnabled = true; |