Refactor PlatformCompat and related files.

- Fix java style
- Remove some code duplication
- Remove redundant throws declarations for unchecked exceptions
- Fix javadoc typos

Bug: 147113465
Test: N/A
Change-Id: I723ddf3184e2da77f157340c4ef18e9395b99e60
3 files changed