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

Commit 7ca64289 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Make UiccController's local log bigger on debuggable builds." into...

Merge "Make UiccController's local log bigger on debuggable builds." into rvc-dev am: 166c04f0 am: 49214baf am: 07710866

Change-Id: If29debc21ae5d3eb32c62ed401fc72396fed84f6
parents 02e25e8a 07710866
Loading
Loading
Loading
Loading
+2 −4
Original line number Original line Diff line number Diff line
@@ -377,11 +377,9 @@ public class CatService extends Handler implements AppInterface {


        // Log all proactive commands.
        // Log all proactive commands.
        if (isProactiveCmd) {
        if (isProactiveCmd) {
            if (mUiccController != null) {
            UiccController.addLocalLog("CatService[" + mSlotId + "]: ProactiveCommand " +
                mUiccController.addCardLog("ProactiveCommand mSlotId=" + mSlotId +
                    " cmdParams=" + cmdParams);
                    " cmdParams=" + cmdParams);
        }
        }
        }


        CharSequence message;
        CharSequence message;
        ResultCode resultCode;
        ResultCode resultCode;
+13 −12
Original line number Original line Diff line number Diff line
@@ -49,6 +49,7 @@ import com.android.internal.telephony.PhoneFactory;
import com.android.internal.telephony.RadioConfig;
import com.android.internal.telephony.RadioConfig;
import com.android.internal.telephony.SubscriptionInfoUpdater;
import com.android.internal.telephony.SubscriptionInfoUpdater;
import com.android.internal.telephony.uicc.euicc.EuiccCard;
import com.android.internal.telephony.uicc.euicc.EuiccCard;
import com.android.internal.telephony.util.TelephonyUtils;
import com.android.telephony.Rlog;
import com.android.telephony.Rlog;


import java.io.FileDescriptor;
import java.io.FileDescriptor;
@@ -189,7 +190,7 @@ public class UiccController extends Handler {
    private RadioConfig mRadioConfig;
    private RadioConfig mRadioConfig;


    // LocalLog buffer to hold important SIM related events for debugging
    // LocalLog buffer to hold important SIM related events for debugging
    static LocalLog sLocalLog = new LocalLog(100);
    private static LocalLog sLocalLog = new LocalLog(TelephonyUtils.IS_DEBUGGABLE ? 250 : 100);


    /**
    /**
     * API to make UiccController singleton if not already created.
     * API to make UiccController singleton if not already created.
@@ -886,14 +887,11 @@ public class UiccController extends Handler {
        }
        }
        Throwable e = ar.exception;
        Throwable e = ar.exception;
        if (e != null) {
        if (e != null) {
            String logStr;
            if (!(e instanceof CommandException) || ((CommandException) e).getCommandError()
            if (!(e instanceof CommandException) || ((CommandException) e).getCommandError()
                    != CommandException.Error.REQUEST_NOT_SUPPORTED) {
                    != CommandException.Error.REQUEST_NOT_SUPPORTED) {
                // this is not expected; there should be no exception other than
                // this is not expected; there should be no exception other than
                // REQUEST_NOT_SUPPORTED
                // REQUEST_NOT_SUPPORTED
                logStr = "Unexpected error getting slot status: " + ar.exception;
                logeWithLocalLog("Unexpected error getting slot status: " + ar.exception);
                Rlog.e(LOG_TAG, logStr);
                sLocalLog.log(logStr);
            } else {
            } else {
                // REQUEST_NOT_SUPPORTED
                // REQUEST_NOT_SUPPORTED
                logWithLocalLog("onGetSlotStatusDone: request not supported; marking "
                logWithLocalLog("onGetSlotStatusDone: request not supported; marking "
@@ -920,10 +918,8 @@ public class UiccController extends Handler {


        int numSlots = status.size();
        int numSlots = status.size();
        if (mUiccSlots.length < numSlots) {
        if (mUiccSlots.length < numSlots) {
            String logStr = "The number of the physical slots reported " + numSlots
            logeWithLocalLog("The number of the physical slots reported " + numSlots
                    + " is greater than the expectation " + mUiccSlots.length + ".";
                    + " is greater than the expectation " + mUiccSlots.length);
            Rlog.e(LOG_TAG, logStr);
            sLocalLog.log(logStr);
            numSlots = mUiccSlots.length;
            numSlots = mUiccSlots.length;
        }
        }


@@ -937,7 +933,6 @@ public class UiccController extends Handler {
                if (!isValidPhoneIndex(iss.logicalSlotIndex)) {
                if (!isValidPhoneIndex(iss.logicalSlotIndex)) {
                    Rlog.e(LOG_TAG, "Skipping slot " + i + " as phone " + iss.logicalSlotIndex
                    Rlog.e(LOG_TAG, "Skipping slot " + i + " as phone " + iss.logicalSlotIndex
                               + " is not available to communicate with this slot");
                               + " is not available to communicate with this slot");

                } else {
                } else {
                    mPhoneIdToSlotId[iss.logicalSlotIndex] = i;
                    mPhoneIdToSlotId[iss.logicalSlotIndex] = i;
                }
                }
@@ -1204,10 +1199,16 @@ public class UiccController extends Handler {


    private void logWithLocalLog(String string) {
    private void logWithLocalLog(String string) {
        Rlog.d(LOG_TAG, string);
        Rlog.d(LOG_TAG, string);
        sLocalLog.log(string);
        sLocalLog.log("UiccController: " + string);
    }

    private void logeWithLocalLog(String string) {
        Rlog.e(LOG_TAG, string);
        sLocalLog.log("UiccController: " + string);
    }
    }


    public void addCardLog(String data) {
    /** The supplied log should also indicate the caller to avoid ambiguity. */
    public static void addLocalLog(String data) {
        sLocalLog.log(data);
        sLocalLog.log(data);
    }
    }


+1 −1
Original line number Original line Diff line number Diff line
@@ -1726,7 +1726,7 @@ public class UiccProfile extends IccCard {


    private void logWithLocalLog(String msg) {
    private void logWithLocalLog(String msg) {
        Rlog.d(LOG_TAG, msg);
        Rlog.d(LOG_TAG, msg);
        if (DBG) UiccController.sLocalLog.log("UiccProfile[" + mPhoneId + "]: " + msg);
        if (DBG) UiccController.addLocalLog("UiccProfile[" + mPhoneId + "]: " + msg);
    }
    }


    /**
    /**