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

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

Change-Id: Ibaae504192cfc6c18536fcd0f6e6de0c31f231bd