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

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

Merge Android 13 QPR2

Bug: 273316506
Merged-In: Ifde290a188e002b5d05e210c34a50a6bf2551863
Change-Id: Ibef632722b512b7b3b5e3e22a04de5fa6793c310
parents e04304d1 6fb6b350
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;
}
+27 −6
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,7 +984,6 @@ public class NetworkTypeController extends StateMachine {
        }

        private void updateNrAdvancedState() {
            log("updateNrAdvancedState");
            if (!isNrConnected() && getDataNetworkType() != TelephonyManager.NETWORK_TYPE_NR) {
                log("NR state changed. Sending EVENT_NR_STATE_CHANGED");
                sendMessage(EVENT_NR_STATE_CHANGED);
@@ -987,7 +993,7 @@ public class NetworkTypeController extends StateMachine {
            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);
@@ -1001,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) {
@@ -1078,6 +1087,8 @@ public class NetworkTypeController extends StateMachine {
            removeMessages(EVENT_PRIMARY_TIMER_EXPIRED);
            mIsPrimaryTimerActive = false;
            mPrimaryTimerState = "";
            transitionToCurrentState();
            return;
        }

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

        if (mIsPrimaryTimerActive || mIsSecondaryTimerActive) {
@@ -1226,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
@@ -2838,15 +2838,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());
@@ -3568,7 +3562,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 {
@@ -3595,7 +3589,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;
            }
+9 −2
Original line number Diff line number Diff line
@@ -1402,8 +1402,8 @@ public final class GsmMmiCode extends Handler implements MmiCode {
        }
    }
    //***** Private instance methods

    private CharSequence getErrorMessage(AsyncResult ar) {
    @VisibleForTesting
    public CharSequence getErrorMessage(AsyncResult ar) {

        if (ar.exception instanceof CommandException) {
            CommandException.Error err = ((CommandException)(ar.exception)).getCommandError();
@@ -1431,6 +1431,13 @@ public final class GsmMmiCode extends Handler implements MmiCode {
            } else if (err == CommandException.Error.OEM_ERROR_1) {
                Rlog.i(LOG_TAG, "OEM_ERROR_1 USSD_MODIFIED_TO_DIAL_VIDEO");
                return mContext.getText(com.android.internal.R.string.stk_cc_ussd_to_dial_video);
            } else if (err == CommandException.Error.REQUEST_NOT_SUPPORTED
                || err == CommandException.Error.OPERATION_NOT_ALLOWED) {
                Rlog.i(LOG_TAG, "REQUEST_NOT_SUPPORTED/OPERATION_NOT_ALLOWED");
                // getResources().getText() is the same as getText(), however getText() is final and
                // cannot be mocked in tests.
                return mContext.getResources().getText(
                        com.android.internal.R.string.mmiErrorNotSupported);
            }
        }

+6 −0
Original line number Diff line number Diff line
@@ -2811,6 +2811,12 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
            conn.getCall().detach(conn);
            removeConnection(conn);

            // If the call being disconnected was the pending MO call we should clear it.
            if (mPendingMO == conn) {
                mPendingMO.finalize();
                mPendingMO = null;
            }

            // remove conference participants from the cached list when call is disconnected
            List<ConferenceParticipant> cpList = imsCall.getConferenceParticipants();
            if (cpList != null) {
Loading