Fix deadlock of starting intent during turing on profile

Start the intent on a handler thread instead of the user start
progress callback.

Bug: 149220125
Test: atest QuietModeHostsideTest
Test: turning on profile by tapping on some app launcher icon
Change-Id: I44bc862c1d72aae3d2d79862c92ddbe4d3a58483
This commit is contained in:
Rubin Xu
2020-03-12 14:51:56 +00:00
parent 5580360ba8
commit 1f3fab1a37

View File

@@ -455,11 +455,13 @@ public class UserManagerService extends IUserManager.Stub {
@Override
public void onFinished(int id, Bundle extras) {
try {
mContext.startIntentSender(mTarget, null, 0, 0, 0);
} catch (IntentSender.SendIntentException e) {
Slog.e(LOG_TAG, "Failed to start the target in the callback", e);
}
mHandler.post(() -> {
try {
mContext.startIntentSender(mTarget, null, 0, 0, 0);
} catch (IntentSender.SendIntentException e) {
Slog.e(LOG_TAG, "Failed to start the target in the callback", e);
}
});
}
}