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

Commit 9080a5ce authored by Aishwarya Mallampati's avatar Aishwarya Mallampati Committed by Android Build Coastguard Worker
Browse files

Update carrier roaming available services after selecting satellite

subscription.

Bug: 393938481
Test: <to-do>
Flag: EXEMPT bugfix
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:7b0828e6865b0138960a5b5c5c2ff3d47a72454b)
Merged-In: Ibe6d50a1768515bc70d8795d148270bf4ae55fb7
Change-Id: Ibe6d50a1768515bc70d8795d148270bf4ae55fb7
parent 5ff07aa6
Loading
Loading
Loading
Loading
+21 −1
Original line number Diff line number Diff line
@@ -7398,6 +7398,7 @@ public class SatelliteController extends Handler {

    public int getSelectedSatelliteSubId() {
        synchronized (mSatelliteTokenProvisionedLock) {
            plogd("getSelectedSatelliteSubId: subId=" + mSelectedSatelliteSubId);
            return mSelectedSatelliteSubId;
        }
    }
@@ -7477,6 +7478,7 @@ public class SatelliteController extends Handler {
        }
        plogd("selectBindingSatelliteSubscription: SelectedSatelliteSubId=" + selectedSubId);
        handleEventSelectedNbIotSatelliteSubscriptionChanged(selectedSubId);
        handleCarrierRoamingNtnAvailableServicesChanged();
    }

    @VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE)
@@ -7699,7 +7701,7 @@ public class SatelliteController extends Handler {
            return;
        }
        persistNtnSmsSupportedByMessagesApp(ntnSmsSupported);
        handleCarrierRoamingNtnAvailableServicesChanged(getSelectedSatelliteSubId());
        handleCarrierRoamingNtnAvailableServicesChanged();
    }

    private void persistNtnSmsSupportedByMessagesApp(boolean ntnSmsSupported) {
@@ -7753,6 +7755,7 @@ public class SatelliteController extends Handler {
    @VisibleForTesting(visibility = VisibleForTesting.Visibility.PRIVATE)
    protected void setSelectedSatelliteSubId(int subId) {
        synchronized (mSatelliteTokenProvisionedLock) {
            plogd("setSelectedSatelliteSubId: subId=" + subId);
            mSelectedSatelliteSubId = subId;
        }
    }
@@ -7925,7 +7928,9 @@ public class SatelliteController extends Handler {
                    synchronized (mSatelliteAccessConfigLock) {
                        mSatelliteAccessAllowed = isAllowed;
                    }
                    evaluateESOSProfilesPrioritization();
                    evaluateCarrierRoamingNtnEligibilityChange();
                    handleCarrierRoamingNtnAvailableServicesChanged();
                }

                @Override
@@ -8233,8 +8238,23 @@ public class SatelliteController extends Handler {
                        .build();
    }

    private void handleCarrierRoamingNtnAvailableServicesChanged() {
        int[] activeSubIds = mSubscriptionManagerService.getActiveSubIdList(true);
        if (activeSubIds == null) {
            plogd("handleCarrierRoamingNtnAvailableServicesChanged: activeSubIds is null.");
            return;
        }

        plogd("handleCarrierRoamingNtnAvailableServicesChanged: activeSubIds size="
                + activeSubIds.length);
        for (int subId: activeSubIds) {
            handleCarrierRoamingNtnAvailableServicesChanged(subId);
        }
    }

    @VisibleForTesting(visibility = VisibleForTesting.Visibility.PRIVATE)
    protected void handleCarrierRoamingNtnAvailableServicesChanged(int subId) {
        plogd("handleCarrierRoamingNtnAvailableServicesChanged: subId=" + subId);
        if (!mFeatureFlags.carrierRoamingNbIotNtn()) {
            plogd("handleCarrierRoamingNtnAvailableServicesChanged: "
                    + "carrierRoamingNbIotNtn flag is disabled");