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

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

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

Change-Id: Id3f991a017c5438c9f7bec06b635970042b21a14