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

Commit 59c156c9 authored by Aishwarya Mallampati's avatar Aishwarya Mallampati Committed by Android (Google) Code Review
Browse files

Merge "Renamed onDeviceAlignedWithSatellite to setDeviceAlignedWithSatellite" into main

parents b89cd7d0 26e5a8a4
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
@@ -722,7 +722,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
@@ -1811,8 +1811,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