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

Commit fa47e8cc authored by Jack Yu's avatar Jack Yu
Browse files

Do not switch phone type to CDMA

As CDMA is deprecated, force the phone to stay in GSM (A broader term for
3GPP RATs like UMTS, LTE, NR, etc..) mode.

This is just the partial change to unblock the issue that vendor RIL
reports CDMA when it's actually unknown. The phone type clean up will
be merged in other CLs.

Fix: 397326176
Fix: 399469738
Bug: 395645219
Test: Data browsing, making phone calls, and other basic telephony tests
Flag: com.android.internal.telephony.flags.phone_type_cleanup
Change-Id: Ifd45db11d390735fc35197904556d5e37ff36d85
parent 9f89dc83
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -177,6 +177,17 @@ flag {
    bug: "379356026"
}

# OWNER=jackyu TARGET=25Q2
flag {
    name: "phone_type_cleanup"
    namespace: "telephony"
    description: "As CDMA deprecated, there is no need to switch phone type between CDMA and GSM"
    bug: "379356026"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}

# OWNER=tjstuart TARGET=25Q2
flag {
    name: "dynamic_do_not_ask_again_text"
+4 −0
Original line number Diff line number Diff line
@@ -4570,6 +4570,10 @@ public class GsmCdmaPhone extends Phone {

    protected void phoneObjectUpdater(int newVoiceRadioTech) {
        logd("phoneObjectUpdater: newVoiceRadioTech=" + newVoiceRadioTech);
        if (mFeatureFlags.phoneTypeCleanup()) {
            logd("phoneObjectUpdater: no-op as CDMA cleanup flag is set");
            return;
        }

        // Check for a voice over LTE/NR replacement
        if (ServiceState.isPsOnlyTech(newVoiceRadioTech)
+10 −3
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import static android.telephony.TelephonyManager.HAL_SERVICE_RADIO;

import static com.android.internal.telephony.PhoneConstants.PHONE_TYPE_CDMA;
import static com.android.internal.telephony.PhoneConstants.PHONE_TYPE_CDMA_LTE;
import static com.android.internal.telephony.PhoneConstants.PHONE_TYPE_GSM;

import static java.util.Arrays.copyOf;

@@ -325,11 +326,17 @@ public class PhoneFactory {
    }

    private static Phone createPhone(Context context, int phoneId) {
        int phoneType = TelephonyManager.getPhoneType(RILConstants.PREFERRED_NETWORK_MODE);
        Rlog.i(LOG_TAG, "Creating Phone with type = " + phoneType + " phoneId = " + phoneId);

        int phoneType;
        if (sFeatureFlags.phoneTypeCleanup()) {
            phoneType = PHONE_TYPE_GSM;
        } else {
            phoneType = TelephonyManager.getPhoneType(RILConstants.PREFERRED_NETWORK_MODE);
            // We always use PHONE_TYPE_CDMA_LTE now.
            if (phoneType == PHONE_TYPE_CDMA) phoneType = PHONE_TYPE_CDMA_LTE;
        }

        Rlog.i(LOG_TAG, "Creating Phone with type = " + phoneType + " phoneId = " + phoneId);

        TelephonyComponentFactory injectedComponentFactory =
                TelephonyComponentFactory.getInstance().inject(GsmCdmaPhone.class.getName());