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

Commit f7e0243a authored by Xin Li's avatar Xin Li
Browse files

Merge sc-v2-dev-plus-aosp-without-vendor@8084891

Bug: 214455710
Merged-In: Id86f2f897962fe1715989150fe6ec0f045aea2c1
Change-Id: Ic6db54351c2842a776e3f08d621412c9c81bc30e
parents b23a485f 709831de
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
amitmahajan@google.com
breadley@google.com
fionaxu@google.com
jackyu@google.com
+46 −1
Original line number Diff line number Diff line
@@ -445,7 +445,8 @@ public class GsmCdmaPhone extends Phone {
                CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED);
        filter.addAction(TelecomManager.ACTION_CURRENT_TTY_MODE_CHANGED);
        filter.addAction(TelecomManager.ACTION_TTY_PREFERRED_MODE_CHANGED);
        mContext.registerReceiver(mBroadcastReceiver, filter);
        mContext.registerReceiver(mBroadcastReceiver, filter,
                android.Manifest.permission.MODIFY_PHONE_STATE, null);

        mCDM = new CarrierKeyDownloadManager(this);
        mCIM = new CarrierInfoManager();
@@ -2993,6 +2994,7 @@ public class GsmCdmaPhone extends Phone {
                updateCdmaRoamingSettingsAfterCarrierConfigChanged(b);

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

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

    private void updateVoNrSettings(PersistableBundle config) {
        UiccSlot slot = mUiccController.getUiccSlotForPhone(mPhoneId);

        // If no card is present, do nothing.
        if (slot == null || slot.getCardState() != IccCardStatus.CardState.CARDSTATE_PRESENT) {
            return;
        }

        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) {
        if (config == null) {
            loge("didn't get the cdma_roaming_mode changes from the carrier config.");
+2 −2
Original line number Diff line number Diff line
@@ -597,8 +597,8 @@ public class IccSmsInterfaceManager {
            String destAddr, String scAddr, String text, PendingIntent sentIntent,
            PendingIntent deliveryIntent, boolean persistMessageForNonDefaultSmsApp, int priority,
            boolean expectMore, int validityPeriod) {
        if (!mSmsPermissions.checkCallingOrSelfCanSendSms(callingPackage, callingAttributionTag,
                "Sending SMS message")) {
        if (!mSmsPermissions.checkCallingCanSendText(persistMessageForNonDefaultSmsApp,
                    callingPackage, callingAttributionTag, "Sending SMS message")) {
            returnUnspecifiedFailure(sentIntent);
            return;
        }
+10 −2
Original line number Diff line number Diff line
@@ -944,8 +944,10 @@ public class NetworkTypeController extends StateMachine {
                    && mNrAdvancedCapablePcoId > 0
                    && pcodata.pcoId == mNrAdvancedCapablePcoId
            ) {
                log("EVENT_PCO_DATA_CHANGED: Nr Advanced is allowed by PCO.");
                mIsNrAdvancedAllowedByPco = pcodata.contents[0] == 1;
                log("EVENT_PCO_DATA_CHANGED: Nr Advanced is allowed by PCO. length:"
                        + pcodata.contents.length + ",value: " + Arrays.toString(pcodata.contents));
                mIsNrAdvancedAllowedByPco = (pcodata.contents.length > 0)
                        ? pcodata.contents[pcodata.contents.length - 1] == 1 : false;
                updateNrAdvancedState();
            }
        }
@@ -1008,6 +1010,12 @@ public class NetworkTypeController extends StateMachine {
    }

    private void updateTimers() {
        if ((mPhone.getCachedAllowedNetworkTypesBitmask()
                & TelephonyManager.NETWORK_TYPE_BITMASK_NR) == 0) {
            resetAllTimers();
            return;
        }

        String currentState = getCurrentState().getName();

        if (mIsPrimaryTimerActive && getOverrideNetworkType() == getCurrentOverrideNetworkType()) {
+2 −1
Original line number Diff line number Diff line
@@ -235,8 +235,9 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
    protected static final int EVENT_BARRING_INFO_CHANGED = 58;
    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_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.
    private static final String GSM_ROAMING_LIST_OVERRIDE_PREFIX = "gsm_roaming_list_";
Loading