Dismiss UserSwitchingDialog on UiHandler thread.
This CL makes sure the dismissal is always done on the UI thread to prevent CalledFromWrongThreadException. Bug: 284085833 Test: atest UserControllerTest Change-Id: I7c0b35be2a171648c20b50cee6dea78ba7a2cf5b
This commit is contained in:
@@ -1972,7 +1972,7 @@ class UserController implements Handler.Callback {
|
||||
}
|
||||
|
||||
private void dismissUserSwitchDialog(Runnable onDismissed) {
|
||||
mInjector.dismissUserSwitchingDialog(onDismissed);
|
||||
mUiHandler.post(() -> mInjector.dismissUserSwitchingDialog(onDismissed));
|
||||
}
|
||||
|
||||
private void showUserSwitchDialog(Pair<UserInfo, UserInfo> fromToUserPair) {
|
||||
|
||||
@@ -1342,6 +1342,10 @@ public class UserControllerTest {
|
||||
Message copy = new Message();
|
||||
copy.copyFrom(msg);
|
||||
mMessages.add(copy);
|
||||
if (msg.getCallback() != null) {
|
||||
msg.getCallback().run();
|
||||
msg.setCallback(null);
|
||||
}
|
||||
return super.sendMessageAtTime(msg, uptimeMillis);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user