[Statusbar] requestLayout when datatype vis changes
Testing manually, we are missing some layout passes when the visibility
fo the data type icon changes. Manually causing a relayout by e.g.
expanding / collapsing the QS shade fixes it, so we are clearly not
getting a chance to relayout the mobile view (unknown root cause).
Test: toggle airplane mode with a SIM that has mobile data. Note that
when the data type icon shows it is laid out properly (no overlap).
Fixes: 307844609
Flag: NONE
Change-Id: I97e5466840ebd6c3053aa747315bab22fdf3538a
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/binder/MobileIconBinder.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/binder/MobileIconBinder.kt
index b93e443..a14e87c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/binder/MobileIconBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/binder/MobileIconBinder.kt
@@ -154,8 +154,13 @@
dataTypeId,
)
dataTypeId?.let { IconViewBinder.bind(dataTypeId, networkTypeView) }
+ val prevVis = networkTypeContainer.visibility
networkTypeContainer.visibility =
if (dataTypeId != null) VISIBLE else GONE
+
+ if (prevVis != networkTypeContainer.visibility) {
+ view.requestLayout()
+ }
}
}