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

Commit 562d78c4 authored by Jack Yu's avatar Jack Yu
Browse files

CDMA code cleanup

Test: Basic telephony functionality tests
Test: atest FrameworksTelephonyTests
Bug: 379356026
Flag: com.android.internal.telephony.flags.phone_type_cleanup
Change-Id: I2e3eac0b93594875e94aa8da986c36199254da57
parent ee223e33
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -5133,6 +5133,7 @@ public class GsmCdmaPhone extends Phone {
    }

    public int getLteOnCdmaMode() {
        if (mFeatureFlags.phoneTypeCleanup()) return PhoneConstants.LTE_ON_CDMA_FALSE;
        int currentConfig = TelephonyProperties.lte_on_cdma_device()
                .orElse(PhoneConstants.LTE_ON_CDMA_FALSE);
        int lteOnCdmaModeDynamicValue = currentConfig;
+0 −8
Original line number Diff line number Diff line
@@ -950,14 +950,6 @@ public class IccSmsInterfaceManager {
        return (boolean) setRequest.mResult;
    }

    public boolean enableCellBroadcast(int messageIdentifier, int ranType) {
        return enableCellBroadcastRange(messageIdentifier, messageIdentifier, ranType);
    }

    public boolean disableCellBroadcast(int messageIdentifier, int ranType) {
        return disableCellBroadcastRange(messageIdentifier, messageIdentifier, ranType);
    }

    public boolean enableCellBroadcastRange(int startMessageId, int endMessageId, int ranType) {
        mContext.enforceCallingPermission(android.Manifest.permission.RECEIVE_EMERGENCY_BROADCAST,
                "enabling cell broadcast range [" + startMessageId + "-" + endMessageId + "]. "
+3 −0
Original line number Diff line number Diff line
@@ -112,6 +112,7 @@ import android.text.TextUtils;
import com.android.internal.telephony.cdma.CdmaCallWaitingNotification;
import com.android.internal.telephony.cdma.CdmaInformationRecords;
import com.android.internal.telephony.data.KeepaliveStatus;
import com.android.internal.telephony.flags.Flags;
import com.android.internal.telephony.gsm.SsData;
import com.android.internal.telephony.gsm.SuppServiceNotification;
import com.android.internal.telephony.uicc.IccRefreshResponse;
@@ -571,6 +572,7 @@ public class RadioIndication extends IRadioIndication.Stub {
    }

    public void cdmaCallWaiting(int indicationType, CdmaCallWaiting callWaitingRecord) {
        if (Flags.phoneTypeCleanup()) return;
        mRil.processIndication(HAL_SERVICE_RADIO, indicationType);

        // todo: create a CdmaCallWaitingNotification constructor that takes in these fields to make
@@ -609,6 +611,7 @@ public class RadioIndication extends IRadioIndication.Stub {

    public void cdmaInfoRec(int indicationType,
                            android.hardware.radio.V1_0.CdmaInformationRecords records) {
        if (Flags.phoneTypeCleanup()) return;
        mRil.processIndication(HAL_SERVICE_RADIO, indicationType);

        int numberOfInfoRecs = records.infoRec.size();
+20 −10
Original line number Diff line number Diff line
@@ -715,7 +715,8 @@ public class ServiceStateTracker extends Handler {
        mCdnr = new CarrierDisplayNameResolver(mPhone);

        // Create EriManager only if phone supports CDMA
        if (UiccController.isCdmaSupported(mPhone.getContext())) {
        if (!mFeatureFlags.phoneTypeCleanup()
                && UiccController.isCdmaSupported(mPhone.getContext())) {
            mEriManager = TelephonyComponentFactory.getInstance().inject(EriManager.class.getName())
                    .makeEriManager(mPhone, EriManager.ERI_FROM_XML);
        } else {
@@ -895,19 +896,24 @@ public class ServiceStateTracker extends Handler {
                mCdmaSSM.dispose(this);
            }

            if (!mFeatureFlags.phoneTypeCleanup()) {
                mCi.unregisterForCdmaPrlChanged(this);
                mCi.unregisterForCdmaOtaProvision(this);
            }
            mPhone.unregisterForSimRecordsLoaded(this);

        } else {
            mPhone.registerForSimRecordsLoaded(this, EVENT_SIM_RECORDS_LOADED, null);
            if (!mFeatureFlags.phoneTypeCleanup()) {
                mCdmaSSM = CdmaSubscriptionSourceManager.getInstance(mPhone.getContext(), mCi, this,
                        EVENT_CDMA_SUBSCRIPTION_SOURCE_CHANGED, null);
            mIsSubscriptionFromRuim = (mCdmaSSM.getCdmaSubscriptionSource() ==
                    CdmaSubscriptionSourceManager.SUBSCRIPTION_FROM_RUIM);

                mIsSubscriptionFromRuim = mCdmaSSM.getCdmaSubscriptionSource()
                        == CdmaSubscriptionSourceManager.SUBSCRIPTION_FROM_RUIM;

                mCi.registerForCdmaPrlChanged(this, EVENT_CDMA_PRL_VERSION_CHANGED, null);
                mCi.registerForCdmaOtaProvision(this, EVENT_OTA_PROVISION_STATUS_CHANGE, null);
            }

            mHbpcdUtils = new HbpcdUtils(mPhone.getContext());
            // update OTASP state in case previously set by another service
@@ -1313,7 +1319,9 @@ public class ServiceStateTracker extends Handler {
                    mIsMinInfoReady = false;

                    // Remove the EF records that come from UICC.
                    if (!mFeatureFlags.phoneTypeCleanup()) {
                        mCdnr.updateEfFromRuim(null /* ruim */);
                    }
                    mCdnr.updateEfFromUsim(null /* Usim */);
                }
                onUpdateIccAvailability();
@@ -1997,6 +2005,7 @@ public class ServiceStateTracker extends Handler {

    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
    protected void updateOtaspState() {
        if (mFeatureFlags.phoneTypeCleanup()) return;
        int otaspMode = getOtasp();
        int oldOtaspMode = mCurrentOtaspMode;
        mCurrentOtaspMode = otaspMode;
@@ -5363,6 +5372,7 @@ public class ServiceStateTracker extends Handler {
    }

    private void handleCdmaSubscriptionSource(int newSubscriptionSource) {
        if (mFeatureFlags.phoneTypeCleanup()) return;
        log("Subscription Source : " + newSubscriptionSource);
        mIsSubscriptionFromRuim =
                (newSubscriptionSource == CdmaSubscriptionSourceManager.SUBSCRIPTION_FROM_RUIM);
+4 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import android.telephony.emergency.EmergencyNumber;

import com.android.internal.telephony.cdma.CdmaCallWaitingNotification;
import com.android.internal.telephony.cdma.CdmaInformationRecords;
import com.android.internal.telephony.flags.Flags;
import com.android.internal.telephony.gsm.SsData;

import java.util.ArrayList;
@@ -106,6 +107,7 @@ public class VoiceIndication extends IRadioVoiceIndication.Stub {
     */
    public void cdmaCallWaiting(int indicationType,
            android.hardware.radio.voice.CdmaCallWaiting callWaitingRecord) {
        if (Flags.phoneTypeCleanup()) return;
        mRil.processIndication(HAL_SERVICE_VOICE, indicationType);

        // TODO: create a CdmaCallWaitingNotification constructor that takes in these fields to make
@@ -136,6 +138,7 @@ public class VoiceIndication extends IRadioVoiceIndication.Stub {
     */
    public void cdmaInfoRec(int indicationType,
            android.hardware.radio.voice.CdmaInformationRecord[] records) {
        if (Flags.phoneTypeCleanup()) return;
        mRil.processIndication(HAL_SERVICE_VOICE, indicationType);

        for (int i = 0; i < records.length; i++) {
@@ -235,6 +238,7 @@ public class VoiceIndication extends IRadioVoiceIndication.Stub {
     * @param status CDMA OTA provision status
     */
    public void cdmaOtaProvisionStatus(int indicationType, int status) {
        if (Flags.phoneTypeCleanup()) return;
        mRil.processIndication(HAL_SERVICE_VOICE, indicationType);

        int[] response = new int[] {status};
Loading