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

Commit d2c910b4 authored by Caitlin Shkuratov's avatar Caitlin Shkuratov
Browse files

Remove unused arguments from TableLogBuffer.

Bug: 360832989
Flag: EXEMPT refactor
Test: atest TableLogBufferTest TableLogBufferFactoryTest
Change-Id: I06891056166fb20d9eed8961388e3573b8e4300d
parent 5f1c1da0
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -206,8 +206,6 @@ class DeviceEntryFaceAuthRepositoryTest : SysuiTestCase() {
                "face auth",
                systemClock,
                mock(),
                testDispatcher,
                testScope.backgroundScope
            )
        val faceDetectBuffer =
            TableLogBuffer(
@@ -215,8 +213,6 @@ class DeviceEntryFaceAuthRepositoryTest : SysuiTestCase() {
                "face detect",
                systemClock,
                mock(),
                testDispatcher,
                testScope.backgroundScope
            )

        return DeviceEntryFaceAuthRepositoryImpl(
+2 −5
Original line number Diff line number Diff line
@@ -16,19 +16,17 @@

package com.android.systemui.log.table

import android.annotation.SuppressLint
import android.icu.text.SimpleDateFormat
import android.os.Trace
import com.android.systemui.Dumpable
import com.android.systemui.common.buffer.RingBuffer
import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.log.LogcatEchoTracker
import com.android.systemui.log.core.LogLevel
import com.android.systemui.plugins.log.TableLogBufferBase
import com.android.systemui.util.time.SystemClock
import java.io.PrintWriter
import java.util.Locale
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineScope

/**
 * A logger that logs changes in table format.
@@ -75,13 +73,12 @@ import kotlinx.coroutines.CoroutineScope
 *
 * @param maxSize the maximum size of the buffer. Must be > 0.
 */
@SuppressLint("DumpableNotRegistered") // Registered as dumpable in [TableLogBufferFactory]
class TableLogBuffer(
    maxSize: Int,
    private val name: String,
    private val systemClock: SystemClock,
    private val logcatEchoTracker: LogcatEchoTracker,
    @Background private val bgDispatcher: CoroutineDispatcher,
    private val coroutineScope: CoroutineScope,
    private val localLogcat: LogProxy = LogProxyDefault(),
) : Dumpable, TableLogBufferBase {
    init {
+0 −8
Original line number Diff line number Diff line
@@ -17,15 +17,11 @@
package com.android.systemui.log.table

import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.dump.DumpManager
import com.android.systemui.log.LogBufferHelper.Companion.adjustMaxSize
import com.android.systemui.log.LogcatEchoTracker
import com.android.systemui.util.time.SystemClock
import javax.inject.Inject
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineScope

@SysUISingleton
class TableLogBufferFactory
@@ -34,8 +30,6 @@ constructor(
    private val dumpManager: DumpManager,
    private val systemClock: SystemClock,
    private val logcatEchoTracker: LogcatEchoTracker,
    @Background private val bgDispatcher: CoroutineDispatcher,
    @Application private val coroutineScope: CoroutineScope,
) {
    private val existingBuffers = mutableMapOf<String, TableLogBuffer>()

@@ -58,8 +52,6 @@ constructor(
                name,
                systemClock,
                logcatEchoTracker,
                bgDispatcher,
                coroutineScope,
            )
        dumpManager.registerTableLogBuffer(name, tableBuffer)
        return tableBuffer
+0 −2
Original line number Diff line number Diff line
@@ -58,8 +58,6 @@ class LogDiffsForTableTest : SysuiTestCase() {
                BUFFER_NAME,
                systemClock,
                mock(),
                testDispatcher,
                testScope.backgroundScope,
            )
    }

+2 −9
Original line number Diff line number Diff line
@@ -20,25 +20,18 @@ import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.dump.DumpManager
import com.android.systemui.util.mockito.mock
import com.android.systemui.util.time.FakeSystemClock
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.TestScope
import kotlinx.coroutines.test.UnconfinedTestDispatcher
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.kotlin.mock

@OptIn(ExperimentalCoroutinesApi::class)
@SmallTest
@RunWith(AndroidJUnit4::class)
class TableLogBufferFactoryTest : SysuiTestCase() {
    private val dumpManager: DumpManager = mock()
    private val systemClock = FakeSystemClock()
    private val testDispatcher = UnconfinedTestDispatcher()
    private val testScope = TestScope(testDispatcher)
    private val underTest =
        TableLogBufferFactory(dumpManager, systemClock, mock(), testDispatcher, testScope)
    private val underTest = TableLogBufferFactory(dumpManager, systemClock, mock())

    @Test
    fun create_alwaysCreatesNewInstance() {
Loading