Locking and performance improvements in Content Provider.

Freeing up a couple of methods which required the AMS lock. Also some
performance improvements to address certain bottlenecks.

Also minor code refactoring.

Bug: 156262145
Test: atest ContentProviderTest [all]
Change-Id: I3092a58aa7debbd7e0bef531c05e3ce8f39d3a14
2 files changed