Commit a323e3c3 authored by François Grisez's avatar François Grisez
Browse files

Add the setAndroidPowerManager private method to the LinphoneCoreImpl class

parent 69750c29
......@@ -3462,9 +3462,8 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setAudioDscp(JNIEnv* env
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setAndroidPowerManager(JNIEnv *env, jclass cls, jobject pm) {
#ifdef ANDROID
JavaVM *jvm;
env->GetJavaVM(&jvm);
bellesip_wake_lock_init(jvm, pm);
if(pm != NULL) bellesip_wake_lock_init(env, pm);
else bellesip_wake_lock_uninit(env);
#endif
}
......
......@@ -153,6 +153,7 @@ class LinphoneCoreImpl implements LinphoneCore {
private native void enableSdp200Ack(long nativePtr,boolean enable);
private native boolean isSdp200AckEnabled(long nativePtr);
private native void stopRinging(long nativePtr);
private native static void setAndroidPowerManager(Object pm);
LinphoneCoreImpl(LinphoneCoreListener listener, File userConfig, File factoryConfig, Object userdata) throws IOException {
mListener = listener;
......@@ -179,6 +180,7 @@ class LinphoneCoreImpl implements LinphoneCore {
public void setContext(Object context) {
mContext = (Context)context;
mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
setAndroidPowerManager(mContext.getSystemService(Context.POWER_SERVICE));
}
public synchronized void addAuthInfo(LinphoneAuthInfo info) {
......@@ -272,6 +274,7 @@ class LinphoneCoreImpl implements LinphoneCore {
}
public synchronized void destroy() {
isValid();
setAndroidPowerManager(null);
delete(nativePtr);
nativePtr = 0;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment