Respect disable flag in LargeScreenHeader
LargeScreenHeader should respect the disable flag and not show its contents when QS is disabled. Test: manual in landscape and split shade. Fixes: 218873788 Change-Id: I085f36a30dd654cd49a35b3b3f3dfd71745226cb
This commit is contained in:
@@ -296,6 +296,8 @@ public class CentralSurfacesCommandQueueCallbacks implements CommandQueue.Callba
|
||||
mShadeController.animateCollapsePanels();
|
||||
}
|
||||
}
|
||||
|
||||
mNotificationPanelViewController.disable(state1, state2, animate);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.systemui.statusbar.phone
|
||||
|
||||
import android.app.StatusBarManager
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.motion.widget.MotionLayout
|
||||
import com.android.settingslib.Utils
|
||||
@@ -68,6 +69,9 @@ class LargeScreenShadeHeaderController @Inject constructor(
|
||||
private val iconContainer: StatusIconContainer
|
||||
private val carrierIconSlots: List<String>
|
||||
private val qsCarrierGroupController: QSCarrierGroupController
|
||||
|
||||
private var qsDisabled = false
|
||||
|
||||
private var visible = false
|
||||
set(value) {
|
||||
if (field == value) {
|
||||
@@ -177,6 +181,13 @@ class LargeScreenShadeHeaderController @Inject constructor(
|
||||
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() {
|
||||
if (!active && combinedHeaders) {
|
||||
header.scrollY = qsScrollY
|
||||
@@ -204,7 +215,7 @@ class LargeScreenShadeHeaderController @Inject constructor(
|
||||
}
|
||||
|
||||
private fun updateVisibility() {
|
||||
val visibility = if (!active && !combinedHeaders) {
|
||||
val visibility = if (!active && !combinedHeaders || qsDisabled) {
|
||||
View.GONE
|
||||
} else if (shadeExpanded) {
|
||||
View.VISIBLE
|
||||
|
||||
@@ -4135,6 +4135,10 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
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.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.android.systemui.statusbar.phone
|
||||
|
||||
import android.app.StatusBarManager
|
||||
import android.testing.AndroidTestingRunner
|
||||
import android.view.View
|
||||
import androidx.test.filters.SmallTest
|
||||
@@ -116,6 +117,23 @@ class LargeScreenShadeHeaderControllerTest : SysuiTestCase() {
|
||||
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() {
|
||||
mLargeScreenShadeHeaderController.active = true
|
||||
mLargeScreenShadeHeaderController.shadeExpanded = true
|
||||
|
||||
Reference in New Issue
Block a user