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

Commit b3b549fc authored by Sarah Chin's avatar Sarah Chin
Browse files

Remove DisplayInfo logic from DcTracker

Remove hysteresis logic and sync meteredness with override network type
from DisplayInfoController

Test: atest NetworkTypeControllerTest, DcTrackerTest
Test: manual verify timer and meteredness works as expected
Bug: 154186364
Change-Id: Icd31e7b9c4e22bff50089d1af64ff7ed58f5111a
parent 870a1ae5
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -264,8 +264,16 @@ public class GsmCdmaPhone extends Phone {
                this, this.mCi);
        mDataEnabledSettings = mTelephonyComponentFactory
                .inject(DataEnabledSettings.class.getName()).makeDataEnabledSettings(this);
        mDeviceStateMonitor = mTelephonyComponentFactory.inject(DeviceStateMonitor.class.getName())
                .makeDeviceStateMonitor(this);

        // DisplayInfoController creates an OverrideNetworkTypeController, which uses
        // DeviceStateMonitor so needs to be crated after it is instantiated.
        mDisplayInfoController = mTelephonyComponentFactory.inject(
                DisplayInfoController.class.getName()).makeDisplayInfoController(this);

        // DcTracker uses SST so needs to be created after it is instantiated
        // DcTracker uses ServiceStateTracker and DisplayInfoController so needs to be created
        // after they are instantiated
        for (int transport : mTransportManager.getAvailableTransports()) {
            mDcTrackers.put(transport, mTelephonyComponentFactory.inject(DcTracker.class.getName())
                    .makeDcTracker(this, transport));
@@ -279,14 +287,6 @@ public class GsmCdmaPhone extends Phone {
                EVENT_SET_CARRIER_DATA_ENABLED, null, false);

        mSST.registerForNetworkAttached(this, EVENT_REGISTERED_TO_NETWORK, null);
        mDeviceStateMonitor = mTelephonyComponentFactory.inject(DeviceStateMonitor.class.getName())
                .makeDeviceStateMonitor(this);

        // DisplayInfoController creates an OverrideNetworkTypeController, which uses
        // DeviceStateMonitor so needs to be crated after it is instantiated.
        mDisplayInfoController = mTelephonyComponentFactory.inject(
                DisplayInfoController.class.getName()).makeDisplayInfoController(this);

        mSST.registerForVoiceRegStateOrRatChanged(this, EVENT_VRS_OR_RAT_CHANGED, null);

        mSettingsObserver = new SettingsObserver(context, this);
+9 −14
Original line number Diff line number Diff line
@@ -2005,15 +2005,6 @@ public class ServiceStateTracker extends Handler {
        return cdmaRoaming && !isSameOperatorNameFromSimAndSS(s);
    }

    private boolean isNrStateChanged(
            NetworkRegistrationInfo oldRegState, NetworkRegistrationInfo newRegState) {
        if (oldRegState == null || newRegState == null) {
            return oldRegState != newRegState;
        }

        return oldRegState.getNrState() != newRegState.getNrState();
    }

    private boolean updateNrFrequencyRangeFromPhysicalChannelConfigs(
            List<PhysicalChannelConfig> physicalChannelConfigs, ServiceState ss) {
        int newFrequencyRange = ServiceState.FREQUENCY_RANGE_UNKNOWN;
@@ -3235,11 +3226,7 @@ public class ServiceStateTracker extends Handler {
        boolean hasNrFrequencyRangeChanged =
                mSS.getNrFrequencyRange() != mNewSS.getNrFrequencyRange();

        boolean hasNrStateChanged = isNrStateChanged(
                mSS.getNetworkRegistrationInfo(
                        NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkType.EUTRAN),
                mNewSS.getNetworkRegistrationInfo(
                        NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkType.EUTRAN));
        boolean hasNrStateChanged = mSS.getNrState() != mNewSS.getNrState();

        boolean hasLocationChanged = (mCellIdentity == null ? mNewCellIdentity != null
                : !mCellIdentity.isSameCell(mNewCellIdentity));
@@ -3557,6 +3544,14 @@ public class ServiceStateTracker extends Handler {
            mPhone.notifyLocationChanged(getCellIdentity());
        }

        if (hasNrStateChanged) {
            mNrStateChangedRegistrants.notifyRegistrants();
        }

        if (hasNrFrequencyRangeChanged) {
            mNrFrequencyChangedRegistrants.notifyRegistrants();
        }

        if (mPhone.isPhoneTypeGsm()) {
            if (!isGprsConsistent(mSS.getDataRegistrationState(), mSS.getState())) {
                if (!mStartedGprsRegCheck && !mReportedGprsNoReg) {
+41 −238

File changed.

Preview size limit exceeded, changes collapsed.

+31 −211

File changed.

Preview size limit exceeded, changes collapsed.