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

Commit 0454d096 authored by Jernej Virag's avatar Jernej Virag Committed by Android (Google) Code Review
Browse files

Merge "Provide consistent testDispatcher for Kosmos injected Settings" into main

parents a3b4d0d9 c2b94333
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -38,6 +38,11 @@ public class FakeGlobalSettings implements GlobalSettings {

    public static final Uri CONTENT_URI = Uri.parse("content://settings/fake_global");

    /**
     * @deprecated Please use FakeGlobalSettings(testDispatcher) to provide the same dispatcher used
     * by main test scope.
     */
    @Deprecated
    public FakeGlobalSettings() {
        mDispatcher = StandardTestDispatcher(/* scheduler = */ null, /* name = */ null);
    }
+2 −1
Original line number Diff line number Diff line
@@ -18,5 +18,6 @@ package com.android.systemui.util.settings

import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.Kosmos.Fixture
import com.android.systemui.kosmos.testDispatcher

val Kosmos.fakeGlobalSettings: FakeGlobalSettings by Fixture { FakeGlobalSettings() }
val Kosmos.fakeGlobalSettings: FakeGlobalSettings by Fixture { FakeGlobalSettings(testDispatcher) }
+5 −0
Original line number Diff line number Diff line
@@ -50,6 +50,11 @@ public class FakeSettings implements SecureSettings, SystemSettings {
    @UserIdInt
    private int mUserId = UserHandle.USER_CURRENT;

    /**
     * @deprecated Please use FakeSettings(testDispatcher) to provide the same dispatcher used
     * by main test scope.
     */
    @Deprecated
    public FakeSettings() {
        mDispatcher = StandardTestDispatcher(/* scheduler = */ null, /* name = */ null);
        mUserTracker = new FakeUserTracker();
+3 −1
Original line number Diff line number Diff line
@@ -18,5 +18,7 @@ package com.android.systemui.util.settings

import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.Kosmos.Fixture
import com.android.systemui.kosmos.testDispatcher
import com.android.systemui.settings.fakeUserTracker

val Kosmos.fakeSettings: FakeSettings by Fixture { FakeSettings() }
val Kosmos.fakeSettings: FakeSettings by Fixture { FakeSettings(testDispatcher, fakeUserTracker) }