diff options
author | Brandon Maxwell <maxwelb@google.com> | 2016-02-12 10:37:35 -0800 |
---|---|---|
committer | Brandon Maxwell <maxwelb@google.com> | 2016-02-12 16:25:04 -0800 |
commit | 054559b6c279a0149ac6473d1897f6db817c5a57 (patch) | |
tree | 9e61a9bf511d4fe77355c515514fc564a6c1fe89 /InCallUI/src/com/android/incallui/StatusBarNotifier.java | |
parent | 37274fedfe39d25ac91acb80c41d15aa78adc0f1 (diff) |
Integrating DialerRingtoneManager and InCallTonePlayer
This change makes the Call Waiting tone actually play during the
Call Waiting use case.
+ Plugging InCallTonePlayer into the DialerRingtoneManager in the
StatusBarNotifier
+ Test fixes
+ Added tests for when Dialer ringing is disabled
+ Added tests for DialerRingtoneManager#playCallWaitingTone
- Removed unneeded @NeededForTesting annotations from InCallTonePlayer
since they won't be stipped out by proguard.
Change-Id: I49a83d2a7fe6edf5f9ec88db973a5f37e307f23a
Diffstat (limited to 'InCallUI/src/com/android/incallui/StatusBarNotifier.java')
-rw-r--r-- | InCallUI/src/com/android/incallui/StatusBarNotifier.java | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/InCallUI/src/com/android/incallui/StatusBarNotifier.java b/InCallUI/src/com/android/incallui/StatusBarNotifier.java index 623cbb667..6c00164b9 100644 --- a/InCallUI/src/com/android/incallui/StatusBarNotifier.java +++ b/InCallUI/src/com/android/incallui/StatusBarNotifier.java @@ -50,10 +50,14 @@ import com.android.contacts.common.preference.ContactsPreferences; import com.android.contacts.common.testing.NeededForTesting; import com.android.contacts.common.util.BitmapUtil; import com.android.contacts.common.util.ContactDisplayUtils; +import com.android.incallui.Call.State; import com.android.incallui.ContactInfoCache.ContactCacheEntry; import com.android.incallui.ContactInfoCache.ContactInfoCacheCallback; import com.android.incallui.InCallPresenter.InCallState; +import com.android.incallui.async.PausableExecutorImpl; import com.android.incallui.ringtone.DialerRingtoneManager; +import com.android.incallui.ringtone.InCallTonePlayer; +import com.android.incallui.ringtone.ToneGeneratorFactory; import java.util.Objects; @@ -95,7 +99,12 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener, mContactInfoCache = contactInfoCache; mNotificationManager = (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE); - mDialerRingtoneManager = new DialerRingtoneManager(); + mDialerRingtoneManager = new DialerRingtoneManager( + new InCallTonePlayer( + AudioModeProvider.getInstance(), + new ToneGeneratorFactory(), + new PausableExecutorImpl()), + CallList.getInstance()); mCurrentNotification = NOTIFICATION_NONE; } @@ -308,7 +317,8 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener, notification.vibrate = VIBRATE_PATTERN; } if (mDialerRingtoneManager.shouldPlayCallWaitingTone(callState)) { - // TODO (maxwelb) play call waiting + Log.v(this, "Playing call waiting tone"); + mDialerRingtoneManager.playCallWaitingTone(); } if (mCurrentNotification != notificationType && mCurrentNotification != NOTIFICATION_NONE) { Log.i(this, "Previous notification already showing - cancelling " @@ -699,7 +709,9 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener, @Override public void onCallChanged(Call call) { - // no-op + if (CallList.getInstance().getIncomingCall() == null) { + mDialerRingtoneManager.stopCallWaitingTone(); + } } /** |