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

Commit eb883e63 authored by Jack Yu's avatar Jack Yu Committed by Android (Google) Code Review
Browse files

Merge "Do not switch phone type to CDMA" into main

parents e804b8f1 fa47e8cc
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());