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

Commit c878feff authored by Brad Hinegardner's avatar Brad Hinegardner
Browse files

User should be able to change clocks without crash

Add explicit secondary constructor to LogcatOnlyMessageBuffer

Fixes: 420354472
Test: manual -- test changing clocks on userdebug build
Flag: NONE bugfix
Change-Id: Ie95479bce5f7e716be40ae64bae9cee8dce8e2a3
parent 59177e64
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -27,14 +27,14 @@ import kotlin.collections.ArrayDeque
 * immediately. This defeats the intention behind [LogBuffer] and should only be used when
 * [LogBuffer]s are unavailable in a certain context.
 */
class LogcatOnlyMessageBuffer
@JvmOverloads
constructor(
class LogcatOnlyMessageBuffer(
    private val targetLogLevel: LogLevel,
    private val maxMessageCount: Int = DEFAULT_MESSAGE_MAX_COUNT,
    private val maxMessageCount: Int,
): MessageBuffer {
    private val messages = ArrayDeque<LogMessageImpl>(maxMessageCount)

    constructor(targetLogLevel: LogLevel) : this(targetLogLevel, DEFAULT_MESSAGE_MAX_COUNT)

    override fun obtain(
        tag: String,
        level: LogLevel,
@@ -65,6 +65,6 @@ constructor(
    }

    companion object {
        val DEFAULT_MESSAGE_MAX_COUNT = 4
        private const val DEFAULT_MESSAGE_MAX_COUNT = 4
    }
}