LocationManager: cache isLocationEnabledForUser

This method is in the hot path for all location tasks but whether
location is enabled for a particular user doesn't change that
often. Cache the result and invalidate from system_server in order to
reduce CPU consumption.

Test: boots, works, gets location
Bug: 140788621

Change-Id: I84ad2c570e7024187a728071dcbb6f72b177e17a
2 files changed