Loading packages/SystemUI/src/com/android/systemui/shade/ShadeStateTraceLogger.kt +30 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.shade import android.content.Context import com.android.app.tracing.TraceStateLogger import com.android.app.tracing.TrackGroupUtils.trackGroup import com.android.app.tracing.coroutines.TrackTracer.Companion.instantForGroup Loading @@ -26,6 +27,7 @@ import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.log.LogBuffer import com.android.systemui.log.core.LogLevel import com.android.systemui.shade.LargeScreenHeaderHelper.Companion.getLargeScreenHeaderHeight import com.android.systemui.shade.data.repository.ShadeDisplaysRepository import com.android.systemui.shade.domain.interactor.ShadeInteractor import com.android.systemui.shade.domain.interactor.ShadeModeInteractor Loading @@ -33,6 +35,8 @@ import com.android.systemui.shade.shared.flag.ShadeWindowGoesAround import dagger.Lazy import javax.inject.Inject import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.map import kotlinx.coroutines.launch @SysUISingleton Loading @@ -45,9 +49,10 @@ constructor( @ShadeDisplayAware private val configurationRepository: ConfigurationRepository, @Application private val scope: CoroutineScope, @ShadeDisplayLog private val logBuffer: LogBuffer, @ShadeDisplayAware private val context: Context, ) : CoreStartable { override fun start() { scope.launchTraced("ShadeStateTraceLogger") { scope.launchTraced(TAG) { launch { val stateLogger = createTraceStateLogger("isFullWidthShade") shadeModeInteractor.isFullWidthShade.collect { stateLogger.log(it.toString()) } Loading Loading @@ -76,7 +81,7 @@ constructor( it.smallestScreenWidthDp, ) logBuffer.log( "ShadeStateTraceLogger", TAG, LogLevel.DEBUG, { int1 = it.smallestScreenWidthDp Loading @@ -89,6 +94,28 @@ constructor( ) } } launch { configurationRepository.onAnyConfigurationChange .map { getLargeScreenHeaderHeight(context) to context.displayId } .distinctUntilChanged() .collect { (largeScreenHeaderHeight, displayId) -> instantForGroup( TRACK_GROUP_NAME, "shadeHeaderHeight", largeScreenHeaderHeight, ) logBuffer.log( TAG, LogLevel.DEBUG, { int1 = largeScreenHeaderHeight int1 = displayId }, { "New shadeHeaderHeight: $int1, displayId: $int2" }, ) } } } } Loading @@ -98,5 +125,6 @@ constructor( private companion object { const val TRACK_GROUP_NAME = "shade" const val TAG = "ShadeStateTraceLogger" } } packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeDisplaysInteractor.kt +9 −0 Original line number Diff line number Diff line Loading @@ -147,6 +147,15 @@ constructor( } checkContextDisplayMatchesExpected(destinationId) shadePositionRepository.onDisplayChangedSucceeded(destinationId) logBuffer.log( TAG, LogLevel.DEBUG, { int1 = currentId int2 = destinationId }, { "Shade window successfully moved from display $int1 to $int2" }, ) } } } catch (e: IllegalStateException) { Loading Loading
packages/SystemUI/src/com/android/systemui/shade/ShadeStateTraceLogger.kt +30 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.shade import android.content.Context import com.android.app.tracing.TraceStateLogger import com.android.app.tracing.TrackGroupUtils.trackGroup import com.android.app.tracing.coroutines.TrackTracer.Companion.instantForGroup Loading @@ -26,6 +27,7 @@ import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.log.LogBuffer import com.android.systemui.log.core.LogLevel import com.android.systemui.shade.LargeScreenHeaderHelper.Companion.getLargeScreenHeaderHeight import com.android.systemui.shade.data.repository.ShadeDisplaysRepository import com.android.systemui.shade.domain.interactor.ShadeInteractor import com.android.systemui.shade.domain.interactor.ShadeModeInteractor Loading @@ -33,6 +35,8 @@ import com.android.systemui.shade.shared.flag.ShadeWindowGoesAround import dagger.Lazy import javax.inject.Inject import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.map import kotlinx.coroutines.launch @SysUISingleton Loading @@ -45,9 +49,10 @@ constructor( @ShadeDisplayAware private val configurationRepository: ConfigurationRepository, @Application private val scope: CoroutineScope, @ShadeDisplayLog private val logBuffer: LogBuffer, @ShadeDisplayAware private val context: Context, ) : CoreStartable { override fun start() { scope.launchTraced("ShadeStateTraceLogger") { scope.launchTraced(TAG) { launch { val stateLogger = createTraceStateLogger("isFullWidthShade") shadeModeInteractor.isFullWidthShade.collect { stateLogger.log(it.toString()) } Loading Loading @@ -76,7 +81,7 @@ constructor( it.smallestScreenWidthDp, ) logBuffer.log( "ShadeStateTraceLogger", TAG, LogLevel.DEBUG, { int1 = it.smallestScreenWidthDp Loading @@ -89,6 +94,28 @@ constructor( ) } } launch { configurationRepository.onAnyConfigurationChange .map { getLargeScreenHeaderHeight(context) to context.displayId } .distinctUntilChanged() .collect { (largeScreenHeaderHeight, displayId) -> instantForGroup( TRACK_GROUP_NAME, "shadeHeaderHeight", largeScreenHeaderHeight, ) logBuffer.log( TAG, LogLevel.DEBUG, { int1 = largeScreenHeaderHeight int1 = displayId }, { "New shadeHeaderHeight: $int1, displayId: $int2" }, ) } } } } Loading @@ -98,5 +125,6 @@ constructor( private companion object { const val TRACK_GROUP_NAME = "shade" const val TAG = "ShadeStateTraceLogger" } }
packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeDisplaysInteractor.kt +9 −0 Original line number Diff line number Diff line Loading @@ -147,6 +147,15 @@ constructor( } checkContextDisplayMatchesExpected(destinationId) shadePositionRepository.onDisplayChangedSucceeded(destinationId) logBuffer.log( TAG, LogLevel.DEBUG, { int1 = currentId int2 = destinationId }, { "Shade window successfully moved from display $int1 to $int2" }, ) } } } catch (e: IllegalStateException) { Loading