Merge "Update visibility when attached" into rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
1262dc842f
@@ -64,6 +64,9 @@ class KeyguardMediaController @Inject constructor(
|
||||
// Let's now initialize this view, which also creates the host view for us.
|
||||
mediaHost.init(MediaHierarchyManager.LOCATION_LOCKSCREEN)
|
||||
mediaView.setContentView(mediaHost.hostView)
|
||||
|
||||
// Ensure the visibility is correct
|
||||
updateVisibility()
|
||||
}
|
||||
|
||||
private fun updateVisibility() {
|
||||
|
||||
@@ -36,6 +36,7 @@ import org.mockito.ArgumentCaptor
|
||||
import org.mockito.Captor
|
||||
import org.mockito.Mock
|
||||
import org.mockito.Mockito.`when`
|
||||
import org.mockito.Mockito.atLeastOnce
|
||||
import org.mockito.Mockito.verify
|
||||
import org.mockito.junit.MockitoJUnit
|
||||
|
||||
@@ -70,7 +71,7 @@ class KeyguardMediaControllerTest : SysuiTestCase() {
|
||||
`when`(mediaHost.visible).thenReturn(false)
|
||||
triggerVisibilityListener()
|
||||
|
||||
verify(mediaHeaderView).visibility = eq(GONE)
|
||||
verify(mediaHeaderView, atLeastOnce()).visibility = eq(GONE)
|
||||
}
|
||||
@Test
|
||||
fun testAttach_visibleOnKeyguard() {
|
||||
@@ -80,7 +81,7 @@ class KeyguardMediaControllerTest : SysuiTestCase() {
|
||||
.thenReturn(true)
|
||||
triggerVisibilityListener()
|
||||
|
||||
verify(mediaHeaderView).visibility = eq(VISIBLE)
|
||||
verify(mediaHeaderView, atLeastOnce()).visibility = eq(VISIBLE)
|
||||
}
|
||||
@Test
|
||||
fun testAttach_hiddenOnKeyguard_whenNotificationsAreHidden() {
|
||||
@@ -90,7 +91,7 @@ class KeyguardMediaControllerTest : SysuiTestCase() {
|
||||
.thenReturn(false)
|
||||
triggerVisibilityListener()
|
||||
|
||||
verify(mediaHeaderView).visibility = eq(GONE)
|
||||
verify(mediaHeaderView, atLeastOnce()).visibility = eq(GONE)
|
||||
}
|
||||
|
||||
private fun triggerVisibilityListener() {
|
||||
|
||||
Reference in New Issue
Block a user