mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-07 05:53:06 +00:00
Add the setAndroidPowerManager private method to the LinphoneCoreImpl class
This commit is contained in:
parent
69750c29f4
commit
a323e3c357
2 changed files with 5 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue