Merge "More granular locks." am: 38a129962a am: 293e5252df

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1898571

Change-Id: Idb99a9e58c024ab7975a67fcca3fd6be2b80f4a4