Loading src/com/android/server/telecom/Ringer.java +0 −5 Original line number Diff line number Diff line Loading @@ -433,11 +433,6 @@ public class Ringer { && isVibratorEnabled) { Log.i(this, "Muted haptic channels since audio coupled ramping ringer is disabled"); hapticChannelsMuted = true; if (useCustomVibration(foregroundCall)) { Log.i(this, "Not muted haptic channel for customization when apply ramping ringer"); hapticChannelsMuted = false; } } else if (hapticChannelsMuted) { Log.i(this, "Muted haptic channels isVibratorEnabled=%s, hapticPlaybackSupported=%s", Loading tests/src/com/android/server/telecom/tests/RingerTest.java +0 −32 Original line number Diff line number Diff line Loading @@ -890,38 +890,6 @@ public class RingerTest extends TelecomTestCase { } } @SmallTest @Test @EnableFlags(Flags.FLAG_ENABLE_RINGTONE_HAPTICS_CUSTOMIZATION) public void testNotMuteHapticChannelWithRampingRinger() throws Exception { final Context context = ApplicationProvider.getApplicationContext(); Uri defaultRingtoneUri = RingtoneManager.getActualDefaultRingtoneUri(context, RingtoneManager.TYPE_RINGTONE); assumeNotNull(defaultRingtoneUri); Uri FAKE_RINGTONE_VIBRATION_URI = defaultRingtoneUri.buildUpon().appendQueryParameter( VIBRATION_PARAM, FAKE_VIBRATION_URI.toString()).build(); mComponentContextFixture.putBooleanResource( com.android.internal.R.bool.config_ringtoneVibrationSettingsSupported, true); ArgumentCaptor<Boolean> muteHapticChannelCaptor = ArgumentCaptor.forClass(Boolean.class); try { RingtoneManager.setActualDefaultRingtoneUri(context, RingtoneManager.TYPE_RINGTONE, FAKE_RINGTONE_VIBRATION_URI); createRingerUnderTest(); // Needed after mock the config. mRingerUnderTest.startCallWaiting(mockCall1); ensureRingerIsAudible(); enableRampingRinger(); enableVibrationWhenRinging(); assertTrue(startRingingAndWaitForAsync(mockCall2, false)); verify(mockRingtoneFactory, atLeastOnce()).getRingtone(any(Call.class), nullable(VolumeShaper.Configuration.class), muteHapticChannelCaptor.capture()); assertFalse(muteHapticChannelCaptor.getValue()); } finally { // Restore the default ringtone Uri RingtoneManager.setActualDefaultRingtoneUri(context, RingtoneManager.TYPE_RINGTONE, defaultRingtoneUri); } } /** * Call startRinging and wait for its effects to have played out, to allow reliable assertions * after it. The effects are generally "start playing ringtone" and "start vibration" - not Loading Loading
src/com/android/server/telecom/Ringer.java +0 −5 Original line number Diff line number Diff line Loading @@ -433,11 +433,6 @@ public class Ringer { && isVibratorEnabled) { Log.i(this, "Muted haptic channels since audio coupled ramping ringer is disabled"); hapticChannelsMuted = true; if (useCustomVibration(foregroundCall)) { Log.i(this, "Not muted haptic channel for customization when apply ramping ringer"); hapticChannelsMuted = false; } } else if (hapticChannelsMuted) { Log.i(this, "Muted haptic channels isVibratorEnabled=%s, hapticPlaybackSupported=%s", Loading
tests/src/com/android/server/telecom/tests/RingerTest.java +0 −32 Original line number Diff line number Diff line Loading @@ -890,38 +890,6 @@ public class RingerTest extends TelecomTestCase { } } @SmallTest @Test @EnableFlags(Flags.FLAG_ENABLE_RINGTONE_HAPTICS_CUSTOMIZATION) public void testNotMuteHapticChannelWithRampingRinger() throws Exception { final Context context = ApplicationProvider.getApplicationContext(); Uri defaultRingtoneUri = RingtoneManager.getActualDefaultRingtoneUri(context, RingtoneManager.TYPE_RINGTONE); assumeNotNull(defaultRingtoneUri); Uri FAKE_RINGTONE_VIBRATION_URI = defaultRingtoneUri.buildUpon().appendQueryParameter( VIBRATION_PARAM, FAKE_VIBRATION_URI.toString()).build(); mComponentContextFixture.putBooleanResource( com.android.internal.R.bool.config_ringtoneVibrationSettingsSupported, true); ArgumentCaptor<Boolean> muteHapticChannelCaptor = ArgumentCaptor.forClass(Boolean.class); try { RingtoneManager.setActualDefaultRingtoneUri(context, RingtoneManager.TYPE_RINGTONE, FAKE_RINGTONE_VIBRATION_URI); createRingerUnderTest(); // Needed after mock the config. mRingerUnderTest.startCallWaiting(mockCall1); ensureRingerIsAudible(); enableRampingRinger(); enableVibrationWhenRinging(); assertTrue(startRingingAndWaitForAsync(mockCall2, false)); verify(mockRingtoneFactory, atLeastOnce()).getRingtone(any(Call.class), nullable(VolumeShaper.Configuration.class), muteHapticChannelCaptor.capture()); assertFalse(muteHapticChannelCaptor.getValue()); } finally { // Restore the default ringtone Uri RingtoneManager.setActualDefaultRingtoneUri(context, RingtoneManager.TYPE_RINGTONE, defaultRingtoneUri); } } /** * Call startRinging and wait for its effects to have played out, to allow reliable assertions * after it. The effects are generally "start playing ringtone" and "start vibration" - not Loading