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

Commit 15e067f6 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Do not re evaluate subscription configurations if satellite is enabled"...

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

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/27188235



Change-Id: I7d34ad7164c948aa224451d9d5af511adca3388f
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents fffb01d2 149aa0b7
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -56,6 +56,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;
@@ -506,11 +507,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;
@@ -1423,12 +1424,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 -> {
@@ -1440,6 +1447,7 @@ public class SubscriptionManagerService extends ISub.Stub {
                            mSubscriptionDatabaseManager.setPortIndex(subId,
                                    TelephonyManager.INVALID_PORT_INDEX);
                        });
            }

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