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

Commit ed11fe5e authored by Peter Kalauskas's avatar Peter Kalauskas
Browse files

Change name of tracinglib dependency

Also, enable AndroidX test and update references to trace utils.

Flag: ACONFIG com.android.systemui.coroutine_tracing DISABLED
Bug: 289353932
Test: m SystemUI
Change-Id: I5a9c3a6905c59d4e116a96f34ca4a7c870e18959
parent 3b8bcbc9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ android_library {
        "SystemUIUnfoldLib",
        "SystemUISharedLib-Keyguard",
        "WindowManager-Shell-shared",
        "tracinglib",
        "tracinglib-platform",
        "androidx.dynamicanimation_dynamicanimation",
        "androidx.concurrent_concurrent-futures",
        "androidx.lifecycle_lifecycle-runtime-ktx",
+2 −2
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ import com.android.systemui.statusbar.notification.PropertyAnimator
import com.android.systemui.statusbar.notification.stack.AnimationProperties
import com.android.systemui.statusbar.notification.stack.StackStateAnimator
import com.android.systemui.statusbar.policy.KeyguardStateController
import com.android.app.tracing.TraceUtils
import com.android.app.tracing.namedRunnable
import com.android.systemui.util.settings.GlobalSettings
import javax.inject.Inject

@@ -125,7 +125,7 @@ class UnlockedScreenOffAnimationController @Inject constructor(
    }

    // FrameCallback used to delay starting the light reveal animation until the next frame
    private val startLightRevealCallback = TraceUtils.namedRunnable("startLightReveal") {
    private val startLightRevealCallback = namedRunnable("startLightReveal") {
        lightRevealAnimationPlaying = true
        lightRevealAnimator.start()
    }
+5 −5
Original line number Diff line number Diff line
@@ -18,8 +18,8 @@ package com.android.systemui.unfold

import android.content.Context
import android.util.Log
import com.android.app.tracing.TraceUtils.instantForTrack
import com.android.app.tracing.TraceUtils.traceAsync
import com.android.app.tracing.instantForTrack
import com.android.systemui.CoreStartable
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
@@ -172,7 +172,7 @@ constructor(
        fromFoldableDeviceState: Int
    ): DisplaySwitchLatencyEvent {
        log { "fromFoldableDeviceState=$fromFoldableDeviceState" }
        instantForTrack(TAG, "fromFoldableDeviceState=$fromFoldableDeviceState")
        instantForTrack(TAG) { "fromFoldableDeviceState=$fromFoldableDeviceState" }

        return copy(fromFoldableDeviceState = fromFoldableDeviceState)
    }
@@ -187,7 +187,7 @@ constructor(
                "toState=$toState, " +
                "latencyMs=$displaySwitchTimeMs"
        }
        instantForTrack(TAG, "toFoldableDeviceState=$toFoldableDeviceState, toState=$toState")
        instantForTrack(TAG) { "toFoldableDeviceState=$toFoldableDeviceState, toState=$toState" }

        return copy(
            toFoldableDeviceState = toFoldableDeviceState,
+6 −9
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@
 * permissions and limitations under the License.
 */

package com.android.app.tracing
package com.android.systemui.tracing

import android.os.Handler
import android.os.Looper
@@ -20,11 +20,13 @@ import android.os.Trace.TRACE_TAG_APP
import android.testing.AndroidTestingRunner
import android.util.Log
import androidx.test.filters.SmallTest
import com.android.app.tracing.TraceUtils.traceRunnable
import com.android.app.tracing.namedRunnable
import com.android.app.tracing.traceSection
import com.android.systemui.SysuiTestCase
import org.junit.After
import org.junit.Assert.assertThrows
import org.junit.Before
import org.junit.Ignore
import org.junit.Test
import org.junit.runner.RunWith

@@ -68,7 +70,6 @@ class TraceUtilsTest : SysuiTestCase() {
    }

    @Test
    @Ignore("b/267482189 - Enable once androidx.tracing >= 1.2.0-beta04")
    fun testLongTraceSection_doesNotThrow_whenUsingAndroidX() {
        androidx.tracing.Trace.beginSection(SECTION_NAME_THATS_TOO_LONG)
    }
@@ -84,17 +85,13 @@ class TraceUtilsTest : SysuiTestCase() {
    fun testLongTraceSection_doesNotThrow_whenUsedAsTraceNameSupplier() {
        Handler(Looper.getMainLooper())
            .runWithScissors(
                TraceUtils.namedRunnable(SECTION_NAME_THATS_TOO_LONG) {
                    Log.v(TAG, "TraceUtils.namedRunnable() block.")
                },
                namedRunnable(SECTION_NAME_THATS_TOO_LONG) { Log.v(TAG, "namedRunnable() block.") },
                TEST_FAIL_TIMEOUT
            )
    }

    @Test
    fun testLongTraceSection_doesNotThrow_whenUsingTraceRunnable() {
        TraceUtils.traceRunnable(SECTION_NAME_THATS_TOO_LONG) {
            Log.v(TAG, "TraceUtils.traceRunnable() block.")
        }
        traceRunnable(SECTION_NAME_THATS_TOO_LONG) { Log.v(TAG, "traceRunnable() block.") }.run()
    }
}