java: reduce visibility of some methods and fields

found by UCDetector

Change-Id: I0a0a00d1fae1fed2e6aef198b7a1482d7e7e29f0