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

Commit 7a685485 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 9330113 from 610d8d55 to tm-qpr2-release

Change-Id: I584d12c71b2ccba2538760d003ec47ac2c63d624
parents 37321608 610d8d55
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -1261,15 +1261,11 @@ public class NetworkTypeController extends StateMachine {
            return false;
        }

        int bandwidths = mPhone.getServiceStateTracker().getPhysicalChannelConfigList()
                .stream()
                .filter(config -> 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 && bandwidths < mNrAdvancedThresholdBandwidth) {
        if (mNrAdvancedThresholdBandwidth > 0
                && IntStream.of(mPhone.getServiceState().getCellBandwidths()).sum()
                < mNrAdvancedThresholdBandwidth) {
            return false;
        }

+16 −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,18 @@ 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.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 +316,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;
                }
            }
+1 −6
Original line number Diff line number Diff line
@@ -1323,12 +1323,7 @@ public class NetworkTypeControllerTest extends TelephonyTest {
        doReturn(TelephonyManager.NETWORK_TYPE_LTE).when(mServiceState).getDataNetworkType();
        doReturn(NetworkRegistrationInfo.NR_STATE_CONNECTED).when(mServiceState).getNrState();
        doReturn(ServiceState.FREQUENCY_RANGE_MMWAVE).when(mServiceState).getNrFrequencyRange();
        List<PhysicalChannelConfig> lastPhysicalChannelConfigList = new ArrayList<>();
        lastPhysicalChannelConfigList.add(new PhysicalChannelConfig.Builder()
                .setNetworkType(TelephonyManager.NETWORK_TYPE_NR)
                .setCellBandwidthDownlinkKhz(20001)
                .build());
        doReturn(lastPhysicalChannelConfigList).when(mSST).getPhysicalChannelConfigList();
        doReturn(new int[] {20001}).when(mServiceState).getCellBandwidths();
        mBundle.putInt(CarrierConfigManager.KEY_NR_ADVANCED_THRESHOLD_BANDWIDTH_KHZ_INT, 20000);
        broadcastCarrierConfigs();