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

Commit 0a2d5cf7 authored by Mukesh Agrawal's avatar Mukesh Agrawal Committed by android-build-merger
Browse files

Merge "StateMachine: add getLogRecMaxSize()"

am: 22e43471

Change-Id: Iaab7955c0721e240487e8c842e994c90141d6013
parents c878255b 22e43471
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -23,6 +23,8 @@ import android.os.Message;
import android.text.TextUtils;
import android.util.Log;

import com.android.internal.annotations.VisibleForTesting;

import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.io.StringWriter;
@@ -1495,7 +1497,7 @@ public class StateMachine {
    }

    /**
     * @return number of log records
     * @return the number of log records currently readable
     */
    public final int getLogRecSize() {
        // mSmHandler can be null if the state machine has quit.
@@ -1504,6 +1506,17 @@ public class StateMachine {
        return smh.mLogRecords.size();
    }

    /**
     * @return the number of log records we can store
     */
    @VisibleForTesting
    public final int getLogRecMaxSize() {
        // mSmHandler can be null if the state machine has quit.
        SmHandler smh = mSmHandler;
        if (smh == null) return 0;
        return smh.mLogRecords.mMaxSize;
    }

    /**
     * @return the total number of records processed
     */