From 0306b54c0e99cf5d779c130d9016cebba638a889 Mon Sep 17 00:00:00 2001 From: Milton Wu Date: Wed, 1 Dec 2021 17:12:10 +0800 Subject: [PATCH] Privacy dot doesn't been reset after rtl changed After RTL changed, privacy dot shall be reset just like orientation changed. Bug 207612200 Test: atest NotificationPanelViewControllerTest ScreenDecorationsTest Test: Start voice recording, and change RTL to check statusbar behavior. Change-Id: I6225278cb39dd7524965ef40c6b244a2cee98163 --- .../events/PrivacyDotViewController.kt | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/events/PrivacyDotViewController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/events/PrivacyDotViewController.kt index ce86953177e59..962c7fa6aea78 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/events/PrivacyDotViewController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/events/PrivacyDotViewController.kt @@ -102,12 +102,17 @@ class PrivacyDotViewController @Inject constructor( configurationController.addCallback(object : ConfigurationController.ConfigurationListener { override fun onLayoutDirectionChanged(isRtl: Boolean) { - synchronized(this) { - val corner = selectDesignatedCorner(nextViewState.rotation, isRtl) - nextViewState = nextViewState.copy( - layoutRtl = isRtl, - designatedCorner = corner - ) + uiExecutor?.execute { + // If rtl changed, hide all dotes until the next state resolves + setCornerVisibilities(View.INVISIBLE) + + synchronized(this) { + val corner = selectDesignatedCorner(nextViewState.rotation, isRtl) + nextViewState = nextViewState.copy( + layoutRtl = isRtl, + designatedCorner = corner + ) + } } } })