Fix multiuser race in FeatureFlagsClassicDebug constructor.
Under HSUM, the constructor may be called while the system is still
running as user 0. In this case, we register the iGET_FLAGS receiver
under user 0. However, the flippin app runs as user 10 so will then
see an empty response to it's GET_FLAGS ordered broadcast and crash.
This change installs a callback to capture the system switching
from user 0 to user 10 (or indeed, any subsequent user switch) and
ensure re-registers the receiver so it's running in the correct user.
Bug: 345443431
Flag: com.android.systemui.classic_flags_multi_user
Test: Manually verified; atest -c com.android.systemui.flags.FeatureFlagsClassicDebugTest
Change-Id: If8b5273963e67ab23fb10a9ad930fa9fa7b09590
2 files changed