Loading packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/BouncerInteractor.kt +3 −0 Original line number Diff line number Diff line Loading @@ -127,10 +127,12 @@ constructor( repository.setMessage(message ?: promptMessage(getAuthenticationMethod())) sceneInteractor.setCurrentScene( scene = SceneModel(SceneKey.Bouncer), loggingReason = "request to unlock device while authentication required", ) } else { sceneInteractor.setCurrentScene( scene = SceneModel(SceneKey.Gone), loggingReason = "request to unlock device while authentication isn't required", ) } } Loading Loading @@ -176,6 +178,7 @@ constructor( if (isAuthenticated) { sceneInteractor.setCurrentScene( scene = SceneModel(SceneKey.Gone), loggingReason = "successful authentication", ) } else { repository.setMessage(errorMessage(getAuthenticationMethod())) Loading packages/SystemUI/src/com/android/systemui/log/dagger/LogModule.java +8 −0 Original line number Diff line number Diff line Loading @@ -496,4 +496,12 @@ public class LogModule { public static LogBuffer provideDisplayMetricsRepoLogBuffer(LogBufferFactory factory) { return factory.create("DisplayMetricsRepo", 50); } /** Provides a {@link LogBuffer} for the scene framework. */ @Provides @SysUISingleton @SceneFrameworkLog public static LogBuffer provideSceneFrameworkLogBuffer(LogBufferFactory factory) { return factory.create("SceneFramework", 50); } } packages/SystemUI/src/com/android/systemui/log/dagger/SceneFrameworkLog.kt 0 → 100644 +25 −0 Original line number Diff line number Diff line /* * Copyright (C) 2023 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.log.dagger import javax.inject.Qualifier /** A [com.android.systemui.log.LogBuffer] for the Scene Framework. */ @Qualifier @MustBeDocumented @Retention(AnnotationRetention.RUNTIME) annotation class SceneFrameworkLog packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java +1 −1 Original line number Diff line number Diff line Loading @@ -220,7 +220,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis // If scene framework is enabled, set the scene container window to // visible and let the touch "slip" into that window. if (mFeatureFlags.isEnabled(Flags.SCENE_CONTAINER)) { mSceneInteractor.get().setVisible(true); mSceneInteractor.get().setVisible(true, "swipe down on launcher"); } else { centralSurfaces.onInputFocusTransfer( mInputFocusTransferStarted, false /* cancel */, Loading packages/SystemUI/src/com/android/systemui/scene/domain/interactor/SceneInteractor.kt +23 −2 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.systemui.scene.domain.interactor import com.android.systemui.dagger.SysUISingleton import com.android.systemui.scene.data.repository.SceneContainerRepository import com.android.systemui.scene.shared.logger.SceneLogger import com.android.systemui.scene.shared.model.ObservableTransitionState import com.android.systemui.scene.shared.model.RemoteUserInput import com.android.systemui.scene.shared.model.SceneKey Loading @@ -41,6 +42,7 @@ class SceneInteractor @Inject constructor( private val repository: SceneContainerRepository, private val logger: SceneLogger, ) { /** Loading @@ -54,8 +56,17 @@ constructor( } /** Sets the scene in the container with the given name. */ fun setCurrentScene(scene: SceneModel) { fun setCurrentScene(scene: SceneModel, loggingReason: String) { val currentSceneKey = repository.currentScene.value.key if (currentSceneKey == scene.key) { return } logger.logSceneChange( from = currentSceneKey, to = scene.key, reason = loggingReason, ) repository.setCurrentScene(scene) repository.setSceneTransition(from = currentSceneKey, to = scene.key) } Loading @@ -64,7 +75,17 @@ constructor( val currentScene: StateFlow<SceneModel> = repository.currentScene /** Sets the visibility of the container with the given name. */ fun setVisible(isVisible: Boolean) { fun setVisible(isVisible: Boolean, loggingReason: String) { val wasVisible = repository.isVisible.value if (wasVisible == isVisible) { return } logger.logVisibilityChange( from = wasVisible, to = isVisible, reason = loggingReason, ) return repository.setVisible(isVisible) } Loading Loading
packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/BouncerInteractor.kt +3 −0 Original line number Diff line number Diff line Loading @@ -127,10 +127,12 @@ constructor( repository.setMessage(message ?: promptMessage(getAuthenticationMethod())) sceneInteractor.setCurrentScene( scene = SceneModel(SceneKey.Bouncer), loggingReason = "request to unlock device while authentication required", ) } else { sceneInteractor.setCurrentScene( scene = SceneModel(SceneKey.Gone), loggingReason = "request to unlock device while authentication isn't required", ) } } Loading Loading @@ -176,6 +178,7 @@ constructor( if (isAuthenticated) { sceneInteractor.setCurrentScene( scene = SceneModel(SceneKey.Gone), loggingReason = "successful authentication", ) } else { repository.setMessage(errorMessage(getAuthenticationMethod())) Loading
packages/SystemUI/src/com/android/systemui/log/dagger/LogModule.java +8 −0 Original line number Diff line number Diff line Loading @@ -496,4 +496,12 @@ public class LogModule { public static LogBuffer provideDisplayMetricsRepoLogBuffer(LogBufferFactory factory) { return factory.create("DisplayMetricsRepo", 50); } /** Provides a {@link LogBuffer} for the scene framework. */ @Provides @SysUISingleton @SceneFrameworkLog public static LogBuffer provideSceneFrameworkLogBuffer(LogBufferFactory factory) { return factory.create("SceneFramework", 50); } }
packages/SystemUI/src/com/android/systemui/log/dagger/SceneFrameworkLog.kt 0 → 100644 +25 −0 Original line number Diff line number Diff line /* * Copyright (C) 2023 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.log.dagger import javax.inject.Qualifier /** A [com.android.systemui.log.LogBuffer] for the Scene Framework. */ @Qualifier @MustBeDocumented @Retention(AnnotationRetention.RUNTIME) annotation class SceneFrameworkLog
packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java +1 −1 Original line number Diff line number Diff line Loading @@ -220,7 +220,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis // If scene framework is enabled, set the scene container window to // visible and let the touch "slip" into that window. if (mFeatureFlags.isEnabled(Flags.SCENE_CONTAINER)) { mSceneInteractor.get().setVisible(true); mSceneInteractor.get().setVisible(true, "swipe down on launcher"); } else { centralSurfaces.onInputFocusTransfer( mInputFocusTransferStarted, false /* cancel */, Loading
packages/SystemUI/src/com/android/systemui/scene/domain/interactor/SceneInteractor.kt +23 −2 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.systemui.scene.domain.interactor import com.android.systemui.dagger.SysUISingleton import com.android.systemui.scene.data.repository.SceneContainerRepository import com.android.systemui.scene.shared.logger.SceneLogger import com.android.systemui.scene.shared.model.ObservableTransitionState import com.android.systemui.scene.shared.model.RemoteUserInput import com.android.systemui.scene.shared.model.SceneKey Loading @@ -41,6 +42,7 @@ class SceneInteractor @Inject constructor( private val repository: SceneContainerRepository, private val logger: SceneLogger, ) { /** Loading @@ -54,8 +56,17 @@ constructor( } /** Sets the scene in the container with the given name. */ fun setCurrentScene(scene: SceneModel) { fun setCurrentScene(scene: SceneModel, loggingReason: String) { val currentSceneKey = repository.currentScene.value.key if (currentSceneKey == scene.key) { return } logger.logSceneChange( from = currentSceneKey, to = scene.key, reason = loggingReason, ) repository.setCurrentScene(scene) repository.setSceneTransition(from = currentSceneKey, to = scene.key) } Loading @@ -64,7 +75,17 @@ constructor( val currentScene: StateFlow<SceneModel> = repository.currentScene /** Sets the visibility of the container with the given name. */ fun setVisible(isVisible: Boolean) { fun setVisible(isVisible: Boolean, loggingReason: String) { val wasVisible = repository.isVisible.value if (wasVisible == isVisible) { return } logger.logVisibilityChange( from = wasVisible, to = isVisible, reason = loggingReason, ) return repository.setVisible(isVisible) } Loading