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

Commit 26e5a8a4 authored by Aishwarya Mallamapti's avatar Aishwarya Mallamapti Committed by Aishwarya Mallampati
Browse files

Renamed onDeviceAlignedWithSatellite to setDeviceAlignedWithSatellite

Bug: 293095418
Test: atest android.telephony.satellite.cts.SatelliteManagerTestOnMockService --rerun-until-failure 100

Change-Id: Ib822e03ee7162ccc2399881d473a1e80efd45011
parent 2f1b3d12
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -271,9 +271,9 @@ public class DatagramController {
        mDatagramReceiver.onSatelliteModemStateChanged(state);
    }

    void onDeviceAlignedWithSatellite(boolean isAligned) {
        mDatagramDispatcher.onDeviceAlignedWithSatellite(isAligned);
        mDatagramReceiver.onDeviceAlignedWithSatellite(isAligned);
    void setDeviceAlignedWithSatellite(boolean isAligned) {
        mDatagramDispatcher.setDeviceAlignedWithSatellite(isAligned);
        mDatagramReceiver.setDeviceAlignedWithSatellite(isAligned);
    }

    @VisibleForTesting
+1 −1
Original line number Diff line number Diff line
@@ -378,7 +378,7 @@ public class DatagramDispatcher extends Handler {
    }

    @VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE)
    protected void onDeviceAlignedWithSatellite(boolean isAligned) {
    protected void setDeviceAlignedWithSatellite(boolean isAligned) {
        if (mIsDemoMode) {
            synchronized (mLock) {
                mIsAligned = isAligned;
+1 −1
Original line number Diff line number Diff line
@@ -728,7 +728,7 @@ public class DatagramReceiver extends Handler {
    }

    @VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE)
    protected void onDeviceAlignedWithSatellite(boolean isAligned) {
    protected void setDeviceAlignedWithSatellite(boolean isAligned) {
        if (mIsDemoMode) {
            synchronized (mLock) {
                mIsAligned = isAligned;
+2 −2
Original line number Diff line number Diff line
@@ -1820,8 +1820,8 @@ public class SatelliteController extends Handler {
     * @param subId The subId of the subscription.
     * @param isAligned {@true} means device is aligned with the satellite, otherwise {@false}.
     */
    public void onDeviceAlignedWithSatellite(@NonNull int subId, @NonNull boolean isAligned) {
        mDatagramController.onDeviceAlignedWithSatellite(isAligned);
    public void setDeviceAlignedWithSatellite(@NonNull int subId, @NonNull boolean isAligned) {
        mDatagramController.setDeviceAlignedWithSatellite(isAligned);
    }

    /**
+7 −7
Original line number Diff line number Diff line
@@ -299,7 +299,7 @@ public class DatagramDispatcherTest extends TelephonyTest {
    @Test
    public void testSendSatelliteDatagram_DemoMode_Align_Success() throws Exception {
        mTestDemoModeDatagramDispatcher.setDemoMode(true);
        mTestDemoModeDatagramDispatcher.onDeviceAlignedWithSatellite(true);
        mTestDemoModeDatagramDispatcher.setDeviceAlignedWithSatellite(true);
        doReturn(false).when(mMockSatelliteModemInterface).isSatelliteServiceSupported();
        replaceInstance(PhoneFactory.class, "sPhones", null, new Phone[] {mPhone});
        doAnswer(invocation -> {
@@ -331,7 +331,7 @@ public class DatagramDispatcherTest extends TelephonyTest {
                        eq(SatelliteManager.SATELLITE_ERROR_NONE));
        assertThat(mResultListener.peek()).isEqualTo(SatelliteManager.SATELLITE_ERROR_NONE);
        mTestDemoModeDatagramDispatcher.setDemoMode(false);
        mTestDemoModeDatagramDispatcher.onDeviceAlignedWithSatellite(false);
        mTestDemoModeDatagramDispatcher.setDeviceAlignedWithSatellite(false);
    }

    @Test
@@ -339,7 +339,7 @@ public class DatagramDispatcherTest extends TelephonyTest {
        long previousTimer = mTestDemoModeDatagramDispatcher.getSatelliteAlignedTimeoutDuration();
        mTestDemoModeDatagramDispatcher.setDemoMode(true);
        mTestDemoModeDatagramDispatcher.setDuration(TEST_EXPIRE_TIMER_SATELLITE_ALIGN);
        mTestDemoModeDatagramDispatcher.onDeviceAlignedWithSatellite(false);
        mTestDemoModeDatagramDispatcher.setDeviceAlignedWithSatellite(false);

        doReturn(false).when(mMockSatelliteModemInterface).isSatelliteServiceSupported();
        replaceInstance(PhoneFactory.class, "sPhones", null, new Phone[] {mPhone});
@@ -371,7 +371,7 @@ public class DatagramDispatcherTest extends TelephonyTest {
                        eq(SatelliteManager.SATELLITE_ERROR_NONE));
        assertThat(mResultListener.peek()).isEqualTo(SatelliteManager.SATELLITE_NOT_REACHABLE);
        mTestDemoModeDatagramDispatcher.setDemoMode(false);
        mTestDemoModeDatagramDispatcher.onDeviceAlignedWithSatellite(false);
        mTestDemoModeDatagramDispatcher.setDeviceAlignedWithSatellite(false);
        mTestDemoModeDatagramDispatcher.setDuration(previousTimer);
    }

@@ -413,7 +413,7 @@ public class DatagramDispatcherTest extends TelephonyTest {
                        eq(SatelliteManager.SATELLITE_ERROR_NONE));

        mTestDemoModeDatagramDispatcher.setDemoMode(false);
        mTestDemoModeDatagramDispatcher.onDeviceAlignedWithSatellite(false);
        mTestDemoModeDatagramDispatcher.setDeviceAlignedWithSatellite(false);
    }

    @Test
@@ -483,8 +483,8 @@ public class DatagramDispatcherTest extends TelephonyTest {
        }

        @Override
        protected  void onDeviceAlignedWithSatellite(boolean isAligned) {
            super.onDeviceAlignedWithSatellite(isAligned);
        protected  void setDeviceAlignedWithSatellite(boolean isAligned) {
            super.setDeviceAlignedWithSatellite(isAligned);
        }

        @Override
Loading