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

Commit 57a34e17 authored by Bryce Lee's avatar Bryce Lee
Browse files

Use screen timeout settings of current user.

This changelist updates fetching screen timeout settings by asking
for the current user's setting.

Fixes: 369489115
Test: atest CommunalSceneStartableTest
Flag: EXEMPT bugfix
Change-Id: I901386dc01d2c84a61d748929ae1370a69dc2727
parent 853186b4
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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 @@ class CommunalSceneStartableTest : SysuiTestCase() {
    @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 =
+3 −1
Original line number Diff line number Diff line
@@ -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 @@ constructor(
            .emitOnStart()
            .onEach {
                screenTimeout =
                    systemSettings.getInt(
                    systemSettings.getIntForUser(
                        Settings.System.SCREEN_OFF_TIMEOUT,
                        DEFAULT_SCREEN_TIMEOUT,
                        UserHandle.USER_CURRENT,
                    )
            }
            .launchIn(bgScope)