Merge "Use screen timeout settings of current user." into main
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/CommunalSceneStartableTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/CommunalSceneStartableTest.kt
index ee65fbd..1e86516 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/CommunalSceneStartableTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/CommunalSceneStartableTest.kt
@@ -16,6 +16,7 @@
package com.android.systemui.communal
+import android.os.UserHandle
import android.platform.test.annotations.DisableFlags
import android.platform.test.annotations.EnableFlags
import android.provider.Settings
@@ -77,7 +78,11 @@
@Before
fun setUp() {
with(kosmos) {
- fakeSettings.putInt(Settings.System.SCREEN_OFF_TIMEOUT, SCREEN_TIMEOUT)
+ fakeSettings.putIntForUser(
+ Settings.System.SCREEN_OFF_TIMEOUT,
+ SCREEN_TIMEOUT,
+ UserHandle.USER_CURRENT,
+ )
kosmos.fakeFeatureFlagsClassic.set(COMMUNAL_SERVICE_ENABLED, true)
underTest =
diff --git a/packages/SystemUI/src/com/android/systemui/communal/CommunalSceneStartable.kt b/packages/SystemUI/src/com/android/systemui/communal/CommunalSceneStartable.kt
index 08a7c39..8510915 100644
--- a/packages/SystemUI/src/com/android/systemui/communal/CommunalSceneStartable.kt
+++ b/packages/SystemUI/src/com/android/systemui/communal/CommunalSceneStartable.kt
@@ -16,6 +16,7 @@
package com.android.systemui.communal
+import android.os.UserHandle
import android.provider.Settings
import com.android.compose.animation.scene.SceneKey
import com.android.compose.animation.scene.TransitionKey
@@ -147,9 +148,10 @@
.emitOnStart()
.onEach {
screenTimeout =
- systemSettings.getInt(
+ systemSettings.getIntForUser(
Settings.System.SCREEN_OFF_TIMEOUT,
DEFAULT_SCREEN_TIMEOUT,
+ UserHandle.USER_CURRENT,
)
}
.launchIn(bgScope)