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

Commit 945b3ff7 authored by Caitlin Shkuratov's avatar Caitlin Shkuratov
Browse files

[Pod] Move LogProxy interface to pod.

Does this by:
1) Moving LogProxy to log/ instead of log/table since it's not
   table-specific.
2) Moving LogProxy to pods/ instead of src/.
3) Moves the impl (LogProxyDefault) to impl/ and reduces usage of that
impl.
4) Moves the fake to tests/utils instead of multivalentTests/.

This CL is a pre-req for moving TableLogBuffer's impl to a pod.

Bug: 307607958
Flag: EXEMPT refactor
Test: build sysui, `adb shell cmd statusbar echo -b WifiTableLog:v`,
toggle wifi -> verify WifiTableLog shows up in logcat
Test: m SystemUI-application
Test: atest LogDiffsForTableTest TableLogBufferFactoryImplTest

Change-Id: Ibc06a84c03175358c3b13e9160cc7be08363e4ad
parent 41abc210
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.systemui.log.table
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.log.FakeLogProxy
import com.android.systemui.log.LogcatEchoTrackerAlways
import com.android.systemui.log.table.TableChange.Companion.IS_INITIAL_PREFIX
import com.android.systemui.util.time.FakeSystemClock
@@ -51,7 +52,13 @@ class LogDiffsForTableTest : SysuiTestCase() {
    fun setUp() {
        systemClock = FakeSystemClock()
        tableLogBuffer =
            TableLogBufferImpl(MAX_SIZE, BUFFER_NAME, systemClock, LogcatEchoTrackerAlways())
            TableLogBufferImpl(
                MAX_SIZE,
                BUFFER_NAME,
                systemClock,
                LogcatEchoTrackerAlways(),
                localLogcat = FakeLogProxy(),
            )
    }

    // ---- Flow<Boolean> tests ----
+1 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.systemui.log.table
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.log.FakeLogProxy
import com.android.systemui.log.LogcatEchoTracker
import com.android.systemui.log.core.LogLevel
import com.android.systemui.log.table.TableChange.Companion.IS_INITIAL_PREFIX
+7 −1
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ 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.log.FakeLogProxy
import com.android.systemui.log.LogcatEchoTrackerAlways
import com.android.systemui.util.time.FakeSystemClock
import com.google.common.truth.Truth.assertThat
@@ -33,7 +34,12 @@ class TableLogBufferFactoryImplTest : SysuiTestCase() {
    private val dumpManager: DumpManager = mock()
    private val systemClock = FakeSystemClock()
    private val underTest =
        TableLogBufferFactoryImpl(dumpManager, systemClock, LogcatEchoTrackerAlways())
        TableLogBufferFactoryImpl(
            dumpManager,
            systemClock,
            LogcatEchoTrackerAlways(),
            logProxy = FakeLogProxy(),
        )

    @Test
    fun create_alwaysCreatesNewInstance() {
+1 −0
Original line number Diff line number Diff line
@@ -63,6 +63,7 @@ java_library {
    name: "com.android.systemui.pods-api-aosp-handheld",
    static_libs: [
        "com.android.systemui.dagger-api",
        "com.android.systemui.log-api",
        "com.android.systemui.log.table-api",
        "com.android.systemui.retail-impl",
        "com.android.systemui.retail.data-api",
+29 −0
Original line number Diff line number Diff line
//
// Copyright (C) 2025 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

package {
    default_applicable_licenses: ["frameworks_base_packages_SystemUI_license"],
}

java_library {
    name: "com.android.systemui.log-api",
    srcs: [
        "*.kt",
    ],
    defaults: [
        "SystemUI_pod_defaults_api",
    ],
}
Loading