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

Commit aba0be90 authored by Jack Yu's avatar Jack Yu
Browse files

Fixed log spamming in locale tracker

Locale tracker local log contains too many
useless cell info logs.

Test: Manual
Change-Id: Iaef52bed398599dbdb936002ba09e54a0f77ce85
parent d4ddbe3d
Loading
Loading
Loading
Loading
+3 −18
Original line number Diff line number Diff line
@@ -272,7 +272,7 @@ public class LocaleTracker extends Handler {
    public void updateOperatorNumeric(String operatorNumeric) {
        // Check if the operator numeric changes.
        if (!Objects.equals(mOperatorNumeric, operatorNumeric)) {
            String msg = "Operator numeric changes to " + operatorNumeric;
            String msg = "Operator numeric changes to \"" + operatorNumeric + "\"";
            if (DBG) log(msg);
            mLocalLog.log(msg);
            mOperatorNumeric = operatorNumeric;
@@ -286,23 +286,8 @@ public class LocaleTracker extends Handler {
            return;
        }
        List<CellInfo> cellInfoList = (List<CellInfo>) ar.result;
        String msg = "getCellInfo: cell info=" + cellInfoList;
        String msg = "processCellInfo: cell info=" + cellInfoList;
        if (DBG) log(msg);
        if (cellInfoList != null) {
            // We only log when cell identity changes, otherwise the local log is flooded with cell
            // info.
            if (mCellInfoList == null || cellInfoList.size() != mCellInfoList.size()) {
                mLocalLog.log(msg);
            } else {
                for (int i = 0; i < cellInfoList.size(); i++) {
                    if (!Objects.equals(mCellInfoList.get(i).getCellIdentity(),
                            cellInfoList.get(i).getCellIdentity())) {
                        mLocalLog.log(msg);
                        break;
                    }
                }
            }
        }
        mCellInfoList = cellInfoList;
        updateLocale();
    }
@@ -412,7 +397,7 @@ public class LocaleTracker extends Handler {
        boolean countryChanged = false;
        if (!Objects.equals(countryIso, mCurrentCountryIso)) {
            String msg = "updateLocale: Change the current country to \"" + countryIso
                    + "\", mcc = " + mcc;
                    + "\", mcc = " + mcc + ", mCellInfoList = " + mCellInfoList;
            log(msg);
            mLocalLog.log(msg);
            mCurrentCountryIso = countryIso;