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:
@@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user