RpcSession attaches/detaches JVM for Java thread

If javaAttachThread / javaDetachThread exists, run them before
and after the while loop in join. This ensures the
Java thread is attached / detached appropriately for
binder threads that handles RPC calls.

Test: run aservice on Java services
Bug: 190450693
Change-Id: I23f171dd1e08dfacfbbb46ecc9564cbf42d6f353
3 files changed