Revert "Migrating RecentsAnimationDeviceState and dependent obje..."
Revert submission 31332401-recents-device-state Reason for revert: DroidMonitor: Potential culprit for http://b/391684419 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted. Reverted changes: /q/submissionid:31332401-recents-device-state Change-Id: I3986328ee3aa8ebb822f7ef05b9f80ef68872aef
This commit is contained in:
1 parent
d7bfa76bcc
commit
fa30e3fc0e
18 files changed
+171
-271
No files matched your search
@@ -19,8 +19,6 @@ package com.android.launcher3.util
|
||||
import com.android.launcher3.FakeLauncherPrefs
|
||||
import com.android.launcher3.LauncherPrefs
|
||||
import com.android.launcher3.dagger.ApiWrapperModule
|
||||
import com.android.launcher3.dagger.AppModule
|
||||
import com.android.launcher3.dagger.StaticObjectModule
|
||||
import com.android.launcher3.dagger.WindowManagerProxyModule
|
||||
import dagger.Binds
|
||||
import dagger.Module
|
||||
@@ -33,21 +31,11 @@ abstract class FakePrefsModule {
|
||||
}
|
||||
|
||||
/** All modules. We also exclude the plugin module from tests */
|
||||
@Module(
|
||||
includes =
|
||||
[
|
||||
ApiWrapperModule::class,
|
||||
WindowManagerProxyModule::class,
|
||||
StaticObjectModule::class,
|
||||
AppModule::class,
|
||||
]
|
||||
)
|
||||
@Module(includes = [ApiWrapperModule::class, WindowManagerProxyModule::class])
|
||||
class AllModulesForTest
|
||||
|
||||
/** All modules except the WMProxy */
|
||||
@Module(includes = [ApiWrapperModule::class, StaticObjectModule::class, AppModule::class])
|
||||
class AllModulesMinusWMProxy
|
||||
@Module(includes = [ApiWrapperModule::class]) class AllModulesMinusWMProxy
|
||||
|
||||
/** All modules except the ApiWrapper */
|
||||
@Module(includes = [WindowManagerProxyModule::class, StaticObjectModule::class, AppModule::class])
|
||||
class AllModulesMinusApiWrapper
|
||||
@Module(includes = [WindowManagerProxyModule::class]) class AllModulesMinusApiWrapper
|
||||
@@ -38,7 +38,6 @@ class LockedUserStateTest {
|
||||
|
||||
private val userManager: UserManager = mock()
|
||||
private val context: Context = mock()
|
||||
private val lifeCycle: DaggerSingletonTracker = mock()
|
||||
|
||||
@Before
|
||||
fun setup() {
|
||||
@@ -49,7 +48,7 @@ class LockedUserStateTest {
|
||||
fun runOnUserUnlocked_runs_action_immediately_if_already_unlocked() {
|
||||
whenever(userManager.isUserUnlocked(Process.myUserHandle())).thenReturn(true)
|
||||
val action: Runnable = mock()
|
||||
LockedUserState(context, lifeCycle).runOnUserUnlocked(action)
|
||||
LockedUserState(context).runOnUserUnlocked(action)
|
||||
verify(action).run()
|
||||
}
|
||||
|
||||
@@ -57,23 +56,23 @@ class LockedUserStateTest {
|
||||
fun runOnUserUnlocked_waits_to_run_action_until_user_is_unlocked() {
|
||||
whenever(userManager.isUserUnlocked(Process.myUserHandle())).thenReturn(false)
|
||||
val action: Runnable = mock()
|
||||
val state = LockedUserState(context, lifeCycle)
|
||||
val state = LockedUserState(context)
|
||||
state.runOnUserUnlocked(action)
|
||||
// b/343530737
|
||||
verifyNoMoreInteractions(action)
|
||||
state.userUnlockedReceiver.onReceive(context, Intent(Intent.ACTION_USER_UNLOCKED))
|
||||
state.mUserUnlockedReceiver.onReceive(context, Intent(Intent.ACTION_USER_UNLOCKED))
|
||||
verify(action).run()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isUserUnlocked_returns_true_when_user_is_unlocked() {
|
||||
whenever(userManager.isUserUnlocked(Process.myUserHandle())).thenReturn(true)
|
||||
assertThat(LockedUserState(context, lifeCycle).isUserUnlocked).isTrue()
|
||||
assertThat(LockedUserState(context).isUserUnlocked).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isUserUnlocked_returns_false_when_user_is_locked() {
|
||||
whenever(userManager.isUserUnlocked(Process.myUserHandle())).thenReturn(false)
|
||||
assertThat(LockedUserState(context, lifeCycle).isUserUnlocked).isFalse()
|
||||
assertThat(LockedUserState(context).isUserUnlocked).isFalse()
|
||||
}
|
||||
}
|
||||
@@ -48,7 +48,6 @@ import org.junit.runners.model.Statement
|
||||
class SandboxApplication private constructor(private val base: SandboxApplicationWrapper) :
|
||||
SandboxModelContext(base), TestRule {
|
||||
|
||||
@JvmOverloads
|
||||
constructor(
|
||||
base: Context = ApplicationProvider.getApplicationContext()
|
||||
) : this(SandboxApplicationWrapper(base))
|
||||
|
||||
Reference in new issue
Block a user