Fix CtsWindowManagerDeviceActivity:UnsupportedErrorDialogTests for the visible background user
There is a test scenario where the test sets the developer option
setting (Settings.Secure.SHOW_FIRST_CRASH_DIALOG_DEV_OPTION)
for the user who is running the test to enable the crash dialog.
However, handleShowAppErrorUi() always reads the setting for
the current user due to which the test fails.
To fix this, modify handleShowAppErrorUi() so that it reads the
setting value for the visible user associated with the error.
Bug: 354820056
Flag: EXEMPT bugfix
Test: atest CtsWindowManagerDeviceActivity:UnsupportedErrorDialogTests
Test: atest --user-type secondary_user CtsWindowManagerDeviceActivity:UnsupportedErrorDialogTests
Test: atest --user-type secondary_user_on_secondary_display CtsWindowManagerDeviceActivity:UnsupportedErrorDialogTests
Signed-off-by: Dohyun Lee <dohyun.lee@lge.com>
(cherry picked from https://partner-android-review.googlesource.com/q/commit:91e4ae17b5772b26eef986b22574b5427fb27074)
Change-Id: I3a13e952f475d5300c65137bb846bab8126087b8
1 file changed