Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7894ad42 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8969739 from 0ba1834c to tm-qpr1-release

Change-Id: I9ffb89645ad9ad8668bf8fd6914acf1330697737
parents b703d9e8 0ba1834c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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
+3 −1
Original line number Diff line number Diff line
@@ -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) {
+9 −9
Original line number Diff line number Diff line
@@ -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);
@@ -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));
@@ -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();
@@ -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();
@@ -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.
@@ -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
@@ -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();
@@ -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();
@@ -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);
    }