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

Commit e78b5710 authored by Stefan Andonian's avatar Stefan Andonian Committed by Automerger Merge Worker
Browse files

Merge "Stop enabling the Boot Aware Launcher prefs code during Tests after...

Merge "Stop enabling the Boot Aware Launcher prefs code during Tests after running LauncherPref unit tests." into tm-qpr-dev am: acaecb65

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/22163308



Change-Id: I63c1ea9e14474d3b4fdd4cb6974246ce021a54df
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents dc3e4c97 acaecb65
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -36,6 +36,8 @@ import com.android.launcher3.util.Themes
 * Use same context for shared preferences, so that we use a single cached instance
 *
 * TODO(b/262721340): Replace all direct SharedPreference refs with LauncherPrefs / Item methods.
 * TODO(b/274501660): Fix ReorderWidgets#simpleReorder test before enabling
 *   isBootAwareStartupDataEnabled
 */
class LauncherPrefs(private val encryptedContext: Context) {
    private val deviceProtectedStorageContext =
+14 −2
Original line number Diff line number Diff line
@@ -25,6 +25,8 @@ import com.android.launcher3.LauncherPrefs.Companion.BOOT_AWARE_PREFS_KEY
import com.google.common.truth.Truth.assertThat
import java.util.concurrent.CountDownLatch
import java.util.concurrent.TimeUnit
import org.junit.AfterClass
import org.junit.BeforeClass
import org.junit.Test
import org.junit.runner.RunWith

@@ -45,10 +47,20 @@ class LauncherPrefsTest {
    private val context by lazy { InstrumentationRegistry.getInstrumentation().targetContext }
    private val launcherPrefs by lazy { LauncherPrefs.get(context) }

    init {
    companion object {
        @BeforeClass
        @JvmStatic
        fun setup() {
            isBootAwareStartupDataEnabled = true
        }

        @AfterClass
        @JvmStatic
        fun teardown() {
            isBootAwareStartupDataEnabled = false
        }
    }

    @Test
    fun has_keyMissingFromLauncherPrefs_returnsFalse() {
        assertThat(launcherPrefs.has(TEST_BOOLEAN_ITEM)).isFalse()