[automerger skipped] Merge "More fixes towards the race conditions in AMS" into oc-mr1-dev am: 239ab1c9d6 -s ours am: 03f7e9d6fc -s ours am: f0a0963d1d -s ours am: 44654288c0 -s ours

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

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

Change-Id: I9cee30856583693e71f26b0623bbc8118bb774e9