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

Commit 2446ade3 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6370344 from 974833da to rvc-release

Change-Id: Iec7e05e9a5e8dcccfd6078493fc09c2afc8e814a
parents 160824a2 974833da
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -2139,6 +2139,21 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
        int modemRaf = getRadioAccessFamily();
        int rafFromType = RadioAccessFamily.getRafFromNetworkType(networkType);

        long allowedNetworkTypes = -1;
        if (SubscriptionController.getInstance() != null) {
            String result = SubscriptionController.getInstance().getSubscriptionProperty(
                    getSubId(),
                    SubscriptionManager.ALLOWED_NETWORK_TYPES);

            if (result != null) {
                try {
                    allowedNetworkTypes = Long.parseLong(result);
                } catch (NumberFormatException err) {
                    Rlog.d(LOG_TAG, "allowedNetworkTypes NumberFormat exception");
                }
            }
        }

        if (modemRaf == RadioAccessFamily.RAF_UNKNOWN
                || rafFromType == RadioAccessFamily.RAF_UNKNOWN) {
            Rlog.d(LOG_TAG, "setPreferredNetworkType: Abort, unknown RAF: "
@@ -2153,12 +2168,13 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
            return;
        }

        int filteredRaf = (rafFromType & modemRaf);
        int filteredRaf = (int) (rafFromType & modemRaf & allowedNetworkTypes);
        int filteredType = RadioAccessFamily.getNetworkTypeFromRaf(filteredRaf);

        Rlog.d(LOG_TAG, "setPreferredNetworkType: networkType = " + networkType
                + " modemRaf = " + modemRaf
                + " rafFromType = " + rafFromType
                + " allowedNetworkTypes = " + allowedNetworkTypes
                + " filteredType = " + filteredType);

        mCi.setPreferredNetworkType(filteredType, response);
+0 −13
Original line number Diff line number Diff line
@@ -44,7 +44,6 @@ import android.service.euicc.EuiccProfileInfo;
import android.service.euicc.EuiccService;
import android.service.euicc.GetEuiccProfileInfoListResult;
import android.telephony.CarrierConfigManager;
import android.telephony.RadioAccessFamily;
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
@@ -536,18 +535,6 @@ public class SubscriptionInfoUpdater extends Handler {
                    }

                    // Set the modem network mode
                    long allowedNetworkTypes = -1;
                    try {
                        allowedNetworkTypes = Long.parseLong(
                                SubscriptionController.getInstance().getSubscriptionProperty(subId,
                                        SubscriptionManager.ALLOWED_NETWORK_TYPES));
                    } catch (NumberFormatException err) {
                        logd("NumberFormat exception");
                    }

                    long networkTypeBitMask = RadioAccessFamily.getRafFromNetworkType(networkType);
                    networkType = RadioAccessFamily.getNetworkTypeFromRaf(
                            (int) (networkTypeBitMask & allowedNetworkTypes));
                    PhoneFactory.getPhone(phoneId).setPreferredNetworkType(networkType, null);

                    // Only support automatic selection mode on SIM change.
+9 −2
Original line number Diff line number Diff line
@@ -2081,8 +2081,15 @@ public class ImsPhone extends ImsPhoneBase {
        if (mCT.getState() == PhoneConstants.State.IDLE) {
            if (DBG) logd("updateRoamingState now: " + newRoamingState);
            mRoaming = newRoamingState;
            CarrierConfigManager configManager = (CarrierConfigManager)
                    getContext().getSystemService(Context.CARRIER_CONFIG_SERVICE);
            // Don't set wfc mode if carrierconfig has not loaded. It will be set by GsmCdmaPhone
            // when receives ACTION_CARRIER_CONFIG_CHANGED broadcast.
            if (configManager != null && CarrierConfigManager.isConfigForIdentifiedCarrier(
                    configManager.getConfigForSubId(getSubId()))) {
                ImsManager imsManager = ImsManager.getInstance(mContext, mPhoneId);
                imsManager.setWfcMode(imsManager.getWfcMode(newRoamingState), newRoamingState);
            }
        } else {
            if (DBG) logd("updateRoamingState postponed: " + newRoamingState);
            mCT.registerForVoiceCallEnded(this, EVENT_VOICE_CALL_ENDED, null);
+5 −2
Original line number Diff line number Diff line
@@ -114,6 +114,7 @@ public class ImsPhoneTest extends TelephonyTest {
    };

    private ImsPhone mImsPhoneUT;
    private PersistableBundle mBundle;
    private boolean mDoesRilSendMultipleCallRing;
    private static final int EVENT_SUPP_SERVICE_NOTIFICATION = 1;
    private static final int EVENT_SUPP_SERVICE_FAILED = 2;
@@ -155,6 +156,9 @@ public class ImsPhoneTest extends TelephonyTest {
            return null;
        }).when(mPhone).setIsInEcm(anyBoolean());
        doAnswer(invocation -> mIsPhoneUtInEcm).when(mPhone).isInEcm();

        mBundle = mContextFixture.getCarrierConfigBundle();
        mBundle.putBoolean(CarrierConfigManager.KEY_CARRIER_CONFIG_APPLIED_BOOL, true);
        processAllMessages();
    }

@@ -603,8 +607,7 @@ public class ImsPhoneTest extends TelephonyTest {
    @SmallTest
    public void testProcessDisconnectReason() throws Exception {
        // set up CarrierConfig
        PersistableBundle bundle = mContextFixture.getCarrierConfigBundle();
        bundle.putStringArray(CarrierConfigManager.KEY_WFC_OPERATOR_ERROR_CODES_STRING_ARRAY,
        mBundle.putStringArray(CarrierConfigManager.KEY_WFC_OPERATOR_ERROR_CODES_STRING_ARRAY,
                new String[]{"REG09|0"});
        doReturn(true).when(mImsManager).isWfcEnabledByUser();