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

Unverified Commit 628c7eeb authored by Ricardo Cerqueira's avatar Ricardo Cerqueira Committed by Michael Bestas
Browse files

PhoneFactory: Don't force a preferred mode if the default includes TD-SCDMA

After getting the default network mode from ro.telephony.default_network
(via RILConstants), we were ignoring it if the phone claimed LTE support
and overriding with either GLOBAL (for CDMA+LTE) or LTE_GSM_WCDMA (for
GSM). This is of arguable benefit to begin with, and it totally messes
things if the original mode has TD-SCDMA, which ends up entirely disabled
by default. So for now, skip the overrides if the default includes
TD-SCDMA.
And in the future, we should get rid of this entirely. If a phone
ships mis-configured and doesn't set the correct ro.telephony.default_network,
tough luck. It's not the radio stack's job to compensate for poor
default configurations.

Change-Id: Ie00fcf03977f6048c96bad2579f505804ed6628d
parent bacd5349
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -133,12 +133,14 @@ public class PhoneFactory {

                // Get preferred network mode
                int preferredNetworkMode = RILConstants.PREFERRED_NETWORK_MODE;
                if (preferredNetworkMode < RILConstants.NETWORK_MODE_TDSCDMA_ONLY) {
                    if (TelephonyManager.getLteOnCdmaModeStatic() == PhoneConstants.LTE_ON_CDMA_TRUE) {
                        preferredNetworkMode = Phone.NT_MODE_GLOBAL;
                    }
                    if (TelephonyManager.getLteOnGsmModeStatic() != 0) {
                        preferredNetworkMode = Phone.NT_MODE_LTE_GSM_WCDMA;
                    }
                }

                int cdmaSubscription = CdmaSubscriptionSourceManager.getDefault(context);
                Rlog.i(LOG_TAG, "Cdma Subscription set to " + cdmaSubscription);