Merge "Respect disable flag in LargeScreenHeader" into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
b15f71e273
@@ -296,6 +296,8 @@ public class CentralSurfacesCommandQueueCallbacks implements CommandQueue.Callba
|
|||||||
mShadeController.animateCollapsePanels();
|
mShadeController.animateCollapsePanels();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mNotificationPanelViewController.disable(state1, state2, animate);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package com.android.systemui.statusbar.phone
|
package com.android.systemui.statusbar.phone
|
||||||
|
|
||||||
|
import android.app.StatusBarManager
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.constraintlayout.motion.widget.MotionLayout
|
import androidx.constraintlayout.motion.widget.MotionLayout
|
||||||
import com.android.settingslib.Utils
|
import com.android.settingslib.Utils
|
||||||
@@ -68,6 +69,9 @@ class LargeScreenShadeHeaderController @Inject constructor(
|
|||||||
private val iconContainer: StatusIconContainer
|
private val iconContainer: StatusIconContainer
|
||||||
private val carrierIconSlots: List<String>
|
private val carrierIconSlots: List<String>
|
||||||
private val qsCarrierGroupController: QSCarrierGroupController
|
private val qsCarrierGroupController: QSCarrierGroupController
|
||||||
|
|
||||||
|
private var qsDisabled = false
|
||||||
|
|
||||||
private var visible = false
|
private var visible = false
|
||||||
set(value) {
|
set(value) {
|
||||||
if (field == value) {
|
if (field == value) {
|
||||||
@@ -177,6 +181,13 @@ class LargeScreenShadeHeaderController @Inject constructor(
|
|||||||
updateConstraints()
|
updateConstraints()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun disable(state1: Int, state2: Int, animate: Boolean) {
|
||||||
|
val disabled = state2 and StatusBarManager.DISABLE2_QUICK_SETTINGS != 0
|
||||||
|
if (disabled == qsDisabled) return
|
||||||
|
qsDisabled = disabled
|
||||||
|
updateVisibility()
|
||||||
|
}
|
||||||
|
|
||||||
private fun updateScrollY() {
|
private fun updateScrollY() {
|
||||||
if (!active && combinedHeaders) {
|
if (!active && combinedHeaders) {
|
||||||
header.scrollY = qsScrollY
|
header.scrollY = qsScrollY
|
||||||
@@ -204,7 +215,7 @@ class LargeScreenShadeHeaderController @Inject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun updateVisibility() {
|
private fun updateVisibility() {
|
||||||
val visibility = if (!active && !combinedHeaders) {
|
val visibility = if (!active && !combinedHeaders || qsDisabled) {
|
||||||
View.GONE
|
View.GONE
|
||||||
} else if (shadeExpanded) {
|
} else if (shadeExpanded) {
|
||||||
View.VISIBLE
|
View.VISIBLE
|
||||||
|
|||||||
@@ -4140,6 +4140,10 @@ public class NotificationPanelViewController extends PanelViewController {
|
|||||||
return mNotificationStackScrollLayoutController;
|
return mNotificationStackScrollLayoutController;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void disable(int state1, int state2, boolean animated) {
|
||||||
|
mLargeScreenShadeHeaderController.disable(state1, state2, animated);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Close the keyguard user switcher if it is open and capable of closing.
|
* Close the keyguard user switcher if it is open and capable of closing.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.android.systemui.statusbar.phone
|
package com.android.systemui.statusbar.phone
|
||||||
|
|
||||||
|
import android.app.StatusBarManager
|
||||||
import android.testing.AndroidTestingRunner
|
import android.testing.AndroidTestingRunner
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.test.filters.SmallTest
|
import androidx.test.filters.SmallTest
|
||||||
@@ -116,6 +117,23 @@ class LargeScreenShadeHeaderControllerTest : SysuiTestCase() {
|
|||||||
verify(statusIcons).addIgnoredSlots(carrierIconSlots)
|
verify(statusIcons).addIgnoredSlots(carrierIconSlots)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun disableQS_notDisabled_visible() {
|
||||||
|
makeShadeVisible()
|
||||||
|
mLargeScreenShadeHeaderController.disable(0, 0, false)
|
||||||
|
|
||||||
|
assertThat(viewVisibility).isEqualTo(View.VISIBLE)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun disableQS_disabled_gone() {
|
||||||
|
makeShadeVisible()
|
||||||
|
mLargeScreenShadeHeaderController.disable(0, StatusBarManager.DISABLE2_QUICK_SETTINGS,
|
||||||
|
false)
|
||||||
|
|
||||||
|
assertThat(viewVisibility).isEqualTo(View.GONE)
|
||||||
|
}
|
||||||
|
|
||||||
private fun makeShadeVisible() {
|
private fun makeShadeVisible() {
|
||||||
mLargeScreenShadeHeaderController.active = true
|
mLargeScreenShadeHeaderController.active = true
|
||||||
mLargeScreenShadeHeaderController.shadeExpanded = true
|
mLargeScreenShadeHeaderController.shadeExpanded = true
|
||||||
|
|||||||
Reference in New Issue
Block a user