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

Commit 065bee8d authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 7863714 from f2fea99f to sc-v2-release

Change-Id: Idd0e6fd7271e38f32687c6676667073d040af85d
parents e5fc4f79 f2fea99f
Loading
Loading
Loading
Loading
+37 −0
Original line number Original line Diff line number Diff line
@@ -2955,6 +2955,7 @@ public class GsmCdmaPhone extends Phone {
                updateCdmaRoamingSettingsAfterCarrierConfigChanged(b);
                updateCdmaRoamingSettingsAfterCarrierConfigChanged(b);


                updateNrSettingsAfterCarrierConfigChanged(b);
                updateNrSettingsAfterCarrierConfigChanged(b);
                updateVoNrSettings(b);
                updateSsOverCdmaSupported(b);
                updateSsOverCdmaSupported(b);
                loadAllowedNetworksFromSubscriptionDatabase();
                loadAllowedNetworksFromSubscriptionDatabase();
                // Obtain new radio capabilities from the modem, since some are SIM-dependent
                // Obtain new radio capabilities from the modem, since some are SIM-dependent
@@ -3267,6 +3268,10 @@ public class GsmCdmaPhone extends Phone {
                resetCarrierKeysForImsiEncryption();
                resetCarrierKeysForImsiEncryption();
                break;
                break;
            }
            }
            case EVENT_SET_VONR_ENABLED_DONE:
                logd("EVENT_SET_VONR_ENABLED_DONE is done");
                break;

            default:
            default:
                super.handleMessage(msg);
                super.handleMessage(msg);
        }
        }
@@ -4691,6 +4696,38 @@ public class GsmCdmaPhone extends Phone {
        mIsCarrierNrSupported = !ArrayUtils.isEmpty(nrAvailabilities);
        mIsCarrierNrSupported = !ArrayUtils.isEmpty(nrAvailabilities);
    }
    }


    private void updateVoNrSettings(PersistableBundle config) {
        if (config == null) {
            loge("didn't get the vonr_enabled_bool from the carrier config.");
            return;
        }

        boolean mIsVonrEnabledByCarrier =
                config.getBoolean(CarrierConfigManager.KEY_VONR_ENABLED_BOOL);

        String result = SubscriptionController.getInstance().getSubscriptionProperty(
                getSubId(),
                SubscriptionManager.NR_ADVANCED_CALLING_ENABLED);

        int setting = -1;
        if (result != null) {
            setting = Integer.parseInt(result);
        }

        logd("VoNR setting from telephony.db:"
                + setting
                + " ,vonr_enabled_bool:"
                + mIsVonrEnabledByCarrier);

        if (!mIsVonrEnabledByCarrier) {
            mCi.setVoNrEnabled(false, obtainMessage(EVENT_SET_VONR_ENABLED_DONE), null);
        } else if (setting == 1 || setting == -1) {
            mCi.setVoNrEnabled(true, obtainMessage(EVENT_SET_VONR_ENABLED_DONE), null);
        } else if (setting == 0) {
            mCi.setVoNrEnabled(false, obtainMessage(EVENT_SET_VONR_ENABLED_DONE), null);
        }
    }

    private void updateCdmaRoamingSettingsAfterCarrierConfigChanged(PersistableBundle config) {
    private void updateCdmaRoamingSettingsAfterCarrierConfigChanged(PersistableBundle config) {
        if (config == null) {
        if (config == null) {
            loge("didn't get the cdma_roaming_mode changes from the carrier config.");
            loge("didn't get the cdma_roaming_mode changes from the carrier config.");
+2 −1
Original line number Original line Diff line number Diff line
@@ -232,8 +232,9 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
    protected static final int EVENT_BARRING_INFO_CHANGED = 58;
    protected static final int EVENT_BARRING_INFO_CHANGED = 58;
    protected static final int EVENT_LINK_CAPACITY_CHANGED = 59;
    protected static final int EVENT_LINK_CAPACITY_CHANGED = 59;
    protected static final int EVENT_RESET_CARRIER_KEY_IMSI_ENCRYPTION = 60;
    protected static final int EVENT_RESET_CARRIER_KEY_IMSI_ENCRYPTION = 60;
    protected static final int EVENT_SET_VONR_ENABLED_DONE = 61;


    protected static final int EVENT_LAST = EVENT_RESET_CARRIER_KEY_IMSI_ENCRYPTION;
    protected static final int EVENT_LAST = EVENT_SET_VONR_ENABLED_DONE;


    // For shared prefs.
    // For shared prefs.
    private static final String GSM_ROAMING_LIST_OVERRIDE_PREFIX = "gsm_roaming_list_";
    private static final String GSM_ROAMING_LIST_OVERRIDE_PREFIX = "gsm_roaming_list_";
+5 −1
Original line number Original line Diff line number Diff line
@@ -301,7 +301,8 @@ public class SubscriptionController extends ISub.Stub {
            SubscriptionManager.DATA_ENABLED_OVERRIDE_RULES,
            SubscriptionManager.DATA_ENABLED_OVERRIDE_RULES,
            SubscriptionManager.UICC_APPLICATIONS_ENABLED,
            SubscriptionManager.UICC_APPLICATIONS_ENABLED,
            SubscriptionManager.IMS_RCS_UCE_ENABLED,
            SubscriptionManager.IMS_RCS_UCE_ENABLED,
            SubscriptionManager.CROSS_SIM_CALLING_ENABLED
            SubscriptionManager.CROSS_SIM_CALLING_ENABLED,
            SubscriptionManager.NR_ADVANCED_CALLING_ENABLED
    ));
    ));


    public static SubscriptionController init(Context c) {
    public static SubscriptionController init(Context c) {
@@ -2260,6 +2261,7 @@ public class SubscriptionController extends ISub.Stub {
            case SubscriptionManager.DATA_ROAMING:
            case SubscriptionManager.DATA_ROAMING:
            case SubscriptionManager.IMS_RCS_UCE_ENABLED:
            case SubscriptionManager.IMS_RCS_UCE_ENABLED:
            case SubscriptionManager.CROSS_SIM_CALLING_ENABLED:
            case SubscriptionManager.CROSS_SIM_CALLING_ENABLED:
            case SubscriptionManager.NR_ADVANCED_CALLING_ENABLED:
                values.put(propKey, cursor.getInt(columnIndex));
                values.put(propKey, cursor.getInt(columnIndex));
                break;
                break;
            case SubscriptionManager.DISPLAY_NAME:
            case SubscriptionManager.DISPLAY_NAME:
@@ -3198,6 +3200,7 @@ public class SubscriptionController extends ISub.Stub {
            case SubscriptionManager.IMS_RCS_UCE_ENABLED:
            case SubscriptionManager.IMS_RCS_UCE_ENABLED:
            case SubscriptionManager.CROSS_SIM_CALLING_ENABLED:
            case SubscriptionManager.CROSS_SIM_CALLING_ENABLED:
            case SubscriptionManager.VOIMS_OPT_IN_STATUS:
            case SubscriptionManager.VOIMS_OPT_IN_STATUS:
            case SubscriptionManager.NR_ADVANCED_CALLING_ENABLED:
                value.put(propKey, Integer.parseInt(propValue));
                value.put(propKey, Integer.parseInt(propValue));
                break;
                break;
            case SubscriptionManager.ALLOWED_NETWORK_TYPES:
            case SubscriptionManager.ALLOWED_NETWORK_TYPES:
@@ -3278,6 +3281,7 @@ public class SubscriptionController extends ISub.Stub {
                        case SubscriptionManager.VOIMS_OPT_IN_STATUS:
                        case SubscriptionManager.VOIMS_OPT_IN_STATUS:
                        case SubscriptionManager.D2D_STATUS_SHARING:
                        case SubscriptionManager.D2D_STATUS_SHARING:
                        case SubscriptionManager.D2D_STATUS_SHARING_SELECTED_CONTACTS:
                        case SubscriptionManager.D2D_STATUS_SHARING_SELECTED_CONTACTS:
                        case SubscriptionManager.NR_ADVANCED_CALLING_ENABLED:
                            resultValue = cursor.getString(0);
                            resultValue = cursor.getString(0);
                            break;
                            break;
                        default:
                        default:
+2 −1
Original line number Original line Diff line number Diff line
@@ -117,7 +117,8 @@ public class FakeTelephonyProvider extends MockContentProvider {
                    + Telephony.SimInfo.COLUMN_RCS_CONFIG + " BLOB,"
                    + Telephony.SimInfo.COLUMN_RCS_CONFIG + " BLOB,"
                    + Telephony.SimInfo.COLUMN_ALLOWED_NETWORK_TYPES_FOR_REASONS + " TEXT,"
                    + Telephony.SimInfo.COLUMN_ALLOWED_NETWORK_TYPES_FOR_REASONS + " TEXT,"
                    + Telephony.SimInfo.COLUMN_D2D_STATUS_SHARING + " INTEGER DEFAULT 0,"
                    + Telephony.SimInfo.COLUMN_D2D_STATUS_SHARING + " INTEGER DEFAULT 0,"
                    + Telephony.SimInfo.COLUMN_D2D_STATUS_SHARING_SELECTED_CONTACTS + "TEXT"
                    + Telephony.SimInfo.COLUMN_D2D_STATUS_SHARING_SELECTED_CONTACTS + "TEXT,"
                    + Telephony.SimInfo.COLUMN_NR_ADVANCED_CALLING_ENABLED + " INTEGER DEFAULT -1"
                    + ");";
                    + ");";
        }
        }


+3 −0
Original line number Original line Diff line number Diff line
@@ -1560,6 +1560,9 @@ public class GsmCdmaPhoneTest extends TelephonyTest {


    @Test
    @Test
    public void testEventCarrierConfigChanged() {
    public void testEventCarrierConfigChanged() {
        doReturn(null).when(mSubscriptionController).getSubscriptionProperty(anyInt(),
                eq(SubscriptionManager.NR_ADVANCED_CALLING_ENABLED));

        mPhoneUT.mCi = mMockCi;
        mPhoneUT.mCi = mMockCi;
        mPhoneUT.sendMessage(mPhoneUT.obtainMessage(Phone.EVENT_CARRIER_CONFIG_CHANGED));
        mPhoneUT.sendMessage(mPhoneUT.obtainMessage(Phone.EVENT_CARRIER_CONFIG_CHANGED));
        processAllMessages();
        processAllMessages();