[automerger skipped] Merge "More fixes towards the race conditions in AMS" into qt-dev am: 89600e2289 -s ours

am skip reason: Change-Id I6e0bdc8c02bab54f6278096b3a3acadd97c064c6 with SHA-1 b581128020 is in history

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

Change-Id: I63c54b5bbc9109178ff1523db1a8b8c2e2bea92b