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

Commit d2d63d4c authored by joonhunshin's avatar joonhunshin Committed by Android Build Coastguard Worker
Browse files

Handle device doesn't point to satellite in CONNECTED state

Changed stop timer position for P2P and ESOS inactivity timer continuty when transitioning between CONNECTED and NOTCONNECTED states

Bug: 390722283
Test: atest SatelliteSessionControllerTest
Flag: EXEMPT (bug fix)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:3294867e4a61054ab0be45378fa7584cdf1ada5c)
Merged-In: I87fc9cd186c0bad380ab7c29e4cc12d136355037
Change-Id: I87fc9cd186c0bad380ab7c29e4cc12d136355037
parent 3b65f5c4
Loading
Loading
Loading
Loading
+10 −7
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ import static android.telephony.satellite.SatelliteManager.SATELLITE_DATAGRAM_TR
import static android.telephony.satellite.SatelliteManager.SATELLITE_MODEM_STATE_CONNECTED;
import static android.telephony.satellite.SatelliteManager.SATELLITE_MODEM_STATE_DATAGRAM_TRANSFERRING;
import static android.telephony.satellite.SatelliteManager.SATELLITE_MODEM_STATE_ENABLING_SATELLITE;
import static android.telephony.satellite.SatelliteManager.SATELLITE_MODEM_STATE_IDLE;
import static android.telephony.satellite.SatelliteManager.SATELLITE_MODEM_STATE_LISTENING;
import static android.telephony.satellite.SatelliteManager.SATELLITE_MODEM_STATE_UNKNOWN;
import static android.telephony.satellite.SatelliteManager.SATELLITE_RESULT_REQUEST_ABORTED;
@@ -571,13 +572,16 @@ public class SatelliteSessionController extends StateMachine {
        }

        mIsDeviceAlignedWithSatellite = isAligned;
        plogd("setDeviceAlignedWithSatellite: isAligned " +  isAligned);

        if (mIsDeviceAlignedWithSatellite) {
            stopEsosInactivityTimer();
            stopP2pSmsInactivityTimer();
            endUserInactivity();
        } else {
            if (mCurrentState == SatelliteManager.SATELLITE_MODEM_STATE_NOT_CONNECTED) {
            if (mCurrentState == SatelliteManager.SATELLITE_MODEM_STATE_NOT_CONNECTED
                    || mCurrentState == SATELLITE_MODEM_STATE_CONNECTED
                    || mCurrentState == SATELLITE_MODEM_STATE_IDLE) {
                evaluateStartingEsosInactivityTimer();
                evaluateStartingP2pSmsInactivityTimer();
            }
@@ -705,6 +709,8 @@ public class SatelliteSessionController extends StateMachine {
            mIsSendingTriggeredDuringTransferringState.set(false);
            unbindService();
            stopNbIotInactivityTimer();
            stopEsosInactivityTimer();
            stopNbIotInactivityTimer();
            endUserInactivity();
            DemoSimulator.getInstance().onSatelliteModeOff();
            notifyStateChangedEvent(SatelliteManager.SATELLITE_MODEM_STATE_OFF);
@@ -1060,6 +1066,9 @@ public class SatelliteSessionController extends StateMachine {
        public void enter() {
            if (DBG) plogd("Entering TransferringState");
            stopNbIotInactivityTimer();
            stopEsosInactivityTimer();
            stopNbIotInactivityTimer();

            mPreviousState = mCurrentState;
            mCurrentState = SATELLITE_MODEM_STATE_DATAGRAM_TRANSFERRING;
            notifyStateChangedEvent(SATELLITE_MODEM_STATE_DATAGRAM_TRANSFERRING);
@@ -1219,9 +1228,6 @@ public class SatelliteSessionController extends StateMachine {
        @Override
        public void exit() {
            if (DBG) plogd("Exiting NotConnectedState");

            stopEsosInactivityTimer();
            stopP2pSmsInactivityTimer();
        }

        @Override
@@ -1327,9 +1333,6 @@ public class SatelliteSessionController extends StateMachine {
        @Override
        public void exit() {
            if (DBG) plogd("Exiting ConnectedState");

            stopEsosInactivityTimer();
            stopP2pSmsInactivityTimer();
        }

        @Override
+3 −1
Original line number Diff line number Diff line
@@ -368,9 +368,11 @@ public class SatelliteSessionControllerTest extends TelephonyTest {
        // Verify that the P2P SMS inactivity timer is stopped.
        assertFalse(mTestSatelliteSessionController.isP2pSmsInActivityTimerStarted());

        moveNotConnectedToConnectedState();

        mTestSatelliteSessionController.setDeviceAlignedWithSatellite(false);

        // Verify that the P2P SMS inactivity timer is started.
        // Verify that the P2P SMS inactivity timer is started in CONNECTED state.
        assertTrue(mTestSatelliteSessionController.isP2pSmsInActivityTimerStarted());

        // Time shift to cause timeout