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/tests/src/com | |
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/tests/src/com')
-rw-r--r-- | InCallUI/tests/src/com/android/incallui/ringtone/RingtoneManagerTest.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/InCallUI/tests/src/com/android/incallui/ringtone/RingtoneManagerTest.java b/InCallUI/tests/src/com/android/incallui/ringtone/RingtoneManagerTest.java index 768843e1c..f94f71daa 100644 --- a/InCallUI/tests/src/com/android/incallui/ringtone/RingtoneManagerTest.java +++ b/InCallUI/tests/src/com/android/incallui/ringtone/RingtoneManagerTest.java @@ -72,4 +72,33 @@ public class RingtoneManagerTest extends AndroidTestCase { assertTrue(mRingtoneManager.shouldPlayRingtone(State.INCOMING, RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE))); } + + public void testShouldPlayCallWaitingTone_M() { + if (CompatUtils.isNCompatible()) { + return; + } + assertFalse(mRingtoneManager.shouldPlayCallWaitingTone(0)); + } + + public void testShouldPlayCallWaitingTone_N_NotCallWaiting() { + if (!CompatUtils.isNCompatible()) { + return; + } + assertFalse(mRingtoneManager.shouldPlayCallWaitingTone(State.ACTIVE)); + } + + // Specific case for incoming since it plays its own sound + public void testShouldPlayCallWaitingTone_N_Incoming() { + if (!CompatUtils.isNCompatible()) { + return; + } + assertFalse(mRingtoneManager.shouldPlayCallWaitingTone(State.INCOMING)); + } + + public void testShouldPlayCallWaitingTone_N() { + if (!CompatUtils.isNCompatible()) { + return; + } + assertTrue(mRingtoneManager.shouldPlayCallWaitingTone(State.CALL_WAITING)); + } } |