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

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

Reduced the radio log

Reduced the radio log by moving some to VDBG or merging few lines
into one.

bug: 25956251
Change-Id: I6a18b6f101ac5bb9aff40c2223fc72034e0cf5bf
parent dc3b93d5
Loading
Loading
Loading
Loading
+17 −15
Original line number Diff line number Diff line
@@ -285,7 +285,7 @@ public class SubscriptionController extends ISub.Stub {
        // FIXME: consider stick this into database too
        String countryIso = getSubscriptionCountryIso(id);

        if (DBG) {
        if (VDBG) {
            String iccIdToPrint = SubscriptionInfo.givePrintableIccid(iccId);
            logd("[getSubInfoRecord] id:" + id + " iccid:" + iccIdToPrint + " simSlotIndex:" + simSlotIndex
                + " displayName:" + displayName + " nameSource:" + nameSource
@@ -323,7 +323,7 @@ public class SubscriptionController extends ISub.Stub {
     * @return Array list of queried result from database
     */
     private List<SubscriptionInfo> getSubInfo(String selection, Object queryKey) {
        if (DBG) logd("selection:" + selection + " " + queryKey);
        if (VDBG) logd("selection:" + selection + " " + queryKey);
        String[] selectionArgs = null;
        if (queryKey != null) {
            selectionArgs = new String[] {queryKey.toString()};
@@ -403,9 +403,10 @@ public class SubscriptionController extends ISub.Stub {
            if (subList != null) {
                for (SubscriptionInfo si : subList) {
                    if (si.getSubscriptionId() == subId) {
                        if (DBG)
                            logd("[getActiveSubInfoForSubscriber]+ subId=" + subId
                                    + " subInfo=" + si);
                        if (DBG) {
                            logd("[getActiveSubscriptionInfo]+ subId=" + subId + " subInfo=" + si);
                        }

                        return si;
                    }
                }
@@ -570,7 +571,7 @@ public class SubscriptionController extends ISub.Stub {
                    }
                });

                if (DBG) logdl("[getActiveSubInfoList]- " + subList.size() + " infos return");
                if (VDBG) logdl("[getActiveSubInfoList]- " + subList.size() + " infos return");
            } else {
                if (DBG) logdl("[getActiveSubInfoList]- no info return");
            }
@@ -1194,7 +1195,7 @@ public class SubscriptionController extends ISub.Stub {
        }

        if (!SubscriptionManager.isValidSubscriptionId(subId)) {
            if (DBG) {
            if (VDBG) {
                logdl("[getPhoneId]- invalid subId return="
                        + SubscriptionManager.INVALID_PHONE_INDEX);
            }
@@ -1258,8 +1259,6 @@ public class SubscriptionController extends ISub.Stub {
        // Now that all security checks passes, perform the operation as ourselves.
        final long identity = Binder.clearCallingIdentity();
        try {
            if (DBG) logd("[clearSubInfo]+");

            int size = sSlotIdxToSubId.size();

            if (size == 0) {
@@ -1404,11 +1403,10 @@ public class SubscriptionController extends ISub.Stub {
        if (subId == SubscriptionManager.DEFAULT_SUBSCRIPTION_ID) {
            throw new RuntimeException("setDefaultDataSubId called with DEFAULT_SUB_ID");
        }
        if (DBG) logdl("[setDefaultDataSubId] subId=" + subId);

        ProxyController proxyController = ProxyController.getInstance();
        int len = sPhones.length;
        logdl("[setDefaultDataSubId] num phones=" + len);
        logdl("[setDefaultDataSubId] num phones=" + len + ", subId=" + subId);

        if (SubscriptionManager.isValidSubscriptionId(subId)) {
            // Only re-map modems if the new default data sub is valid
@@ -1636,7 +1634,6 @@ public class SubscriptionController extends ISub.Stub {
    @Override
    public int[] getActiveSubIdList() {
        Set<Entry<Integer, Integer>> simInfoSet = sSlotIdxToSubId.entrySet();
        if (DBG) logdl("[getActiveSubIdList] simInfoSet=" + simInfoSet);

        int[] subIdArr = new int[simInfoSet.size()];
        int i = 0;
@@ -1646,7 +1643,10 @@ public class SubscriptionController extends ISub.Stub {
            i++;
        }

        if (DBG) logdl("[getActiveSubIdList] X subIdArr.length=" + subIdArr.length);
        if (VDBG) {
            logdl("[getActiveSubIdList] simInfoSet=" + simInfoSet + " subIdArr.length="
                    + subIdArr.length);
        }
        return subIdArr;
    }

@@ -1686,8 +1686,10 @@ public class SubscriptionController extends ISub.Stub {
                }
            }
        }
        if (DBG) logd("getSimStateForSlotIdx: " + err + " simState=" + simState
                + " ordinal=" + simState.ordinal());
        if (DBG) {
            logd("getSimStateForSlotIdx: " + err + " simState=" + simState
                    + " ordinal=" + simState.ordinal() + " slotIdx=" + slotIdx);
        }
        return simState.ordinal();
    }

+12 −4
Original line number Diff line number Diff line
@@ -267,15 +267,23 @@ class DcController extends StateMachine {
                            mDct.isCleanupRequired.set(false);
                        } else {
                            DcFailCause failCause = DcFailCause.fromInt(newState.status);
                            if (DBG) log("onDataStateChanged: inactive failCause=" + failCause);
                            if (failCause.isRestartRadioFail()) {
                                if (DBG) log("onDataStateChanged: X restart radio");
                                if (DBG) {
                                    log("onDataStateChanged: X restart radio, failCause="
                                            + failCause);
                                }
                                mDct.sendRestartRadio();
                            } else if (mDct.isPermanentFail(failCause)) {
                                if (DBG) log("onDataStateChanged: inactive, add to cleanup list");
                                if (DBG) {
                                    log("onDataStateChanged: inactive, add to cleanup list. "
                                            + "failCause=" + failCause);
                                }
                                apnsToCleanup.addAll(dc.mApnContexts.keySet());
                            } else {
                                if (DBG) log("onDataStateChanged: inactive, add to retry list");
                                if (DBG) {
                                    log("onDataStateChanged: inactive, add to retry list. "
                                            + "failCause=" + failCause);
                                }
                                dcsToRetry.add(dc);
                            }
                        }
+24 −3
Original line number Diff line number Diff line
@@ -244,13 +244,15 @@ public final class DcTracker extends Handler {
        @Override
        public void onReceive(Context context, Intent intent) {
            String action = intent.getAction();
            if (DBG) log("onReceive: action=" + action);

            if (action.equals(Intent.ACTION_SCREEN_ON)) {
                if (DBG) log("screen on");
                mIsScreenOn = true;
                stopNetStatPoll();
                startNetStatPoll();
                restartDataStallAlarm();
            } else if (action.equals(Intent.ACTION_SCREEN_OFF)) {
                if (DBG) log("screen off");
                mIsScreenOn = false;
                stopNetStatPoll();
                startNetStatPoll();
@@ -262,8 +264,10 @@ public final class DcTracker extends Handler {
                if (DBG) log("Restart trySetup alarm");
                onActionIntentRestartTrySetupAlarm(intent);
            } else if (action.equals(INTENT_DATA_STALL_ALARM)) {
                if (DBG) log("Data stall alarm");
                onActionIntentDataStallAlarm(intent);
            } else if (action.equals(INTENT_PROVISIONING_APN_ALARM)) {
                if (DBG) log("Provisioning apn alarm");
                onActionIntentProvisioningApnAlarm(intent);
            } else if (action.equals(WifiManager.NETWORK_STATE_CHANGED_ACTION)) {
                final android.net.NetworkInfo networkInfo = (NetworkInfo)
@@ -271,6 +275,7 @@ public final class DcTracker extends Handler {
                mIsWifiConnected = (networkInfo != null && networkInfo.isConnected());
                if (DBG) log("NETWORK_STATE_CHANGED_ACTION: mIsWifiConnected=" + mIsWifiConnected);
            } else if (action.equals(WifiManager.WIFI_STATE_CHANGED_ACTION)) {
                if (DBG) log("Wifi state changed");
                final boolean enabled = intent.getIntExtra(WifiManager.EXTRA_WIFI_STATE,
                        WifiManager.WIFI_STATE_UNKNOWN) == WifiManager.WIFI_STATE_ENABLED;
                if (!enabled) {
@@ -282,6 +287,8 @@ public final class DcTracker extends Handler {
                    log("WIFI_STATE_CHANGED_ACTION: enabled=" + enabled
                            + " mIsWifiConnected=" + mIsWifiConnected);
                }
            } else {
                if (DBG) log("onReceive: Unknown action=" + action);
            }
        }
    };
@@ -1406,7 +1413,7 @@ public final class DcTracker extends Handler {
            }
            if (mIsPsRestricted) reason += " - mIsPsRestricted= true";
            if (!desiredPowerState) reason += " - desiredPowerState= false";
            if (DBG) log("isDataAllowed: not allowed due to" + reason);
            log("isDataAllowed: No" + reason);
        }
        return allowed;
    }
@@ -1428,10 +1435,24 @@ public final class DcTracker extends Handler {
    private void setupDataOnConnectableApns(String reason, RetryFailures retryFailures) {
        if (DBG) log("setupDataOnConnectableApns: " + reason);

        if (DBG && !VDBG) {
            StringBuilder sb = new StringBuilder(120);
            for (ApnContext apnContext : mPrioritySortedApnContexts) {
                sb.append(apnContext.getApnType());
                sb.append(":[state=");
                sb.append(apnContext.getState());
                sb.append(",enabled=");
                sb.append(apnContext.isEnabled());
                sb.append("] ");
            }
            log("setupDataOnConnectableApns: " + sb);
        }

        for (ApnContext apnContext : mPrioritySortedApnContexts) {
            ArrayList<ApnSetting> waitingApns = null;

            if (DBG) log("setupDataOnConnectableApns: apnContext " + apnContext);
            if (VDBG) log("setupDataOnConnectableApns: apnContext " + apnContext);

            if (apnContext.getState() == DctConstants.State.FAILED
                    || apnContext.getState() == DctConstants.State.RETRYING) {
                if (retryFailures == RetryFailures.ALWAYS) {
+20 −4
Original line number Diff line number Diff line
@@ -1654,26 +1654,42 @@ public final class ImsPhoneCallTracker extends CallTracker {
            if (serviceClass == ImsServiceClass.MMTEL) {
                boolean tmpIsVideoCallEnabled = isVideoCallEnabled();
                // Check enabledFeatures to determine capabilities. We ignore disabledFeatures.
                StringBuilder sb;
                if (DBG) {
                    sb = new StringBuilder(120);
                    sb.append("onFeatureCapabilityChanged: ");
                }
                for (int  i = ImsConfig.FeatureConstants.FEATURE_TYPE_VOICE_OVER_LTE;
                        i <= ImsConfig.FeatureConstants.FEATURE_TYPE_UT_OVER_WIFI &&
                        i < enabledFeatures.length; i++) {
                    if (enabledFeatures[i] == i) {
                        // If the feature is set to its own integer value it is enabled.
                        if (DBG) log("onFeatureCapabilityChanged(" + i + ", " + mImsFeatureStrings[i] + "): value=true");
                        if (DBG) {
                            sb.append(mImsFeatureStrings[i]);
                            sb.append(":true ");
                        }

                        mImsFeatureEnabled[i] = true;
                    } else if (enabledFeatures[i]
                            == ImsConfig.FeatureConstants.FEATURE_TYPE_UNKNOWN) {
                        // FEATURE_TYPE_UNKNOWN indicates that a feature is disabled.
                        if (DBG) log("onFeatureCapabilityChanged(" + i + ", " + mImsFeatureStrings[i] + "): value=false");
                        if (DBG) {
                            sb.append(mImsFeatureStrings[i]);
                            sb.append(":false ");
                        }

                        mImsFeatureEnabled[i] = false;
                    } else {
                        // Feature has unknown state; it is not its own value or -1.
                        if (DBG) {
                            loge("onFeatureCapabilityChanged(" + i + ", " +mImsFeatureStrings[i] + "): unexpectedValue="
                                + enabledFeatures[i]);
                            loge("onFeatureCapabilityChanged(" + i + ", " + mImsFeatureStrings[i]
                                    + "): unexpectedValue=" + enabledFeatures[i]);
                        }
                    }
                }
                if (DBG) {
                    log(sb.toString());
                }
                if (tmpIsVideoCallEnabled != isVideoCallEnabled()) {
                    mPhone.notifyForVideoCapabilityChanged(isVideoCallEnabled());
                }
+0 −1
Original line number Diff line number Diff line
@@ -260,7 +260,6 @@ public class IccCardProxy extends Handler implements IccCard {
                    log("operator=" + operator + " mPhoneId=" + mPhoneId);

                    if (operator != null) {
                        log("update icc_operator_numeric=" + operator);
                        mTelephonyManager.setSimOperatorNumericForPhone(mPhoneId, operator);
                        String countryCode = operator.substring(0,3);
                        if (countryCode != null) {
Loading