Merge "Use IncomingCallFilterGraph to perform incoming call filters." am: 482556f24a
am: 40dba6c807
Change-Id: I1273d4bdeabcb3adab24f2b1acf51bf3ef15fe71
diff --git a/src/com/android/server/telecom/AsyncRingtonePlayer.java b/src/com/android/server/telecom/AsyncRingtonePlayer.java
index 8f11882..93041c8 100644
--- a/src/com/android/server/telecom/AsyncRingtonePlayer.java
+++ b/src/com/android/server/telecom/AsyncRingtonePlayer.java
@@ -224,10 +224,11 @@
// can know whether to trigger the vibrator.
if (mHapticsFuture != null && !mHapticsFuture.isDone()) {
boolean hasHaptics = factory.hasHapticChannels(mRingtone);
-
Log.i(this, "handlePlay: hasHaptics=%b, isVibrationEnabled=%b", hasHaptics,
isVibrationEnabled);
- if (hasHaptics) {
+ SystemSettingsUtil systemSettingsUtil = new SystemSettingsUtil();
+ if (hasHaptics && (volumeShaperConfig == null
+ || systemSettingsUtil.enableAudioCoupledVibrationForRampingRinger())) {
AudioAttributes attributes = mRingtone.getAudioAttributes();
Log.d(this, "handlePlay: %s haptic channel",
(isVibrationEnabled ? "unmuting" : "muting"));
diff --git a/src/com/android/server/telecom/Ringer.java b/src/com/android/server/telecom/Ringer.java
index 55f2b0d..49cf7e5 100644
--- a/src/com/android/server/telecom/Ringer.java
+++ b/src/com/android/server/telecom/Ringer.java
@@ -346,6 +346,12 @@
isUsingAudioCoupledHaptics, mIsHapticPlaybackSupportedByDevice);
maybeStartVibration(foregroundCall, shouldRingForContact, effect,
isVibratorEnabled, isRingerAudible);
+ } else if (mSystemSettingsUtil.applyRampingRinger(mContext)
+ && mSystemSettingsUtil.enableRampingRingerFromDeviceConfig()
+ && !mSystemSettingsUtil.enableAudioCoupledVibrationForRampingRinger()) {
+ Log.i(this, "startRinging: apply ramping ringer vibration");
+ maybeStartVibration(foregroundCall, shouldRingForContact, effect,
+ isVibratorEnabled, isRingerAudible);
} else {
Log.addEvent(foregroundCall, LogUtils.Events.SKIP_VIBRATION,
"using audio-coupled haptics");
@@ -368,7 +374,6 @@
private void maybeStartVibration(Call foregroundCall, boolean shouldRingForContact,
VibrationEffect effect, boolean isVibrationEnabled, boolean isRingerAudible) {
-
if (isVibrationEnabled
&& !mIsVibrating && shouldRingForContact) {
if (mSystemSettingsUtil.applyRampingRinger(mContext)