Loading aconfig/systemui.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -41,3 +41,10 @@ flag { purpose: PURPOSE_BUGFIX } } flag { name: "new_touchpad_gestures_tutorial" namespace: "systemui" description: "Enables new interactive tutorial for learning touchpad gestures" bug: "309928033" } compilelib/Android.bp +3 −0 Original line number Diff line number Diff line Loading @@ -44,4 +44,7 @@ java_library { exclude_srcs: [":compilelib-ReleaseJavaFiles"], }, }, sdk_version: "31", min_sdk_version: "19", java_version: "17", } tracinglib/core/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ java_library { static_libs: [ "kotlinx_coroutines_android", "com_android_systemui_flags_lib", "//frameworks/libs/systemui:compilelib", ], srcs: ["android/src-platform-api/**/*.kt"], } Loading @@ -32,6 +33,7 @@ java_library { static_libs: [ "kotlinx_coroutines_android", "com_android_systemui_flags_lib", "//frameworks/libs/systemui:compilelib", "androidx.tracing_tracing", ], srcs: ["android/src-public-api/**/*.kt"], Loading tracinglib/core/common/src/coroutines/TraceContextElement.kt +7 −3 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.app.tracing.coroutines import com.android.systemui.Flags.coroutineTracing import com.android.systemui.util.Compile import kotlin.coroutines.CoroutineContext import kotlin.coroutines.EmptyCoroutineContext import kotlinx.coroutines.CopyableThreadContextElement Loading Loading @@ -47,8 +48,11 @@ private inline fun debug(message: () -> String) { /** * Returns a new [CoroutineContext] used for tracing. Used to hide internal implementation details. */ fun createCoroutineTracingContext(): CoroutineContext { return if (coroutineTracing()) TraceContextElement(TraceData()) else EmptyCoroutineContext fun createCoroutineTracingContext(): CoroutineContext = if (Compile.IS_DEBUG && coroutineTracing()) { TraceContextElement(TraceData()) } else { EmptyCoroutineContext } /** Loading tracinglib/core/host/src-fake/Compile.fake.kt 0 → 100644 +22 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 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 com.android.systemui.util @Suppress("UNUSED_PARAMETER") object Compile { const val IS_DEBUG = true } Loading
aconfig/systemui.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -41,3 +41,10 @@ flag { purpose: PURPOSE_BUGFIX } } flag { name: "new_touchpad_gestures_tutorial" namespace: "systemui" description: "Enables new interactive tutorial for learning touchpad gestures" bug: "309928033" }
compilelib/Android.bp +3 −0 Original line number Diff line number Diff line Loading @@ -44,4 +44,7 @@ java_library { exclude_srcs: [":compilelib-ReleaseJavaFiles"], }, }, sdk_version: "31", min_sdk_version: "19", java_version: "17", }
tracinglib/core/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ java_library { static_libs: [ "kotlinx_coroutines_android", "com_android_systemui_flags_lib", "//frameworks/libs/systemui:compilelib", ], srcs: ["android/src-platform-api/**/*.kt"], } Loading @@ -32,6 +33,7 @@ java_library { static_libs: [ "kotlinx_coroutines_android", "com_android_systemui_flags_lib", "//frameworks/libs/systemui:compilelib", "androidx.tracing_tracing", ], srcs: ["android/src-public-api/**/*.kt"], Loading
tracinglib/core/common/src/coroutines/TraceContextElement.kt +7 −3 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.app.tracing.coroutines import com.android.systemui.Flags.coroutineTracing import com.android.systemui.util.Compile import kotlin.coroutines.CoroutineContext import kotlin.coroutines.EmptyCoroutineContext import kotlinx.coroutines.CopyableThreadContextElement Loading Loading @@ -47,8 +48,11 @@ private inline fun debug(message: () -> String) { /** * Returns a new [CoroutineContext] used for tracing. Used to hide internal implementation details. */ fun createCoroutineTracingContext(): CoroutineContext { return if (coroutineTracing()) TraceContextElement(TraceData()) else EmptyCoroutineContext fun createCoroutineTracingContext(): CoroutineContext = if (Compile.IS_DEBUG && coroutineTracing()) { TraceContextElement(TraceData()) } else { EmptyCoroutineContext } /** Loading
tracinglib/core/host/src-fake/Compile.fake.kt 0 → 100644 +22 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 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 com.android.systemui.util @Suppress("UNUSED_PARAMETER") object Compile { const val IS_DEBUG = true }