[automerger skipped] Merge "More fixes towards the race conditions in AMS" into qt-dev am: 89600e2289 -s ours am: c7f10afcae -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: I08729c29660c607a53571a1ac8d2e75a8213fda4