2fb43ef8c0
There is a problem in AudioEffect and Visualizer native_setup() methods that causes a crash in the application after the mediaserver process has crashed and restarted. The problem is that the native AudioEffect/Visualizer constructor is called while the JNI is in critical state after calling GetPrimitiveArrayCritical(). As the mediaserver process just restarted, the first call to AudioSystem will cause the binder IAudioflinger interface to be reteived and a callback send to AudioSystem JNI to clear the mediaserver error state. This will call env->FindClass() and crash due to the JNI being in critical state. Also fixed a similar problem in AudioTrack JNI Change-Id: I4a9026a3e26c7f78d9b4b4bec1aac90fbee2ab62