Revert "Fix incorrect password attempts messaging on headless"

Revert submission 27002999-wipeMessage

Reason for revert: Code Review Issues

Reverted changes: /q/submissionid:27002999-wipeMessage

There are several idiomatic issues with this CL that need to be addressed. It is causing breakages in SysUI-Studio and we should fix the issues in this CL instead of fixing studio.

Change-Id: Ic1235af5bd0f4b057cdd62cf56e5c749527f2656
diff --git a/packages/SystemUI/Android.bp b/packages/SystemUI/Android.bp
index 8d75565..e2af631 100644
--- a/packages/SystemUI/Android.bp
+++ b/packages/SystemUI/Android.bp
@@ -149,7 +149,6 @@
         "device_state_flags_lib",
         "kotlinx_coroutines_android",
         "kotlinx_coroutines",
-        "kotlinx_coroutines_guava",
         "//frameworks/libs/systemui:iconloader_base",
         "SystemUI-tags",
         "SystemUI-proto",
@@ -170,7 +169,6 @@
         "androidx.compose.material_material-icons-extended",
         "androidx.activity_activity-compose",
         "androidx.compose.animation_animation-graphics",
-        "device_policy_aconfig_flags_lib",
     ],
     libs: [
         "keepanno-annotations",
@@ -330,7 +328,6 @@
         "androidx.activity_activity-compose",
         "androidx.compose.animation_animation-graphics",
         "TraceurCommon",
-        "kotlinx_coroutines_guava",
     ],
 }
 
@@ -412,7 +409,6 @@
         "//frameworks/libs/systemui:compilelib",
         "SystemUI-tests-base",
         "androidx.compose.runtime_runtime",
-        "SystemUI-core",
     ],
     libs: [
         "keepanno-annotations",
diff --git a/packages/SystemUI/multivalentTests/src/com/android/keyguard/KeyguardSecurityContainerControllerTest.kt b/packages/SystemUI/multivalentTests/src/com/android/keyguard/KeyguardSecurityContainerControllerTest.kt
index 0b5a019..aa70c45 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/keyguard/KeyguardSecurityContainerControllerTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/keyguard/KeyguardSecurityContainerControllerTest.kt
@@ -17,8 +17,6 @@
 
 package com.android.keyguard
 
-import android.app.admin.DevicePolicyManager
-import android.app.admin.flags.Flags as DevicePolicyFlags
 import android.content.res.Configuration
 import android.media.AudioManager
 import android.telephony.TelephonyManager
@@ -150,7 +148,6 @@
     @Mock private lateinit var faceAuthAccessibilityDelegate: FaceAuthAccessibilityDelegate
     @Mock private lateinit var deviceProvisionedController: DeviceProvisionedController
     @Mock private lateinit var postureController: DevicePostureController
-    @Mock private lateinit var devicePolicyManager: DevicePolicyManager
 
     @Captor
     private lateinit var swipeListenerArgumentCaptor:
@@ -277,7 +274,6 @@
                 mSelectedUserInteractor,
                 deviceProvisionedController,
                 faceAuthAccessibilityDelegate,
-                devicePolicyManager,
                 keyguardTransitionInteractor,
                 { primaryBouncerInteractor },
             ) {
@@ -933,45 +929,6 @@
         verify(viewFlipperController).asynchronouslyInflateView(any(), any(), any())
     }
 
-    @Test
-    fun showAlmostAtWipeDialog_calledOnMainUser_setsCorrectUserType() {
-        mSetFlagsRule.enableFlags(DevicePolicyFlags.FLAG_HEADLESS_SINGLE_USER_FIXES)
-        val mainUserId = 10
-
-        underTest.showMessageForFailedUnlockAttempt(
-            /* userId = */ mainUserId,
-            /* expiringUserId = */ mainUserId,
-            /* mainUserId = */ mainUserId,
-            /* remainingBeforeWipe = */ 1,
-            /* failedAttempts = */ 1
-        )
-
-        verify(view)
-            .showAlmostAtWipeDialog(any(), any(), eq(KeyguardSecurityContainer.USER_TYPE_PRIMARY))
-    }
-
-    @Test
-    fun showAlmostAtWipeDialog_calledOnNonMainUser_setsCorrectUserType() {
-        mSetFlagsRule.enableFlags(DevicePolicyFlags.FLAG_HEADLESS_SINGLE_USER_FIXES)
-        val secondaryUserId = 10
-        val mainUserId = 0
-
-        underTest.showMessageForFailedUnlockAttempt(
-            /* userId = */ secondaryUserId,
-            /* expiringUserId = */ secondaryUserId,
-            /* mainUserId = */ mainUserId,
-            /* remainingBeforeWipe = */ 1,
-            /* failedAttempts = */ 1
-        )
-
-        verify(view)
-            .showAlmostAtWipeDialog(
-                any(),
-                any(),
-                eq(KeyguardSecurityContainer.USER_TYPE_SECONDARY_USER)
-            )
-    }
-
     private val registeredSwipeListener: KeyguardSecurityContainer.SwipeListener
         get() {
             underTest.onViewAttached()
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/authentication/domain/interactor/AuthenticationInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/authentication/domain/interactor/AuthenticationInteractorTest.kt
index 0c5e726..81878aa 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/authentication/domain/interactor/AuthenticationInteractorTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/authentication/domain/interactor/AuthenticationInteractorTest.kt
@@ -17,8 +17,6 @@
 package com.android.systemui.authentication.domain.interactor
 
 import android.app.admin.DevicePolicyManager
-import android.app.admin.flags.Flags as DevicePolicyFlags
-import android.platform.test.annotations.EnableFlags
 import androidx.test.ext.junit.runners.AndroidJUnit4
 import androidx.test.filters.SmallTest
 import com.android.internal.widget.LockPatternUtils
@@ -34,8 +32,6 @@
 import com.android.systemui.coroutines.collectLastValue
 import com.android.systemui.kosmos.testScope
 import com.android.systemui.testKosmos
-import com.android.systemui.user.data.repository.FakeUserRepository
-import com.android.systemui.user.data.repository.fakeUserRepository
 import com.google.common.truth.Truth.assertThat
 import kotlin.time.Duration.Companion.seconds
 import kotlinx.coroutines.ExperimentalCoroutinesApi
@@ -414,16 +410,12 @@
         }
 
     @Test
-    @EnableFlags(DevicePolicyFlags.FLAG_HEADLESS_SINGLE_USER_FIXES)
     fun upcomingWipe() =
         testScope.runTest {
             val upcomingWipe by collectLastValue(underTest.upcomingWipe)
             kosmos.fakeAuthenticationRepository.setAuthenticationMethod(Pin)
             val correctPin = FakeAuthenticationRepository.DEFAULT_PIN
             val wrongPin = FakeAuthenticationRepository.DEFAULT_PIN.map { it + 1 }
-            kosmos.fakeUserRepository.asMainUser()
-            kosmos.fakeAuthenticationRepository.profileWithMinFailedUnlockAttemptsForWipe =
-                FakeUserRepository.MAIN_USER_ID
 
             underTest.authenticate(correctPin)
             assertThat(upcomingWipe).isNull()
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java
index b93eba6..b916fc2 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java
@@ -35,14 +35,12 @@
 
 import android.app.ActivityManager;
 import android.app.admin.DevicePolicyManager;
-import android.app.admin.flags.Flags;
 import android.content.Intent;
 import android.content.res.ColorStateList;
 import android.content.res.Configuration;
 import android.content.res.Resources;
 import android.media.AudioManager;
 import android.metrics.LogMaker;
-import android.os.Looper;
 import android.os.SystemClock;
 import android.os.UserHandle;
 import android.telephony.TelephonyManager;
@@ -99,15 +97,12 @@
 import com.android.systemui.util.kotlin.JavaAdapter;
 import com.android.systemui.util.settings.GlobalSettings;
 
-import com.google.common.util.concurrent.ListenableFuture;
-
 import dagger.Lazy;
 
 import kotlinx.coroutines.Job;
 
 import java.io.File;
 import java.util.Arrays;
-import java.util.concurrent.ExecutionException;
 
 import javax.inject.Inject;
 import javax.inject.Provider;
@@ -140,7 +135,6 @@
     private final BouncerMessageInteractor mBouncerMessageInteractor;
     private int mTranslationY;
     private final KeyguardTransitionInteractor mKeyguardTransitionInteractor;
-    private final DevicePolicyManager mDevicePolicyManager;
     // Whether the volume keys should be handled by keyguard. If true, then
     // they will be handled here for specific media types such as music, otherwise
     // the audio service will bring up the volume dialog.
@@ -467,7 +461,6 @@
             SelectedUserInteractor selectedUserInteractor,
             DeviceProvisionedController deviceProvisionedController,
             FaceAuthAccessibilityDelegate faceAuthAccessibilityDelegate,
-            DevicePolicyManager devicePolicyManager,
             KeyguardTransitionInteractor keyguardTransitionInteractor,
             Lazy<PrimaryBouncerInteractor> primaryBouncerInteractor,
             Provider<DeviceEntryInteractor> deviceEntryInteractor
@@ -503,7 +496,6 @@
         mKeyguardTransitionInteractor = keyguardTransitionInteractor;
         mDeviceProvisionedController = deviceProvisionedController;
         mPrimaryBouncerInteractor = primaryBouncerInteractor;
-        mDevicePolicyManager = devicePolicyManager;
     }
 
     @Override
@@ -1114,36 +1106,35 @@
 
         if (DEBUG) Log.d(TAG, "reportFailedPatternAttempt: #" + failedAttempts);
 
+        final DevicePolicyManager dpm = mLockPatternUtils.getDevicePolicyManager();
         final int failedAttemptsBeforeWipe =
-                mDevicePolicyManager.getMaximumFailedPasswordsForWipe(null, userId);
+                dpm.getMaximumFailedPasswordsForWipe(null, userId);
 
         final int remainingBeforeWipe = failedAttemptsBeforeWipe > 0
                 ? (failedAttemptsBeforeWipe - failedAttempts)
                 : Integer.MAX_VALUE; // because DPM returns 0 if no restriction
         if (remainingBeforeWipe < LockPatternUtils.FAILED_ATTEMPTS_BEFORE_WIPE_GRACE) {
-            // The user has installed a DevicePolicyManager that requests a
-            // user/profile to be wiped N attempts. Once we get below the grace period,
-            // we post this dialog every time as a clear warning until the deletion
-            // fires. Check which profile has the strictest policy for failed password
-            // attempts.
-            final int expiringUser =
-                    mDevicePolicyManager.getProfileWithMinimumFailedPasswordsForWipe(userId);
-            ListenableFuture<Integer> getMainUserIdFuture =
-                    mSelectedUserInteractor.getMainUserIdAsync();
-            getMainUserIdFuture.addListener(() -> {
-                Looper.prepare();
-                Integer mainUser;
-                try {
-                    mainUser = getMainUserIdFuture.get();
-                } catch (InterruptedException | ExecutionException e) {
-                    // Nothing we can, keep using the system user as the primary
-                    // user.
-                    mainUser = null;
+            // The user has installed a DevicePolicyManager that requests a user/profile to be wiped
+            // N attempts. Once we get below the grace period, we post this dialog every time as a
+            // clear warning until the deletion fires.
+            // Check which profile has the strictest policy for failed password attempts
+            final int expiringUser = dpm.getProfileWithMinimumFailedPasswordsForWipe(userId);
+            int userType = USER_TYPE_PRIMARY;
+            if (expiringUser == userId) {
+                // TODO: http://b/23522538
+                if (expiringUser != UserHandle.USER_SYSTEM) {
+                    userType = USER_TYPE_SECONDARY_USER;
                 }
-                showMessageForFailedUnlockAttempt(
-                        userId, expiringUser, mainUser, remainingBeforeWipe, failedAttempts);
-                Looper.loop();
-            }, ThreadUtils.getBackgroundExecutor());
+            } else if (expiringUser != UserHandle.USER_NULL) {
+                userType = USER_TYPE_WORK_PROFILE;
+            } // If USER_NULL, which shouldn't happen, leave it as USER_TYPE_PRIMARY
+            if (remainingBeforeWipe > 0) {
+                mView.showAlmostAtWipeDialog(failedAttempts, remainingBeforeWipe, userType);
+            } else {
+                // Too many attempts. The device will be wiped shortly.
+                Slog.i(TAG, "Too many unlock attempts; user " + expiringUser + " will be wiped!");
+                mView.showWipeDialog(failedAttempts, userType);
+            }
         }
         mLockPatternUtils.reportFailedPasswordAttempt(userId);
         if (timeoutMs > 0) {
@@ -1155,35 +1146,6 @@
         }
     }
 
-    @VisibleForTesting
-    void showMessageForFailedUnlockAttempt(int userId, int expiringUserId, Integer mainUserId,
-            int remainingBeforeWipe, int failedAttempts) {
-        int userType = USER_TYPE_PRIMARY;
-        if (expiringUserId == userId) {
-            int primaryUser = UserHandle.USER_SYSTEM;
-            if (Flags.headlessSingleUserFixes()) {
-                if (mainUserId != null) {
-                    primaryUser = mainUserId;
-                }
-            }
-            // TODO: http://b/23522538
-            if (expiringUserId != primaryUser) {
-                userType = USER_TYPE_SECONDARY_USER;
-            }
-        } else if (expiringUserId != UserHandle.USER_NULL) {
-            userType = USER_TYPE_WORK_PROFILE;
-        } // If USER_NULL, which shouldn't happen, leave it as USER_TYPE_PRIMARY
-        if (remainingBeforeWipe > 0) {
-            mView.showAlmostAtWipeDialog(failedAttempts, remainingBeforeWipe,
-                    userType);
-        } else {
-            // Too many attempts. The device will be wiped shortly.
-            Slog.i(TAG, "Too many unlock attempts; user " + expiringUserId
-                    + " will be wiped!");
-            mView.showWipeDialog(failedAttempts, userType);
-        }
-    }
-
     private void getCurrentSecurityController(
             KeyguardSecurityViewFlipperController.OnViewInflatedCallback onViewInflatedCallback) {
         mSecurityViewFlipperController
diff --git a/packages/SystemUI/src/com/android/systemui/authentication/domain/interactor/AuthenticationInteractor.kt b/packages/SystemUI/src/com/android/systemui/authentication/domain/interactor/AuthenticationInteractor.kt
index fcba425..5df7fc9 100644
--- a/packages/SystemUI/src/com/android/systemui/authentication/domain/interactor/AuthenticationInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/authentication/domain/interactor/AuthenticationInteractor.kt
@@ -16,7 +16,6 @@
 
 package com.android.systemui.authentication.domain.interactor
 
-import android.app.admin.flags.Flags
 import android.os.UserHandle
 import com.android.internal.widget.LockPatternUtils
 import com.android.internal.widget.LockPatternView
@@ -289,15 +288,9 @@
     private suspend fun getWipeTarget(): WipeTarget {
         // Check which profile has the strictest policy for failed authentication attempts.
         val userToBeWiped = repository.getProfileWithMinFailedUnlockAttemptsForWipe()
-        val primaryUser =
-            if (Flags.headlessSingleUserFixes()) {
-                selectedUserInteractor.getMainUserId() ?: UserHandle.USER_SYSTEM
-            } else {
-                UserHandle.USER_SYSTEM
-            }
         return when (userToBeWiped) {
             selectedUserInteractor.getSelectedUserId() ->
-                if (userToBeWiped == primaryUser) {
+                if (userToBeWiped == UserHandle.USER_SYSTEM) {
                     WipeTarget.WholeDevice
                 } else {
                     WipeTarget.User
diff --git a/packages/SystemUI/src/com/android/systemui/user/data/repository/UserRepository.kt b/packages/SystemUI/src/com/android/systemui/user/data/repository/UserRepository.kt
index a817b31..37be1c6 100644
--- a/packages/SystemUI/src/com/android/systemui/user/data/repository/UserRepository.kt
+++ b/packages/SystemUI/src/com/android/systemui/user/data/repository/UserRepository.kt
@@ -18,7 +18,6 @@
 package com.android.systemui.user.data.repository
 
 import android.annotation.SuppressLint
-import android.annotation.UserIdInt
 import android.content.Context
 import android.content.pm.UserInfo
 import android.os.UserHandle
@@ -108,22 +107,6 @@
     fun isSimpleUserSwitcher(): Boolean
 
     fun isUserSwitcherEnabled(): Boolean
-
-    /**
-     * Returns the user ID of the "main user" of the device. This user may have access to certain
-     * features which are limited to at most one user. There will never be more than one main user
-     * on a device.
-     *
-     * <p>Currently, on most form factors the first human user on the device will be the main user;
-     * in the future, the concept may be transferable, so a different user (or even no user at all)
-     * may be designated the main user instead. On other form factors there might not be a main
-     * user.
-     *
-     * <p> When the device doesn't have a main user, this will return {@code null}.
-     *
-     * @see [UserManager.getMainUser]
-     */
-    @UserIdInt suspend fun getMainUserId(): Int?
 }
 
 @SysUISingleton
@@ -256,10 +239,6 @@
         return _userSwitcherSettings.value.isUserSwitcherEnabled
     }
 
-    override suspend fun getMainUserId(): Int? {
-        return withContext(backgroundDispatcher) { manager.mainUser?.identifier }
-    }
-
     private suspend fun getSettings(): UserSwitcherSettingsModel {
         return withContext(backgroundDispatcher) {
             val isSimpleUserSwitcher =
diff --git a/packages/SystemUI/src/com/android/systemui/user/domain/interactor/SelectedUserInteractor.kt b/packages/SystemUI/src/com/android/systemui/user/domain/interactor/SelectedUserInteractor.kt
index a5728d0..38b381a 100644
--- a/packages/SystemUI/src/com/android/systemui/user/domain/interactor/SelectedUserInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/user/domain/interactor/SelectedUserInteractor.kt
@@ -2,27 +2,17 @@
 
 import android.annotation.UserIdInt
 import android.content.pm.UserInfo
-import android.os.UserManager
 import com.android.keyguard.KeyguardUpdateMonitor
 import com.android.systemui.Flags.refactorGetCurrentUser
 import com.android.systemui.dagger.SysUISingleton
-import com.android.systemui.dagger.qualifiers.Application
 import com.android.systemui.user.data.repository.UserRepository
-import com.google.common.util.concurrent.ListenableFuture
 import javax.inject.Inject
-import kotlinx.coroutines.CoroutineScope
 import kotlinx.coroutines.flow.distinctUntilChanged
 import kotlinx.coroutines.flow.map
-import kotlinx.coroutines.guava.future
 
 /** Encapsulates business logic to interact the selected user */
 @SysUISingleton
-class SelectedUserInteractor
-@Inject
-constructor(
-    @Application private val applicationScope: CoroutineScope,
-    private val repository: UserRepository
-) {
+class SelectedUserInteractor @Inject constructor(private val repository: UserRepository) {
 
     /** Flow providing the ID of the currently selected user. */
     val selectedUser = repository.selectedUserInfo.map { it.id }.distinctUntilChanged()
@@ -48,41 +38,4 @@
             KeyguardUpdateMonitor.getCurrentUser()
         }
     }
-
-    /**
-     * Returns the user ID of the "main user" of the device. This user may have access to certain
-     * features which are limited to at most one user. There will never be more than one main user
-     * on a device.
-     *
-     * <p>Currently, on most form factors the first human user on the device will be the main user;
-     * in the future, the concept may be transferable, so a different user (or even no user at all)
-     * may be designated the main user instead. On other form factors there might not be a main
-     * user.
-     *
-     * <p> When the device doesn't have a main user, this will return {@code null}.
-     *
-     * @see [UserManager.getMainUser]
-     */
-    @UserIdInt
-    suspend fun getMainUserId(): Int? {
-        return repository.getMainUserId()
-    }
-
-    /**
-     * Returns a [ListenableFuture] for the user ID of the "main user" of the device. This user may
-     * have access to certain features which are limited to at most one user. There will never be
-     * more than one main user on a device.
-     *
-     * <p>Currently, on most form factors the first human user on the device will be the main user;
-     * in the future, the concept may be transferable, so a different user (or even no user at all)
-     * may be designated the main user instead. On other form factors there might not be a main
-     * user.
-     *
-     * <p> When the device doesn't have a main user, this will return {@code null}.
-     *
-     * @see [UserManager.getMainUser]
-     */
-    fun getMainUserIdAsync(): ListenableFuture<Int?> {
-        return applicationScope.future { getMainUserId() }
-    }
 }
diff --git a/packages/SystemUI/tests/src/com/android/systemui/user/domain/interactor/SelectedUserInteractorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/user/domain/interactor/SelectedUserInteractorTest.kt
index 78d4f02..140e919 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/user/domain/interactor/SelectedUserInteractorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/user/domain/interactor/SelectedUserInteractorTest.kt
@@ -7,7 +7,6 @@
 import com.android.systemui.user.data.repository.FakeUserRepository
 import com.google.common.truth.Truth.assertThat
 import kotlinx.coroutines.runBlocking
-import kotlinx.coroutines.test.TestCoroutineScope
 import org.junit.Before
 import org.junit.Test
 import org.junit.runner.RunWith
@@ -24,7 +23,7 @@
     @Before
     fun setUp() {
         userRepository.setUserInfos(USER_INFOS)
-        underTest = SelectedUserInteractor(TestCoroutineScope(), userRepository)
+        underTest = SelectedUserInteractor(userRepository)
     }
 
     @Test
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/domain/interactor/KeyguardDismissInteractorFactory.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/domain/interactor/KeyguardDismissInteractorFactory.kt
index c7b06b6..7eef704 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/domain/interactor/KeyguardDismissInteractorFactory.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/domain/interactor/KeyguardDismissInteractorFactory.kt
@@ -58,7 +58,7 @@
         bouncerRepository: FakeKeyguardBouncerRepository = FakeKeyguardBouncerRepository(),
         keyguardUpdateMonitor: KeyguardUpdateMonitor = mock(KeyguardUpdateMonitor::class.java),
         powerRepository: FakePowerRepository = FakePowerRepository(),
-        userRepository: FakeUserRepository = FakeUserRepository()
+        userRepository: FakeUserRepository = FakeUserRepository(),
     ): WithDependencies {
         val primaryBouncerInteractor =
             PrimaryBouncerInteractor(
@@ -95,11 +95,7 @@
             PowerInteractorFactory.create(
                 repository = powerRepository,
             )
-        val selectedUserInteractor =
-            SelectedUserInteractor(
-                applicationScope = testScope.backgroundScope,
-                repository = userRepository
-            )
+        val selectedUserInteractor = SelectedUserInteractor(repository = userRepository)
         return WithDependencies(
             trustRepository = trustRepository,
             keyguardRepository = keyguardRepository,
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/user/data/repository/FakeUserRepository.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/user/data/repository/FakeUserRepository.kt
index 1f2ecb7..3e9ae4d 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/user/data/repository/FakeUserRepository.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/user/data/repository/FakeUserRepository.kt
@@ -37,7 +37,7 @@
 class FakeUserRepository @Inject constructor() : UserRepository {
     companion object {
         // User id to represent a non system (human) user id. We presume this is the main user.
-        const val MAIN_USER_ID = 10
+        private const val MAIN_USER_ID = 10
 
         private const val DEFAULT_SELECTED_USER = 0
         private val DEFAULT_SELECTED_USER_INFO =
@@ -84,10 +84,6 @@
 
     override var isRefreshUsersPaused: Boolean = false
 
-    override suspend fun getMainUserId(): Int? {
-        return MAIN_USER_ID
-    }
-
     var refreshUsersCallCount: Int = 0
         private set
 
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/user/domain/interactor/SelectedUserInteractorKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/user/domain/interactor/SelectedUserInteractorKosmos.kt
index 9dddfcd..89672f1 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/user/domain/interactor/SelectedUserInteractorKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/user/domain/interactor/SelectedUserInteractorKosmos.kt
@@ -17,8 +17,6 @@
 package com.android.systemui.user.domain.interactor
 
 import com.android.systemui.kosmos.Kosmos
-import com.android.systemui.kosmos.applicationCoroutineScope
 import com.android.systemui.user.data.repository.userRepository
 
-val Kosmos.selectedUserInteractor by
-    Kosmos.Fixture { SelectedUserInteractor(applicationCoroutineScope, userRepository) }
+val Kosmos.selectedUserInteractor by Kosmos.Fixture { SelectedUserInteractor(userRepository) }