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

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

Merge "Do not re evaluate subscription configurations if satellite is enabled" into 24D1-dev

parents e558eb5a a791dacb
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ import android.util.Log;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.telephony.data.DataSettingsManager.DataSettingsManagerCallback;
import com.android.internal.telephony.flags.FeatureFlags;
import com.android.internal.telephony.satellite.SatelliteController;
import com.android.internal.telephony.subscription.SubscriptionInfoInternal;
import com.android.internal.telephony.subscription.SubscriptionManagerService;
import com.android.internal.telephony.util.ArrayUtils;
@@ -496,11 +497,20 @@ public class MultiSimSettingController extends Handler {
     */
    private boolean isReadyToReevaluate() {
        boolean carrierConfigsLoaded = isCarrierConfigLoadedForAllSub();
        SatelliteController satelliteController = SatelliteController.getInstance();
        boolean isSatelliteEnabledOrBeingEnabled = false;
        if (satelliteController != null) {
            isSatelliteEnabledOrBeingEnabled = satelliteController.isSatelliteEnabled()
                    || satelliteController.isSatelliteBeingEnabled();
        }

        if (DBG) {
            log("isReadyToReevaluate: subInfoInitialized=" + mSubInfoInitialized
                    + ", carrierConfigsLoaded=" + carrierConfigsLoaded);
                    + ", carrierConfigsLoaded=" + carrierConfigsLoaded
                    + ", satelliteEnabledOrBeingEnabled=" + isSatelliteEnabledOrBeingEnabled);
        }
        return mSubInfoInitialized && carrierConfigsLoaded;
        return mSubInfoInitialized && carrierConfigsLoaded
                && !isSatelliteEnabledOrBeingEnabled;
    }

    private void reEvaluateAll() {
+17 −0
Original line number Diff line number Diff line
@@ -1553,6 +1553,23 @@ public class SatelliteController extends Handler {
        return mIsSatelliteEnabled;
    }

    /**
     * Get whether satellite modem is being enabled.
     *
     * @return {@code true} if the satellite modem is being enabled and {@code false} otherwise.
     */
    public boolean isSatelliteBeingEnabled() {
        if (!mFeatureFlags.oemEnabledSatelliteFlag()) {
            logd("isSatelliteBeingEnabled: oemEnabledSatelliteFlag is disabled");
            return false;
        }

        if (mSatelliteSessionController != null) {
            return mSatelliteSessionController.isInEnablingState();
        }
        return false;
    }

    /**
     * Request to get whether the satellite service demo mode is enabled.
     *
+10 −0
Original line number Diff line number Diff line
@@ -398,6 +398,16 @@ public class SatelliteSessionController extends StateMachine {
        mIsDemoMode = isDemoMode;
    }

    /**
     * Get whether state machine is in enabling state.
     *
     * @return {@code true} if state machine is in enabling state and {@code false} otherwise.
     */
    public boolean isInEnablingState() {
        if (DBG) logd("isInEnablingState: getCurrentState=" + getCurrentState());
        return getCurrentState() == mEnablingState;
    }

    private boolean isDemoMode() {
        return mIsDemoMode;
    }
+25 −17
Original line number Diff line number Diff line
@@ -105,6 +105,7 @@ import com.android.internal.telephony.data.PhoneSwitcher;
import com.android.internal.telephony.euicc.EuiccController;
import com.android.internal.telephony.flags.FeatureFlags;
import com.android.internal.telephony.flags.Flags;
import com.android.internal.telephony.satellite.SatelliteController;
import com.android.internal.telephony.subscription.SubscriptionDatabaseManager.SubscriptionDatabaseManagerCallback;
import com.android.internal.telephony.uicc.IccRecords;
import com.android.internal.telephony.uicc.IccUtils;
@@ -1414,12 +1415,18 @@ public class SubscriptionManagerService extends ISub.Stub {
        }

        if (simState == TelephonyManager.SIM_STATE_ABSENT) {
            SatelliteController satelliteController = SatelliteController.getInstance();
            boolean isSatelliteEnabledOrBeingEnabled = false;
            if (satelliteController != null) {
                isSatelliteEnabledOrBeingEnabled = satelliteController.isSatelliteEnabled()
                        || satelliteController.isSatelliteBeingEnabled();
            }

            if (!isSatelliteEnabledOrBeingEnabled) {
                // Re-enable the pSIM when it's removed, so it will be in enabled state when it gets
                // re-inserted again. (pre-U behavior)
                List<String> iccIds = getIccIdsOfInsertedPhysicalSims();
                mSubscriptionDatabaseManager.getAllSubscriptions().stream()
                    // All the removed pSIMs (Note this could include some erased eSIM that has
                    // embedded bit removed).
                        .filter(subInfo -> !iccIds.contains(subInfo.getIccId())
                                && !subInfo.isEmbedded())
                        .forEach(subInfo -> {
@@ -1431,6 +1438,7 @@ public class SubscriptionManagerService extends ISub.Stub {
                            mSubscriptionDatabaseManager.setPortIndex(subId,
                                    TelephonyManager.INVALID_PORT_INDEX);
                        });
            }

            if (mSlotIndexToSubId.containsKey(phoneId)) {
                markSubscriptionsInactive(phoneId);