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

Commit f06ada42 authored by Brad Hinegardner's avatar Brad Hinegardner Committed by Android Build Coastguard Worker
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
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:c878feffbc5df25b5da227b5f432cec8c1b05215)
Merged-In: Ie95479bce5f7e716be40ae64bae9cee8dce8e2a3
Change-Id: Ie95479bce5f7e716be40ae64bae9cee8dce8e2a3
parent 1e7445ff
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
    }
}