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

Commit 805d1fde authored by Alexander Martinz's avatar Alexander Martinz Committed by Hawkwood Glazier
Browse files

fixup! Add support to configure double line clock in lockscreen [1/2]

Fetch the default value from overlay config which was originally
introduced in aosp/2527300 but was missed out in commit 9282e2c3.

Bug: 277244307
Flag: NONE Minor Bugfix
Test: atest KeyguardClockSwitchControllerTest
Change-Id: Ie8cb62e04b9fbc7f8d42fbefeceb0f7b11c342b1
parent 8558d846
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -16,7 +16,9 @@

package com.android.systemui.keyguard.data.repository

import android.content.res.Resources
import android.provider.Settings
import android.testing.TestableResources
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.keyguard.ClockEventController
@@ -53,9 +55,19 @@ class KeyguardClockRepositoryTest : SysuiTestCase() {
    @Mock private lateinit var clockEventController: ClockEventController
    private val fakeFeatureFlagsClassic = FakeFeatureFlagsClassic()

    @Mock private lateinit var resources: Resources
    private lateinit var testableResources: TestableResources

    @Before
    fun setup() {
        MockitoAnnotations.initMocks(this)

        testableResources = mContext.getOrCreateTestableResources()
        testableResources.addOverride(
            com.android.internal.R.integer.config_doublelineClockDefault,
            1,
        )

        underTest =
            KeyguardClockRepositoryImpl(
                fakeSettings,
+3 −1
Original line number Diff line number Diff line
@@ -160,7 +160,9 @@ constructor(
        return ClockSizeSetting.fromSettingValue(
            secureSettings.getIntForUser(
                Settings.Secure.LOCKSCREEN_USE_DOUBLE_LINE_CLOCK,
                /* defaultValue= */ 1,
                context.resources.getInteger(
                    com.android.internal.R.integer.config_doublelineClockDefault
                ),
                UserHandle.USER_CURRENT,
            )
        )