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

Commit f2950bea authored by SongFerng Wang's avatar SongFerng Wang Committed by Automerger Merge Worker
Browse files

Merge changes from topic "allowedNetworkSubIdChecking" am: 97083863

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

Change-Id: Iaf850cdb821db2c495559eb7e20f8e9dd8234aee
parents 7b8ca397 97083863
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -2900,8 +2900,6 @@ public class GsmCdmaPhone extends Phone {
                break;

            case EVENT_CARRIER_CONFIG_CHANGED:
                // Obtain new radio capabilities from the modem, since some are SIM-dependent
                mCi.getRadioCapability(obtainMessage(EVENT_GET_RADIO_CAPABILITY));
                // Only check for the voice radio tech if it not going to be updated by the voice
                // registration changes.
                if (!mContext.getResources().getBoolean(
@@ -2920,7 +2918,8 @@ public class GsmCdmaPhone extends Phone {

                updateNrSettingsAfterCarrierConfigChanged(b);
                loadAllowedNetworksFromSubscriptionDatabase();
                updateAllowedNetworkTypes(null);
                // Obtain new radio capabilities from the modem, since some are SIM-dependent
                mCi.getRadioCapability(obtainMessage(EVENT_GET_RADIO_CAPABILITY));
                break;

            case EVENT_SET_ROAMING_PREFERENCE_DONE:
+10 −4
Original line number Diff line number Diff line
@@ -451,7 +451,7 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
    private static final String ALLOWED_NETWORK_TYPES_TEXT_ENABLE_2G = "enable_2g";
    private static final int INVALID_ALLOWED_NETWORK_TYPES = -1;
    protected boolean mIsCarrierNrSupported = false;

    protected boolean mIsAllowedNetworkTypesLoadedFromDb = false;
    private boolean mUnitTestMode;

    protected VoiceCallSessionStats mVoiceCallSessionStats;
@@ -2304,6 +2304,7 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
     * Loads the allowed network type from subscription database.
     */
    public void loadAllowedNetworksFromSubscriptionDatabase() {
        mIsAllowedNetworkTypesLoadedFromDb = false;
        // Try to load ALLOWED_NETWORK_TYPES from SIMINFO.
        if (SubscriptionController.getInstance() == null) {
            return;
@@ -2343,6 +2344,7 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
                    }
                }
            }
            mIsAllowedNetworkTypesLoadedFromDb = true;
        } catch (NumberFormatException e) {
            Rlog.e(LOG_TAG, "allowedNetworkTypes NumberFormat exception" + e);
        }
@@ -2415,8 +2417,10 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
            loge("setAllowedNetworkTypes: Invalid allowed network type reason: " + reason);
            return;
        }
        if (!SubscriptionManager.isUsableSubscriptionId(subId)) {
            loge("setAllowedNetworkTypes: Invalid subscriptionId: " + subId);
        if (!SubscriptionManager.isUsableSubscriptionId(subId)
                || !mIsAllowedNetworkTypesLoadedFromDb) {
            loge("setAllowedNetworkTypes: no sim or network type is not loaded. SubscriptionId: "
                    + subId + ", isNetworkTypeLoaded" + mIsAllowedNetworkTypesLoadedFromDb);
            return;
        }
        String mapAsString = "";
@@ -4354,7 +4358,9 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {

    public void sendSubscriptionSettings(boolean restoreNetworkSelection) {
        // Send settings down
        if (mIsAllowedNetworkTypesLoadedFromDb) {
            updateAllowedNetworkTypes(null);
        }

        if (restoreNetworkSelection) {
            restoreSavedNetworkSelection(null);