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

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

Merge tm-qpr-dev-plus-aosp-without-vendor@9467136

Bug: 264720040
Merged-In: Icf64b668a11a1d7cb7b7c28b4937695ab8997929
Change-Id: I7eeb68e419daee2a0a24664c8112340460416d26
parents 594ad2c8 322694e1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -222,6 +222,7 @@ message VoiceCallSession {
    optional int32 rat_at_connected = 30;
    optional bool is_multiparty = 31;
    optional int32 call_duration = 32;
    optional int32 last_known_rat = 33;
    // Internal use only
    optional int64 setup_begin_millis = 10001;
}
+8 −2
Original line number Diff line number Diff line
@@ -4631,6 +4631,8 @@ public class GsmCdmaPhone extends Phone {

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

        String result = SubscriptionController.getInstance().getSubscriptionProperty(
                getSubId(),
@@ -4644,11 +4646,15 @@ public class GsmCdmaPhone extends Phone {
        logd("VoNR setting from telephony.db:"
                + setting
                + " ,vonr_enabled_bool:"
                + mIsVonrEnabledByCarrier);
                + mIsVonrEnabledByCarrier
                + " ,vonr_on_by_default_bool:"
                + mDefaultVonr);

        if (!mIsVonrEnabledByCarrier) {
            mCi.setVoNrEnabled(false, obtainMessage(EVENT_SET_VONR_ENABLED_DONE), null);
        } else if (setting == 1 || setting == -1) {
        } else if (setting == -1) {
            mCi.setVoNrEnabled(mDefaultVonr, obtainMessage(EVENT_SET_VONR_ENABLED_DONE), null);
        } else if (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);
+36 −12
Original line number Diff line number Diff line
@@ -152,6 +152,7 @@ public class NetworkTypeController extends StateMachine {
    private boolean mIsTimerResetEnabledForLegacyStateRRCIdle;
    private int mLtePlusThresholdBandwidth;
    private int mNrAdvancedThresholdBandwidth;
    private boolean mIncludeLteForNrAdvancedThresholdBandwidth;
    private int[] mAdditionalNrAdvancedBandsList;
    private String mPrimaryTimerState;
    private String mSecondaryTimerState;
@@ -259,6 +260,9 @@ public class NetworkTypeController extends StateMachine {
                CarrierConfigManager.KEY_LTE_PLUS_THRESHOLD_BANDWIDTH_KHZ_INT);
        mNrAdvancedThresholdBandwidth = CarrierConfigManager.getDefaultConfig().getInt(
                CarrierConfigManager.KEY_NR_ADVANCED_THRESHOLD_BANDWIDTH_KHZ_INT);
        mIncludeLteForNrAdvancedThresholdBandwidth = CarrierConfigManager.getDefaultConfig()
                .getBoolean(CarrierConfigManager
                        .KEY_INCLUDE_LTE_FOR_NR_ADVANCED_THRESHOLD_BANDWIDTH_BOOL);
        mEnableNrAdvancedWhileRoaming = CarrierConfigManager.getDefaultConfig().getBoolean(
                CarrierConfigManager.KEY_ENABLE_NR_ADVANCED_WHILE_ROAMING_BOOL);

@@ -294,6 +298,9 @@ public class NetworkTypeController extends StateMachine {
                mNrAdvancedThresholdBandwidth = b.getInt(
                        CarrierConfigManager.KEY_NR_ADVANCED_THRESHOLD_BANDWIDTH_KHZ_INT,
                        mNrAdvancedThresholdBandwidth);
                mIncludeLteForNrAdvancedThresholdBandwidth = b.getBoolean(CarrierConfigManager
                        .KEY_INCLUDE_LTE_FOR_NR_ADVANCED_THRESHOLD_BANDWIDTH_BOOL,
                        mIncludeLteForNrAdvancedThresholdBandwidth);
                mAdditionalNrAdvancedBandsList = b.getIntArray(
                        CarrierConfigManager.KEY_ADDITIONAL_NR_ADVANCED_BANDS_INT_ARRAY);
                mNrAdvancedCapablePcoId = b.getInt(
@@ -977,19 +984,21 @@ public class NetworkTypeController extends StateMachine {
        }

        private void updateNrAdvancedState() {
            log("updateNrAdvancedState");
            if (!isNrConnected()) {
            if (!isNrConnected() && getDataNetworkType() != TelephonyManager.NETWORK_TYPE_NR) {
                log("NR state changed. Sending EVENT_NR_STATE_CHANGED");
                sendMessage(EVENT_NR_STATE_CHANGED);
                return;
            }
            if (!isNrAdvanced()) {
            boolean isNrAdvanced = isNrAdvanced();
            if (isNrAdvanced != mIsNrAdvanced) {
                if (!isNrAdvanced) {
                    if (DBG) log("updateNrAdvancedState: CONNECTED_NR_ADVANCED -> CONNECTED");
                transitionWithTimerTo(mNrConnectedState);
                    transitionWithTimerTo(mNrConnectedState, STATE_CONNECTED);
                } else {
                    if (DBG) log("updateNrAdvancedState: CONNECTED -> CONNECTED_NR_ADVANCED");
                    transitionTo(mNrConnectedState);
                }
            }
            mIsNrAdvanced = isNrAdvanced();
            log("mIsNrAdvanced=" + mIsNrAdvanced);
        }
@@ -998,7 +1007,10 @@ public class NetworkTypeController extends StateMachine {
    private final NrConnectedState mNrConnectedState = new NrConnectedState();

    private void transitionWithTimerTo(IState destState) {
        String destName = destState.getName();
        transitionWithTimerTo(destState, destState.getName());
    }

    private void transitionWithTimerTo(IState destState, String destName) {
        if (DBG) log("Transition with primary timer from " + mPreviousState + " to " + destName);
        OverrideTimerRule rule = mOverrideTimerRules.get(mPreviousState);
        if (!mIsDeviceIdleMode && rule != null && rule.getTimer(destName) > 0) {
@@ -1075,6 +1087,8 @@ public class NetworkTypeController extends StateMachine {
            removeMessages(EVENT_PRIMARY_TIMER_EXPIRED);
            mIsPrimaryTimerActive = false;
            mPrimaryTimerState = "";
            transitionToCurrentState();
            return;
        }

        if (mIsSecondaryTimerActive && !mSecondaryTimerState.equals(currentState)) {
@@ -1086,6 +1100,8 @@ public class NetworkTypeController extends StateMachine {
            removeMessages(EVENT_SECONDARY_TIMER_EXPIRED);
            mIsSecondaryTimerActive = false;
            mSecondaryTimerState = "";
            transitionToCurrentState();
            return;
        }

        if (mIsPrimaryTimerActive || mIsSecondaryTimerActive) {
@@ -1223,11 +1239,19 @@ public class NetworkTypeController extends StateMachine {
            return false;
        }

        int bandwidths = 0;
        if (mPhone.getServiceStateTracker().getPhysicalChannelConfigList() != null) {
            bandwidths = mPhone.getServiceStateTracker().getPhysicalChannelConfigList()
                    .stream()
                    .filter(config -> mIncludeLteForNrAdvancedThresholdBandwidth
                            || config.getNetworkType() == TelephonyManager.NETWORK_TYPE_NR)
                    .map(PhysicalChannelConfig::getCellBandwidthDownlinkKhz)
                    .mapToInt(Integer::intValue)
                    .sum();
        }
        // Check if meeting minimum bandwidth requirement. For most carriers, there is no minimum
        // bandwidth requirement and mNrAdvancedThresholdBandwidth is 0.
        if (mNrAdvancedThresholdBandwidth > 0
                && IntStream.of(mPhone.getServiceState().getCellBandwidths()).sum()
                < mNrAdvancedThresholdBandwidth) {
        if (mNrAdvancedThresholdBandwidth > 0 && bandwidths < mNrAdvancedThresholdBandwidth) {
            return false;
        }

+4 −10
Original line number Diff line number Diff line
@@ -2870,15 +2870,9 @@ public class SubscriptionController extends ISub.Stub {
                        subId);

        TelecomManager telecomManager = mContext.getSystemService(TelecomManager.class);
        PhoneAccountHandle currentHandle = telecomManager.getUserSelectedOutgoingPhoneAccount();
        logd("[setDefaultVoiceSubId] current phoneAccountHandle=" + currentHandle);

        if (!Objects.equals(currentHandle, newHandle)) {
        telecomManager.setUserSelectedOutgoingPhoneAccount(newHandle);
            logd("[setDefaultVoiceSubId] change to phoneAccountHandle=" + newHandle);
        } else {
            logd("[setDefaultVoiceSubId] default phoneAccountHandle not changed.");
        }
        logd("[setDefaultVoiceSubId] requesting change to phoneAccountHandle=" + newHandle);

        if (previousDefaultSub != getDefaultSubId()) {
            sendDefaultChangedBroadcast(getDefaultSubId());
@@ -3604,7 +3598,7 @@ public class SubscriptionController extends ISub.Stub {
            if (phoneSwitcher == null) {
                logd("Set preferred data sub: phoneSwitcher is null.");
                AnomalyReporter.reportAnomaly(
                        UUID.fromString("a3ab0b9d-f2aa-4baf-911d-7096c0d4645a"),
                        UUID.fromString("a73fe57f-4178-4bc3-a7ae-9d7354939274"),
                        "Set preferred data sub: phoneSwitcher is null.");
                if (callback != null) {
                    try {
@@ -3631,7 +3625,7 @@ public class SubscriptionController extends ISub.Stub {
            PhoneSwitcher phoneSwitcher = PhoneSwitcher.getInstance();
            if (phoneSwitcher == null) {
                AnomalyReporter.reportAnomaly(
                        UUID.fromString("a3ab0b9d-f2aa-4baf-911d-7096c0d4645a"),
                        UUID.fromString("e72747ab-d0aa-4b0e-9dd5-cb99365c6d58"),
                        "Get preferred data sub: phoneSwitcher is null.");
                return SubscriptionManager.DEFAULT_SUBSCRIPTION_ID;
            }
+17 −2
Original line number Diff line number Diff line
@@ -15,6 +15,8 @@
 */
package com.android.internal.telephony;

import static com.android.internal.telephony.SmsConstants.ENCODING_8BIT;

import android.annotation.Nullable;
import android.content.ComponentName;
import android.content.Context;
@@ -294,7 +296,19 @@ public class VisualVoicemailSmsFilter {
                result.firstMessage = message;
            }
            String body = message.getMessageBody();
            if (body == null && message.getUserData() != null) {

            /*
             * For visual voice mail SMS message, UTF-8 is used by default
             * {@link com.android.internal.telephony.SmsController#sendVisualVoicemailSmsForSubscriber}
             *
             * If config_sms_decode_gsm_8bit_data is enabled, GSM-8bit will be used to decode the
             * received message. However, the message is most likely encoded with UTF-8. Therefore,
             * we need to retry decoding the received message with UTF-8.
             */
            if ((body == null || (message.is3gpp()
                    && message.getReceivedEncodingType() == ENCODING_8BIT))
                    && message.getUserData() != null) {
                Log.d(TAG, "getFullMessage decode using UTF-8");
                // Attempt to interpret the user data as UTF-8. UTF-8 string over data SMS using
                // 8BIT data coding scheme is our recommended way to send VVM SMS and is used in CTS
                // Tests. The OMTP visual voicemail specification does not specify the SMS type and
@@ -303,7 +317,8 @@ public class VisualVoicemailSmsFilter {
                try {
                    body = decoder.decode(byteBuffer).toString();
                } catch (CharacterCodingException e) {
                    // User data is not decode-able as UTF-8. Ignoring.
                    Log.e(TAG, "getFullMessage: got CharacterCodingException"
                            + " when decoding with UTF-8, e = " + e);
                    return null;
                }
            }
Loading