Merge "Simplify synchronized code and add comments" am: 9791b54b88

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

Change-Id: I9024a3daf944ebeeb7d2c179f51f42b1c62563a9