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

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

Snap for 11881322 from 8325c21f to 24Q3-release

Change-Id: Ib5944cf83cc4d81b3d1c9cde08d58e2ee18ef736
parents cbc1d6a5 8325c21f
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -220,7 +220,8 @@ public class SatelliteController extends Handler {
    @NonNull private static SatelliteController sInstance;
    @NonNull private final Context mContext;
    @NonNull private final SatelliteModemInterface mSatelliteModemInterface;
    @NonNull private SatelliteSessionController mSatelliteSessionController;
    @VisibleForTesting(visibility = VisibleForTesting.Visibility.PRIVATE)
    @NonNull protected SatelliteSessionController mSatelliteSessionController;
    @NonNull private final PointingAppController mPointingAppController;
    @NonNull private final DatagramController mDatagramController;
    @NonNull private final ControllerMetricsStats mControllerMetricsStats;
@@ -3251,6 +3252,9 @@ public class SatelliteController extends Handler {
        }
        mSatelliteSessionController = SatelliteSessionController.make(
                mContext, getLooper(), supported);
        logd("create a new SatelliteSessionController due to isSatelliteSupported state has "
                + "changed to " + supported);

        if (supported) {
            registerForSatelliteProvisionStateChanged();
            registerForPendingDatagramCount();
@@ -3512,6 +3516,10 @@ public class SatelliteController extends Handler {
                }
            }
            mIsSatelliteSupported = supported;
            mSatelliteSessionController = SatelliteSessionController.make(
                    mContext, getLooper(), supported);
            logd("create a new SatelliteSessionController due to isSatelliteSupported state has "
                    + "changed to " + supported);
        }

        List<ISatelliteSupportedStateCallback> deadCallersList = new ArrayList<>();
+1 −8
Original line number Diff line number Diff line
@@ -39,7 +39,6 @@ import android.os.Looper;
import android.os.Message;
import android.os.RemoteException;
import android.os.SystemProperties;
import android.telephony.Rlog;
import android.telephony.satellite.ISatelliteModemStateCallback;
import android.telephony.satellite.SatelliteManager;
import android.telephony.satellite.stub.ISatelliteGateway;
@@ -163,15 +162,9 @@ public class SatelliteSessionController extends StateMachine {
     */
    public static SatelliteSessionController make(
            @NonNull Context context, @NonNull Looper looper, boolean isSatelliteSupported) {
        if (sInstance == null) {
        if (sInstance == null || isSatelliteSupported != sInstance.mIsSatelliteSupported) {
            sInstance = new SatelliteSessionController(context, looper, isSatelliteSupported,
                    SatelliteModemInterface.getInstance());
        } else {
            if (isSatelliteSupported != sInstance.mIsSatelliteSupported) {
                Rlog.e(TAG, "New satellite support state " + isSatelliteSupported
                        + " is different from existing state " + sInstance.mIsSatelliteSupported
                        + ". Ignore the new state.");
            }
        }
        return sInstance;
    }
+10 −6
Original line number Diff line number Diff line
@@ -1452,6 +1452,11 @@ public class SubscriptionManagerService extends ISub.Stub {
            if (mSlotIndexToSubId.containsKey(phoneId)) {
                markSubscriptionsInactive(phoneId);
            }

            if (Flags.clearCachedImsPhoneNumberWhenDeviceLostImsRegistration()) {
                // Clear the cached Ims phone number
                setNumberFromIms(getSubId(phoneId), new String(""));
            }
        } else if (simState == TelephonyManager.SIM_STATE_NOT_READY) {
            // Check if this is the final state. Only update the subscription if NOT_READY is a
            // final state.
@@ -1464,6 +1469,11 @@ public class SubscriptionManagerService extends ISub.Stub {
            } else {
                logl("updateSubscription: UICC app disabled on slot " + phoneId);
                markSubscriptionsInactive(phoneId);

                if (Flags.clearCachedImsPhoneNumberWhenDeviceLostImsRegistration()) {
                    // Clear the cached Ims phone number
                    setNumberFromIms(getSubId(phoneId), new String(""));
                }
            }
        } else {
            String iccId = getIccId(phoneId);
@@ -1572,12 +1582,6 @@ public class SubscriptionManagerService extends ISub.Stub {
                        loge("updateSubscription: ICC card is not available.");
                    }

                    if (Flags.clearCachedImsPhoneNumberWhenDeviceLostImsRegistration()) {
                        // Clear the cached Ims phone number
                        // before proceeding with Ims Registration
                        setNumberFromIms(subId, new String(""));
                    }

                    // Attempt to restore SIM specific settings when SIM is loaded.
                    Bundle result = mContext.getContentResolver().call(
                            SubscriptionManager.SIM_INFO_BACKUP_AND_RESTORE_CONTENT_URI,
+10 −1
Original line number Diff line number Diff line
@@ -202,6 +202,7 @@ public class SatelliteControllerTest extends TelephonyTest {
    @Mock private TelephonyConfigUpdateInstallReceiver mMockTelephonyConfigUpdateInstallReceiver;
    @Mock private SatelliteConfigParser mMockConfigParser;
    @Mock private SatelliteConfig mMockConfig;
    @Mock private DemoSimulator mMockDemoSimulator;

    private Semaphore mIIntegerConsumerSemaphore = new Semaphore(0);
    private IIntegerConsumer mIIntegerConsumer = new IIntegerConsumer.Stub() {
@@ -475,6 +476,7 @@ public class SatelliteControllerTest extends TelephonyTest {
        replaceInstance(PhoneFactory.class, "sPhones", null, new Phone[]{mPhone, mPhone2});
        replaceInstance(TelephonyConfigUpdateInstallReceiver.class, "sReceiverAdaptorInstance",
                null, mMockTelephonyConfigUpdateInstallReceiver);
        replaceInstance(DemoSimulator.class, "sInstance", null, mMockDemoSimulator);

        mServiceState2 = Mockito.mock(ServiceState.class);
        when(mPhone.getServiceState()).thenReturn(mServiceState);
@@ -785,6 +787,7 @@ public class SatelliteControllerTest extends TelephonyTest {
        setUpResponseForRequestSatelliteEnabled(true, false, false, SATELLITE_RESULT_SUCCESS);
        mSatelliteControllerUT.requestSatelliteEnabled(SUB_ID, true, false, false,
                mIIntegerConsumer);
        mSatelliteControllerUT.setSatelliteSessionController(mMockSatelliteSessionController);
        processAllMessages();
        assertTrue(waitForIIntegerConsumerResult(1));
        assertEquals(SATELLITE_RESULT_SUCCESS, (long) mIIntegerConsumerResults.get(0));
@@ -1304,6 +1307,7 @@ public class SatelliteControllerTest extends TelephonyTest {
                .registerForSatelliteModemStateChanged(callback);

        resetSatelliteControllerUTToSupportedAndProvisionedState();
        mSatelliteControllerUT.setSatelliteSessionController(mMockSatelliteSessionController);

        errorCode = mSatelliteControllerUT.registerForSatelliteModemStateChanged(
                SUB_ID, callback);
@@ -1324,7 +1328,7 @@ public class SatelliteControllerTest extends TelephonyTest {
                .unregisterForSatelliteModemStateChanged(callback);

        resetSatelliteControllerUTToSupportedAndProvisionedState();

        mSatelliteControllerUT.setSatelliteSessionController(mMockSatelliteSessionController);
        mSatelliteControllerUT.unregisterForModemStateChanged(SUB_ID, callback);
        verify(mMockSatelliteSessionController).unregisterForSatelliteModemStateChanged(callback);
    }
@@ -2250,6 +2254,7 @@ public class SatelliteControllerTest extends TelephonyTest {
                SATELLITE_MODEM_STATE_CONNECTED);

        resetSatelliteControllerUTToSupportedAndProvisionedState();
        mSatelliteControllerUT.setSatelliteSessionController(mMockSatelliteSessionController);
        clearInvocations(mMockSatelliteSessionController);
        clearInvocations(mMockDatagramController);
        sendSatelliteModemStateChangedEvent(SATELLITE_MODEM_STATE_UNAVAILABLE, null);
@@ -4502,5 +4507,9 @@ public class SatelliteControllerTest extends TelephonyTest {
        protected long getElapsedRealtime() {
            return elapsedRealtime;
        }

        void setSatelliteSessionController(SatelliteSessionController satelliteSessionController) {
            mSatelliteSessionController = satelliteSessionController;
        }
    }
}