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

Commit 6d305ac6 authored by Hall Liu's avatar Hall Liu Committed by android-build-merger
Browse files

Fix broken tests am: 25c84253 am: 35b558b0

am: b74299e1

Change-Id: I313ee75c85f9e09f0fc70da26aecf96669e903da
parents bf6393d8 b74299e1
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -327,12 +327,20 @@ public class AnalyticsTests extends TelecomSystemTest {
                mTelecomSystem.getCallsManager().getCallAudioManager()
                        .getCallAudioRouteStateMachine().getHandler(),
                TEST_TIMEOUT);
        waitForHandlerAction(
                mTelecomSystem.getCallsManager().getCallAudioManager()
                        .getCallAudioModeStateMachine().getHandler(),
                TEST_TIMEOUT);
        audioRoutes.add(mInCallServiceFixtureX.mCallAudioState.getRoute());
        mInCallServiceFixtureX.getInCallAdapter().setAudioRoute(CallAudioState.ROUTE_SPEAKER, null);
        waitForHandlerAction(
                mTelecomSystem.getCallsManager().getCallAudioManager()
                        .getCallAudioRouteStateMachine().getHandler(),
                TEST_TIMEOUT);
        waitForHandlerAction(
                mTelecomSystem.getCallsManager().getCallAudioManager()
                        .getCallAudioModeStateMachine().getHandler(),
                TEST_TIMEOUT);
        audioRoutes.add(CallAudioState.ROUTE_SPEAKER);

        Map<String, Analytics.CallInfoImpl> analyticsMap = Analytics.cloneData();
+0 −20
Original line number Diff line number Diff line
@@ -858,26 +858,6 @@ public class BasicCallTests extends TelecomSystemTest {
                .pullExternalCall(eq(ids.mConnectionId), any());
    }

    @LargeTest
    public void testEmergencyCallFailMoveToSecondSim() throws Exception {
        IdPair ids = startAndMakeDialingEmergencyCall("650-555-1212",
                mPhoneAccountE0.getAccountHandle(), mConnectionServiceFixtureA);
        assertEquals(Call.STATE_DIALING, mInCallServiceFixtureX.getCall(ids.mCallId).getState());
        assertEquals(Call.STATE_DIALING, mInCallServiceFixtureY.getCall(ids.mCallId).getState());

        // The Emergency Call has failed on the default SIM with an ERROR Disconnect Cause. Retry
        // with the other SIM PhoneAccount
        IdPair newIds = triggerEmergencyRedial(mPhoneAccountE1.getAccountHandle(),
                mConnectionServiceFixtureA, ids);

        // Call should be active on the E1 PhoneAccount
        mConnectionServiceFixtureA.sendSetActive(newIds.mConnectionId);
        assertEquals(Call.STATE_ACTIVE, mInCallServiceFixtureX.getCall(newIds.mCallId).getState());
        assertEquals(Call.STATE_ACTIVE, mInCallServiceFixtureY.getCall(newIds.mCallId).getState());
        assertEquals(mInCallServiceFixtureX.getCall(ids.mCallId).getAccountHandle(),
                mPhoneAccountE1.getAccountHandle());
    }

    /**
     * Test scenario where the user starts an outgoing video call with no selected PhoneAccount, and
     * then subsequently selects a PhoneAccount which supports video calling.
+19 −20
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.media.AudioAttributes;
import android.media.AudioManager;
import android.media.Ringtone;
import android.os.Bundle;
import android.os.VibrationEffect;
import android.os.Vibrator;
import android.test.suitebuilder.annotation.SmallTest;

@@ -78,8 +79,8 @@ public class RingerTest extends TelecomTestCase {
        assertFalse(mRingerUnderTest.startRinging(mockCall2, false));
        verify(mockTonePlayer, never()).stopTone();
        verify(mockRingtonePlayer, never()).play(any(RingtoneFactory.class), any(Call.class));
        verify(mockVibrator, never()).vibrate(
                any(long[].class), anyInt(), any(AudioAttributes.class));
        verify(mockVibrator, never())
                .vibrate(any(VibrationEffect.class), any(AudioAttributes.class));
    }

    @SmallTest
@@ -90,8 +91,8 @@ public class RingerTest extends TelecomTestCase {
        assertFalse(mRingerUnderTest.startRinging(mockCall2, false));
        verify(mockTonePlayer, never()).stopTone();
        verify(mockRingtonePlayer, never()).play(any(RingtoneFactory.class), any(Call.class));
        verify(mockVibrator, never()).vibrate(
                any(long[].class), anyInt(), any(AudioAttributes.class));
        verify(mockVibrator, never())
                .vibrate(any(VibrationEffect.class), any(AudioAttributes.class));
    }

    @SmallTest
@@ -103,8 +104,8 @@ public class RingerTest extends TelecomTestCase {
        assertTrue(mRingerUnderTest.startRinging(mockCall2, false));
        verify(mockTonePlayer, never()).stopTone();
        verify(mockRingtonePlayer, never()).play(any(RingtoneFactory.class), any(Call.class));
        verify(mockVibrator, never()).vibrate(
                any(long[].class), anyInt(), any(AudioAttributes.class));
        verify(mockVibrator, never())
                .vibrate(any(VibrationEffect.class), any(AudioAttributes.class));
    }

    @SmallTest
@@ -116,8 +117,8 @@ public class RingerTest extends TelecomTestCase {
        assertTrue(mRingerUnderTest.startRinging(mockCall2, true));
        verify(mockTonePlayer, never()).stopTone();
        verify(mockRingtonePlayer, never()).play(any(RingtoneFactory.class), any(Call.class));
        verify(mockVibrator, never()).vibrate(
                any(long[].class), anyInt(), any(AudioAttributes.class));
        verify(mockVibrator, never())
                .vibrate(any(VibrationEffect.class), any(AudioAttributes.class));
    }

    @SmallTest
@@ -132,8 +133,8 @@ public class RingerTest extends TelecomTestCase {
        assertFalse(mRingerUnderTest.startRinging(mockCall2, false));
        verify(mockTonePlayer).stopTone();
        verify(mockRingtonePlayer, never()).play(any(RingtoneFactory.class), any(Call.class));
        verify(mockVibrator, never()).vibrate(
                any(long[].class), anyInt(), any(AudioAttributes.class));
        verify(mockVibrator, never())
                .vibrate(any(VibrationEffect.class), any(AudioAttributes.class));
    }

    @SmallTest
@@ -145,8 +146,7 @@ public class RingerTest extends TelecomTestCase {
        assertFalse(mRingerUnderTest.startRinging(mockCall2, false));
        verify(mockTonePlayer).stopTone();
        verify(mockRingtonePlayer, never()).play(any(RingtoneFactory.class), any(Call.class));
        verify(mockVibrator).vibrate(
                any(long[].class), anyInt(), any(AudioAttributes.class));
        verify(mockVibrator).vibrate(any(VibrationEffect.class), any(AudioAttributes.class));
    }

    @SmallTest
@@ -160,8 +160,7 @@ public class RingerTest extends TelecomTestCase {
        assertFalse(mRingerUnderTest.startRinging(mockCall2, false));
        verify(mockTonePlayer).stopTone();
        verify(mockRingtonePlayer, never()).play(any(RingtoneFactory.class), any(Call.class));
        verify(mockVibrator).vibrate(
                any(long[].class), anyInt(), any(AudioAttributes.class));
        verify(mockVibrator).vibrate(any(VibrationEffect.class), any(AudioAttributes.class));
    }

    @SmallTest
@@ -172,8 +171,8 @@ public class RingerTest extends TelecomTestCase {
        assertTrue(mRingerUnderTest.startRinging(mockCall2, false));
        verify(mockTonePlayer).stopTone();
        verify(mockRingtonePlayer).play(any(RingtoneFactory.class), any(Call.class));
        verify(mockVibrator, never()).vibrate(
                any(long[].class), anyInt(), any(AudioAttributes.class));
        verify(mockVibrator, never())
                .vibrate(any(VibrationEffect.class), any(AudioAttributes.class));
    }

    @SmallTest
@@ -187,8 +186,8 @@ public class RingerTest extends TelecomTestCase {
        assertTrue(mRingerUnderTest.startRinging(mockCall2, true));
        verify(mockTonePlayer).stopTone();
        verify(mockRingtonePlayer, never()).play(any(RingtoneFactory.class), any(Call.class));
        verify(mockVibrator, never()).vibrate(
                any(long[].class), anyInt(), any(AudioAttributes.class));
        verify(mockVibrator, never())
                .vibrate(any(VibrationEffect.class), any(AudioAttributes.class));
    }

    @SmallTest
@@ -201,8 +200,8 @@ public class RingerTest extends TelecomTestCase {
        assertTrue(mRingerUnderTest.startRinging(mockCall2, true));
        verify(mockTonePlayer).stopTone();
        verify(mockRingtonePlayer, never()).play(any(RingtoneFactory.class), any(Call.class));
        verify(mockVibrator, never()).vibrate(
                any(long[].class), anyInt(), any(AudioAttributes.class));
        verify(mockVibrator, never())
                .vibrate(any(VibrationEffect.class), any(AudioAttributes.class));
    }

    private void ensureRingerIsAudible() {
+6 −1
Original line number Diff line number Diff line
@@ -578,8 +578,13 @@ public class TelecomSystemTest extends TelecomTestCase {
        int startingNumConnections = connectionServiceFixture.mConnectionById.size();
        int startingNumCalls = mInCallServiceFixtureX.mCallById.size();

        startOutgoingPhoneCallPendingCreateConnection(number, phoneAccountHandle,
        String callId = startOutgoingPhoneCallPendingCreateConnection(number, phoneAccountHandle,
                connectionServiceFixture, initiatingUser, videoState);
        // Set the phone account if there is one specified
        if (phoneAccountHandle != null) {
            mInCallServiceFixtureX.getInCallAdapter().phoneAccountSelected(
                    callId, phoneAccountHandle, false);
        }

        return outgoingCallCreateConnectionComplete(startingNumConnections, startingNumCalls,
                phoneAccountHandle, connectionServiceFixture);