Loading res/values/strings.xml +2 −2 Original line number Diff line number Diff line Loading @@ -73,8 +73,8 @@ that a call be put into the background so that the app can access the audio from the call. [CHAR LIMIT=NONE] --> <string name="notification_audioProcessing_body"> <xliff:g id="audio_processing_app_name">%s</xliff:g> has placed a call into the background. This app may be accessing and playing audio over the call. <xliff:g id="audio_processing_app_name">%s</xliff:g> is processing a call in the background. This app may be accessing and playing audio over the call. </string> <!-- Crashed in call service notification label, used when the in call service has crashed and Loading src/com/android/server/telecom/Ringer.java +3 −1 Original line number Diff line number Diff line Loading @@ -505,9 +505,11 @@ public class Ringer { private boolean isVibratorEnabled(Context context) { AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE); // Use AudioManager#getRingerMode for more accurate result, instead of // AudioManager#getRingerModeInternal which only useful for volume controllers return mVibrator.hasVibrator() && mSystemSettingsUtil.isRingVibrationEnabled(context) && audioManager.getRingerModeInternal() != AudioManager.RINGER_MODE_SILENT; && audioManager.getRingerMode() != AudioManager.RINGER_MODE_SILENT; } private RingerAttributes getRingerAttributes(Call call, boolean isHfpDeviceAttached) { Loading tests/src/com/android/server/telecom/tests/RingerTest.java +9 −9 Original line number Diff line number Diff line Loading @@ -139,7 +139,7 @@ public class RingerTest extends TelecomTestCase { when(mockPlayerFactory.createPlayer(anyInt())).thenReturn(mockTonePlayer); mockAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE); when(mockAudioManager.getRingerModeInternal()).thenReturn(AudioManager.RINGER_MODE_NORMAL); when(mockAudioManager.getRingerMode()).thenReturn(AudioManager.RINGER_MODE_NORMAL); when(mockSystemSettingsUtil.isHapticPlaybackSupported(any(Context.class))).thenReturn(true); NotificationManager notificationManager = (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE); Loading Loading @@ -286,7 +286,7 @@ public class RingerTest extends TelecomTestCase { public void testVibrateButNoRingForNullRingtone() throws Exception { mRingerUnderTest.startCallWaiting(mockCall1); when(mockRingtoneFactory.getRingtone(any(Call.class))).thenReturn(null); when(mockAudioManager.getRingerModeInternal()).thenReturn(AudioManager.RINGER_MODE_NORMAL); when(mockAudioManager.getRingerMode()).thenReturn(AudioManager.RINGER_MODE_NORMAL); mFuture.complete(false); // not using audio coupled haptics enableVibrationWhenRinging(); assertFalse(mRingerUnderTest.startRinging(mockCall2, false)); Loading @@ -306,7 +306,7 @@ public class RingerTest extends TelecomTestCase { mRingerUnderTest.startCallWaiting(mockCall1); Ringtone mockRingtone = mock(Ringtone.class); when(mockRingtoneFactory.getRingtone(any(Call.class))).thenReturn(mockRingtone); when(mockAudioManager.getRingerModeInternal()).thenReturn(AudioManager.RINGER_MODE_VIBRATE); when(mockAudioManager.getRingerMode()).thenReturn(AudioManager.RINGER_MODE_VIBRATE); when(mockAudioManager.getStreamVolume(AudioManager.STREAM_RING)).thenReturn(0); mFuture.complete(false); // not using audio coupled haptics enableVibrationWhenRinging(); Loading @@ -327,7 +327,7 @@ public class RingerTest extends TelecomTestCase { mRingerUnderTest.startCallWaiting(mockCall1); Ringtone mockRingtone = mock(Ringtone.class); when(mockRingtoneFactory.getRingtone(any(Call.class))).thenReturn(mockRingtone); when(mockAudioManager.getRingerModeInternal()).thenReturn(AudioManager.RINGER_MODE_VIBRATE); when(mockAudioManager.getRingerMode()).thenReturn(AudioManager.RINGER_MODE_VIBRATE); when(mockAudioManager.getStreamVolume(AudioManager.STREAM_RING)).thenReturn(0); mFuture.complete(true); // using audio coupled haptics enableVibrationWhenRinging(); Loading @@ -348,7 +348,7 @@ public class RingerTest extends TelecomTestCase { enableVibrationWhenRinging(); Ringtone mockRingtone = mock(Ringtone.class); when(mockRingtoneFactory.getRingtone(nullable(Call.class))).thenReturn(mockRingtone); when(mockAudioManager.getRingerModeInternal()).thenReturn(AudioManager.RINGER_MODE_NORMAL); when(mockAudioManager.getRingerMode()).thenReturn(AudioManager.RINGER_MODE_NORMAL); mRingerUnderTest.startRinging(mockCall1, false); // Make sure we haven't started the vibrator yet, but have started ringing. Loading @@ -372,7 +372,7 @@ public class RingerTest extends TelecomTestCase { public void testCustomVibrationForRingtone() throws Exception { mRingerUnderTest.startCallWaiting(mockCall1); Ringtone mockRingtone = mock(Ringtone.class); when(mockAudioManager.getRingerModeInternal()).thenReturn(AudioManager.RINGER_MODE_NORMAL); when(mockAudioManager.getRingerMode()).thenReturn(AudioManager.RINGER_MODE_NORMAL); when(mockRingtoneFactory.getRingtone(any(Call.class))).thenReturn(mockRingtone); when(mockRingtone.getUri()).thenReturn(FAKE_RINGTONE_URI); mFuture.complete(false); // not using audio coupled haptics Loading Loading @@ -424,7 +424,7 @@ public class RingerTest extends TelecomTestCase { mRingerUnderTest.startCallWaiting(mockCall1); Ringtone mockRingtone = mock(Ringtone.class); when(mockRingtoneFactory.getRingtone(any(Call.class))).thenReturn(mockRingtone); when(mockAudioManager.getRingerModeInternal()).thenReturn(AudioManager.RINGER_MODE_NORMAL); when(mockAudioManager.getRingerMode()).thenReturn(AudioManager.RINGER_MODE_NORMAL); when(mockAudioManager.getStreamVolume(AudioManager.STREAM_RING)).thenReturn(0); mFuture.complete(false); // not using audio coupled haptics enableVibrationOnlyWhenNotRinging(); Loading @@ -442,7 +442,7 @@ public class RingerTest extends TelecomTestCase { public void testSilentRingWithHfpStillAcquiresFocus2() throws Exception { mRingerUnderTest.startCallWaiting(mockCall1); when(mockRingtoneFactory.getRingtone(any(Call.class))).thenReturn(null); when(mockAudioManager.getRingerModeInternal()).thenReturn(AudioManager.RINGER_MODE_NORMAL); when(mockAudioManager.getRingerMode()).thenReturn(AudioManager.RINGER_MODE_NORMAL); when(mockAudioManager.getStreamVolume(AudioManager.STREAM_RING)).thenReturn(0); mFuture.complete(false); // not using audio coupled haptics enableVibrationOnlyWhenNotRinging(); Loading @@ -458,7 +458,7 @@ public class RingerTest extends TelecomTestCase { private void ensureRingerIsAudible() { Ringtone mockRingtone = mock(Ringtone.class); when(mockRingtoneFactory.getRingtone(any(Call.class))).thenReturn(mockRingtone); when(mockAudioManager.getRingerModeInternal()).thenReturn(AudioManager.RINGER_MODE_NORMAL); when(mockAudioManager.getRingerMode()).thenReturn(AudioManager.RINGER_MODE_NORMAL); when(mockAudioManager.getStreamVolume(AudioManager.STREAM_RING)).thenReturn(100); } Loading Loading
res/values/strings.xml +2 −2 Original line number Diff line number Diff line Loading @@ -73,8 +73,8 @@ that a call be put into the background so that the app can access the audio from the call. [CHAR LIMIT=NONE] --> <string name="notification_audioProcessing_body"> <xliff:g id="audio_processing_app_name">%s</xliff:g> has placed a call into the background. This app may be accessing and playing audio over the call. <xliff:g id="audio_processing_app_name">%s</xliff:g> is processing a call in the background. This app may be accessing and playing audio over the call. </string> <!-- Crashed in call service notification label, used when the in call service has crashed and Loading
src/com/android/server/telecom/Ringer.java +3 −1 Original line number Diff line number Diff line Loading @@ -505,9 +505,11 @@ public class Ringer { private boolean isVibratorEnabled(Context context) { AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE); // Use AudioManager#getRingerMode for more accurate result, instead of // AudioManager#getRingerModeInternal which only useful for volume controllers return mVibrator.hasVibrator() && mSystemSettingsUtil.isRingVibrationEnabled(context) && audioManager.getRingerModeInternal() != AudioManager.RINGER_MODE_SILENT; && audioManager.getRingerMode() != AudioManager.RINGER_MODE_SILENT; } private RingerAttributes getRingerAttributes(Call call, boolean isHfpDeviceAttached) { Loading
tests/src/com/android/server/telecom/tests/RingerTest.java +9 −9 Original line number Diff line number Diff line Loading @@ -139,7 +139,7 @@ public class RingerTest extends TelecomTestCase { when(mockPlayerFactory.createPlayer(anyInt())).thenReturn(mockTonePlayer); mockAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE); when(mockAudioManager.getRingerModeInternal()).thenReturn(AudioManager.RINGER_MODE_NORMAL); when(mockAudioManager.getRingerMode()).thenReturn(AudioManager.RINGER_MODE_NORMAL); when(mockSystemSettingsUtil.isHapticPlaybackSupported(any(Context.class))).thenReturn(true); NotificationManager notificationManager = (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE); Loading Loading @@ -286,7 +286,7 @@ public class RingerTest extends TelecomTestCase { public void testVibrateButNoRingForNullRingtone() throws Exception { mRingerUnderTest.startCallWaiting(mockCall1); when(mockRingtoneFactory.getRingtone(any(Call.class))).thenReturn(null); when(mockAudioManager.getRingerModeInternal()).thenReturn(AudioManager.RINGER_MODE_NORMAL); when(mockAudioManager.getRingerMode()).thenReturn(AudioManager.RINGER_MODE_NORMAL); mFuture.complete(false); // not using audio coupled haptics enableVibrationWhenRinging(); assertFalse(mRingerUnderTest.startRinging(mockCall2, false)); Loading @@ -306,7 +306,7 @@ public class RingerTest extends TelecomTestCase { mRingerUnderTest.startCallWaiting(mockCall1); Ringtone mockRingtone = mock(Ringtone.class); when(mockRingtoneFactory.getRingtone(any(Call.class))).thenReturn(mockRingtone); when(mockAudioManager.getRingerModeInternal()).thenReturn(AudioManager.RINGER_MODE_VIBRATE); when(mockAudioManager.getRingerMode()).thenReturn(AudioManager.RINGER_MODE_VIBRATE); when(mockAudioManager.getStreamVolume(AudioManager.STREAM_RING)).thenReturn(0); mFuture.complete(false); // not using audio coupled haptics enableVibrationWhenRinging(); Loading @@ -327,7 +327,7 @@ public class RingerTest extends TelecomTestCase { mRingerUnderTest.startCallWaiting(mockCall1); Ringtone mockRingtone = mock(Ringtone.class); when(mockRingtoneFactory.getRingtone(any(Call.class))).thenReturn(mockRingtone); when(mockAudioManager.getRingerModeInternal()).thenReturn(AudioManager.RINGER_MODE_VIBRATE); when(mockAudioManager.getRingerMode()).thenReturn(AudioManager.RINGER_MODE_VIBRATE); when(mockAudioManager.getStreamVolume(AudioManager.STREAM_RING)).thenReturn(0); mFuture.complete(true); // using audio coupled haptics enableVibrationWhenRinging(); Loading @@ -348,7 +348,7 @@ public class RingerTest extends TelecomTestCase { enableVibrationWhenRinging(); Ringtone mockRingtone = mock(Ringtone.class); when(mockRingtoneFactory.getRingtone(nullable(Call.class))).thenReturn(mockRingtone); when(mockAudioManager.getRingerModeInternal()).thenReturn(AudioManager.RINGER_MODE_NORMAL); when(mockAudioManager.getRingerMode()).thenReturn(AudioManager.RINGER_MODE_NORMAL); mRingerUnderTest.startRinging(mockCall1, false); // Make sure we haven't started the vibrator yet, but have started ringing. Loading @@ -372,7 +372,7 @@ public class RingerTest extends TelecomTestCase { public void testCustomVibrationForRingtone() throws Exception { mRingerUnderTest.startCallWaiting(mockCall1); Ringtone mockRingtone = mock(Ringtone.class); when(mockAudioManager.getRingerModeInternal()).thenReturn(AudioManager.RINGER_MODE_NORMAL); when(mockAudioManager.getRingerMode()).thenReturn(AudioManager.RINGER_MODE_NORMAL); when(mockRingtoneFactory.getRingtone(any(Call.class))).thenReturn(mockRingtone); when(mockRingtone.getUri()).thenReturn(FAKE_RINGTONE_URI); mFuture.complete(false); // not using audio coupled haptics Loading Loading @@ -424,7 +424,7 @@ public class RingerTest extends TelecomTestCase { mRingerUnderTest.startCallWaiting(mockCall1); Ringtone mockRingtone = mock(Ringtone.class); when(mockRingtoneFactory.getRingtone(any(Call.class))).thenReturn(mockRingtone); when(mockAudioManager.getRingerModeInternal()).thenReturn(AudioManager.RINGER_MODE_NORMAL); when(mockAudioManager.getRingerMode()).thenReturn(AudioManager.RINGER_MODE_NORMAL); when(mockAudioManager.getStreamVolume(AudioManager.STREAM_RING)).thenReturn(0); mFuture.complete(false); // not using audio coupled haptics enableVibrationOnlyWhenNotRinging(); Loading @@ -442,7 +442,7 @@ public class RingerTest extends TelecomTestCase { public void testSilentRingWithHfpStillAcquiresFocus2() throws Exception { mRingerUnderTest.startCallWaiting(mockCall1); when(mockRingtoneFactory.getRingtone(any(Call.class))).thenReturn(null); when(mockAudioManager.getRingerModeInternal()).thenReturn(AudioManager.RINGER_MODE_NORMAL); when(mockAudioManager.getRingerMode()).thenReturn(AudioManager.RINGER_MODE_NORMAL); when(mockAudioManager.getStreamVolume(AudioManager.STREAM_RING)).thenReturn(0); mFuture.complete(false); // not using audio coupled haptics enableVibrationOnlyWhenNotRinging(); Loading @@ -458,7 +458,7 @@ public class RingerTest extends TelecomTestCase { private void ensureRingerIsAudible() { Ringtone mockRingtone = mock(Ringtone.class); when(mockRingtoneFactory.getRingtone(any(Call.class))).thenReturn(mockRingtone); when(mockAudioManager.getRingerModeInternal()).thenReturn(AudioManager.RINGER_MODE_NORMAL); when(mockAudioManager.getRingerMode()).thenReturn(AudioManager.RINGER_MODE_NORMAL); when(mockAudioManager.getStreamVolume(AudioManager.STREAM_RING)).thenReturn(100); } Loading