LineageParts: Misc fixes and improvements

* Use Standardcharsets
* Use try-with-resource
* Explicitly cast where required
* Use Math.min / Math.max
* Instead of storing the Context, store the ContentResolver
* ReportingService: Store ApplicationContext in a variable and use that
  instead of calling the method multiple times

Change-Id: Ic9a697e0b03b87f1bce91adfdbb828759fe2c548
14 files changed