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

Commit 23361e6e authored by Jordan Liu's avatar Jordan Liu
Browse files

Reduce log spam in DcTracker and DataEnabledSettings

For a device in a normal state (connected), just opening Settings >
Network & internet triggers this log, which can flush useful info out of
the local log buffer. We can keep the CONNECTING and DISCONNECTING logs
because those are less common but we should remove the log for
CONNECTED.

In DataEnabledSettings we also only local log when the setting actually
changes.

Bug: 133852635
Test: manual
Change-Id: I3a231db8428c26263f892aa5ea0ebe89222cdd61
parent 8fb4065f
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -141,8 +141,8 @@ public class DataEnabledSettings {
    }

    public synchronized void setInternalDataEnabled(boolean enabled) {
        localLog("InternalDataEnabled", enabled);
        if (mInternalDataEnabled != enabled) {
            localLog("InternalDataEnabled", enabled);
            mInternalDataEnabled = enabled;
            updateDataEnabledAndNotify(REASON_INTERNAL_DATA_ENABLED);
        }
@@ -155,10 +155,10 @@ public class DataEnabledSettings {
        // Can't disable data for stand alone opportunistic subscription.
        if (isStandAloneOpportunistic(mPhone.getSubId(), mPhone.getContext()) && !enabled) return;

        localLog("UserDataEnabled", enabled);
        boolean changed = GlobalSettingsHelper.setInt(mPhone.getContext(),
                Settings.Global.MOBILE_DATA, mPhone.getSubId(), (enabled ? 1 : 0));
        if (changed) {
            localLog("UserDataEnabled", enabled);
            mPhone.notifyUserMobileDataStateChanged(enabled);
            updateDataEnabledAndNotify(REASON_USER_DATA_ENABLED);
            MultiSimSettingController.getInstance().notifyUserDataEnabled(mPhone.getSubId(),
@@ -178,8 +178,8 @@ public class DataEnabledSettings {
    }

    public synchronized void setPolicyDataEnabled(boolean enabled) {
        localLog("PolicyDataEnabled", enabled);
        if (mPolicyDataEnabled != enabled) {
            localLog("PolicyDataEnabled", enabled);
            mPolicyDataEnabled = enabled;
            updateDataEnabledAndNotify(REASON_POLICY_DATA_ENABLED);
        }
@@ -190,8 +190,8 @@ public class DataEnabledSettings {
    }

    public synchronized void setCarrierDataEnabled(boolean enabled) {
        localLog("CarrierDataEnabled", enabled);
        if (mCarrierDataEnabled != enabled) {
            localLog("CarrierDataEnabled", enabled);
            mCarrierDataEnabled = enabled;
            updateDataEnabledAndNotify(REASON_DATA_ENABLED_BY_CARRIER);
        }
@@ -257,13 +257,12 @@ public class DataEnabledSettings {
    }

    public synchronized void setDataRoamingEnabled(boolean enabled) {
        localLog("setDataRoamingEnabled", enabled);

        // will trigger handleDataOnRoamingChange() through observer
        boolean changed = GlobalSettingsHelper.setBoolean(mPhone.getContext(),
                Settings.Global.DATA_ROAMING, mPhone.getSubId(), enabled);

        if (changed) {
            localLog("setDataRoamingEnabled", enabled);
            MultiSimSettingController.getInstance().notifyRoamingDataEnabled(mPhone.getSubId(),
                    enabled);
        }
+1 −2
Original line number Diff line number Diff line
@@ -2363,8 +2363,7 @@ public class DcTracker extends Handler {
                    return;
                case CONNECTED:
                    if (DBG) log("onEnableApn: 'CONNECTED' so return");
                    apnContext.requestLog("onEnableApn state=CONNECTED, so return");

                    // Don't add to local log since this is so common
                    sendRequestNetworkCompleteMsg(onCompleteMsg, true, mTransportType,
                            requestType);
                    return;