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

Commit 20241713 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Update carrier roaming available services after selecting satellite subscription." into main

parents 222dcd43 c9843e2b
Loading
Loading
Loading
Loading
+21 −1
Original line number Diff line number Diff line
@@ -7521,6 +7521,7 @@ public class SatelliteController extends Handler {

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

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

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

                @Override
@@ -8383,8 +8388,23 @@ public class SatelliteController extends Handler {
        }
    }

    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");