Serialize calls into BinderProxy.

The BinderProxy class is not thread-safe, hence all calls into it
must be serialized. This was achieved by holding the gProxyLock in
JNI code. However, a recent change added calls into BinderProxy
from ActivityManagerService without holding that lock, causing
ConcurrentModificationExceptions.

Instead of dumping debug info from AMS, make the call directly
from JNI, so we can make sure gProxyLock is held correctly.

Also, only dump on debug builds.

Bug: 71353150
Bug: 109701487
Test: sailfish builds, boots, info gets dumped with lowered limits.
Change-Id: I446a71ce4115b9936a01a170401ef98ba3818c0b
3 files changed