Add locking around AudioRecord release() function in JNI. Bug 2481952.

There is a potential threading issue where an app could call release()
on two threads. This hack adds a static lock object that serializes
access to the Java fields that contain the pointer to the native
AudioRecord object and weak reference to the Java object. Also
modifies finalize() to call release() so that both use the locking
scheme.

Change-Id: I09dcb19b7f501dc582e40e8718142b493eba2518
1 file changed