diff options
author | Chris Robinson <[email protected]> | 2017-02-03 09:41:21 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-02-03 09:41:21 -0800 |
commit | 428cde5dc26191871111e1edbea85ade952898aa (patch) | |
tree | f9423d13841e9081874a8db4fbf525f779417aae | |
parent | 2c1791752aebea9f2cf83df155db607eaeeb2046 (diff) |
Call getSystemService as a non-static function
-rw-r--r-- | Alc/backends/opensl.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Alc/backends/opensl.c b/Alc/backends/opensl.c index 51fe11f6..1e4bcb06 100644 --- a/Alc/backends/opensl.c +++ b/Alc/backends/opensl.c @@ -253,11 +253,11 @@ static ALCboolean opensl_reset_playback(ALCdevice *Device) ); TRACE("Integer: %p, parseInt: %p\n", int_cls, int_parseint); - jclass ctx_cls = (*env)->FindClass(env, "android/content/Context"); - jfieldID ctx_audsvc = (*env)->GetStaticFieldID(env, ctx_cls, + jclass ctx_cls = JCALL(env,FindClass)("android/content/Context"); + jfieldID ctx_audsvc = JCALL(env,GetStaticFieldID)(ctx_cls, "AUDIO_SERVICE", "Ljava/lang/String;" ); - jmethodID ctx_getSysSvc = (*env)->GetMethodID(env, ctx_cls, + jmethodID ctx_getSysSvc = JCALL(env,GetMethodID)(ctx_cls, "getSystemService", "(Ljava/lang/String;)Ljava/lang/Object;" ); TRACE("Context: %p, AUDIO_SERVICE: %p, getSystemService: %p\n", @@ -279,7 +279,7 @@ static ALCboolean opensl_reset_playback(ALCdevice *Device) /* Now make the calls. */ //AudioManager audMgr = (AudioManager)getSystemService(Context.AUDIO_SERVICE); strobj = JCALL(env,GetStaticObjectField)(ctx_cls, ctx_audsvc); - jobject audMgr = JCALL(env,CallStaticObjectMethod)(ctx_cls, ctx_getSysSvc, strobj); + jobject audMgr = JCALL(env,CallObjectMethod)(ctx_cls, ctx_getSysSvc, strobj); strchars = JCALL(env,GetStringUTFChars)(strobj, NULL); TRACE("Context.getSystemService(%s) = %p\n", strchars, audMgr); JCALL(env,ReleaseStringUTFChars)(strobj, strchars); |