Merge "Fix a racing condition in ProcessRecord"

This commit is contained in:
Jing Ji
2019-12-03 20:59:05 +00:00
committed by Gerrit Code Review

View File

@@ -446,7 +446,9 @@ public final class BroadcastQueue {
mHandler.removeCallbacksAndMessages(msgToken);
// ...then schedule the removal of the token after the extended timeout
mHandler.postAtTime(() -> {
app.removeAllowBackgroundActivityStartsToken(r);
synchronized (mService) {
app.removeAllowBackgroundActivityStartsToken(r);
}
}, msgToken, (r.receiverTime + mConstants.ALLOW_BG_ACTIVITY_START_TIMEOUT));
}