Remove MutableStateFlow for transition current info
When multiple threads are attempting to begin transitions,
the MutableStateFlow can get stuck on a background thread
while emitting the update the consumers. This leaves a
small chance for other transitions to jump the queue, ones
that are scheduled onto a more favorable thread.
Avoid MutableStateFlow completely. There's no need, just
use a volatile to store state.
Fixes: 358533338
Test: atest KeyguardTransitionRepositoryTest
Flag: com.android.systemui.transition_race_condition
Change-Id: I1daf9d5074c966445a1ed54acc10fb91193d6c85
diff --git a/packages/SystemUI/aconfig/systemui.aconfig b/packages/SystemUI/aconfig/systemui.aconfig
index 2278789..5cde322 100644
--- a/packages/SystemUI/aconfig/systemui.aconfig
+++ b/packages/SystemUI/aconfig/systemui.aconfig
@@ -1546,6 +1546,16 @@
}
flag {
+ name: "transition_race_condition"
+ namespace: "systemui"
+ description: "Thread-safe keyguard transitions"
+ bug: "358533338"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
+
+flag {
name: "media_projection_request_attribution_fix"
namespace: "systemui"
description: "Ensure MediaProjection consent requests are properly attributed"