Merge "Fix a race condition between calculateWaitTime and actually waiting. When the race was lost with a completion callback, the operation being waited upon may have been de-queued by the completion callback for immediate execution, but the thread was still proceeding with the wait." into sc-dev am: 47fc76e4f2 am: 971ed7816c

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15472895

Change-Id: Ibf82ff175e35c2dcaba5ccdae2bc990da0449a92