From 342d404c352e043d1f3ce2b58d62c67dd37be1e7 Mon Sep 17 00:00:00 2001 From: Christophe Deschamps Date: Tue, 15 Dec 2015 10:42:05 +0100 Subject: [PATCH] Missing wrapper files --- .../org/linphone/core/LinphoneFriendList.java | 27 +++++++ .../linphone/core/LinphoneFriendListImpl.java | 80 +++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 java/common/org/linphone/core/LinphoneFriendList.java create mode 100644 java/impl/org/linphone/core/LinphoneFriendListImpl.java diff --git a/java/common/org/linphone/core/LinphoneFriendList.java b/java/common/org/linphone/core/LinphoneFriendList.java new file mode 100644 index 000000000..daeca4801 --- /dev/null +++ b/java/common/org/linphone/core/LinphoneFriendList.java @@ -0,0 +1,27 @@ +/* +LinphoneFriend.java +Copyright (C) 2010 Belledonne Communications, Grenoble, France + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +package org.linphone.core; + + +public interface LinphoneFriendList { + public void setRLSUri(String uri); + public void addFriend(LinphoneFriend friend); + public void updateSubscriptions(LinphoneProxyConfig proxyConfig,boolean onlyWhenRegistered); + long getNativePtr(); +} diff --git a/java/impl/org/linphone/core/LinphoneFriendListImpl.java b/java/impl/org/linphone/core/LinphoneFriendListImpl.java new file mode 100644 index 000000000..15832f786 --- /dev/null +++ b/java/impl/org/linphone/core/LinphoneFriendListImpl.java @@ -0,0 +1,80 @@ +/* +LinphoneFriendImpl.java +Copyright (C) 2010 Belledonne Communications, Grenoble, France + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +package org.linphone.core; + +import java.io.Serializable; +import org.linphone.core.LinphoneProxyConfigImpl; + +class LinphoneFriendListImpl implements LinphoneFriendList, Serializable { + + protected final long nativePtr; + private native void finalize(long nativePtr); + private native long newLinphoneFriendList(long corePtr); + private native void setRLSUri(long nativePtr,String uri); + private native void addFriend(long nativePtr,long friendPtr); + private native void updateSubscriptions(long nativePtr,long proxyConfigPtr,boolean onlyWhenRegistered); + private native Object getCore(long ptr); + + + protected LinphoneFriendListImpl(LinphoneCoreImpl core) { + nativePtr = newLinphoneFriendList(core.nativePtr); + } + + @Override + public void setRLSUri(String uri) { + synchronized(getSyncObject()){ + setRLSUri(nativePtr, uri); + } + } + + @Override + public void addFriend(LinphoneFriend friend) { + synchronized(getSyncObject()){ + addFriend(nativePtr, friend.getNativePtr()); + } + } + + @Override + public void updateSubscriptions(LinphoneProxyConfig proxyConfig,boolean onlyWhenRegistered) { + synchronized(getSyncObject()){ + updateSubscriptions(nativePtr, ((LinphoneProxyConfigImpl)proxyConfig).nativePtr,onlyWhenRegistered); + } + } + + /*reserved for JNI */ + protected LinphoneFriendListImpl(long aNativePtr) { + nativePtr = aNativePtr; + } + @Override + protected void finalize() throws Throwable { + if (nativePtr != 0) { + finalize(nativePtr); + } + super.finalize(); + } + + @Override + public long getNativePtr() { + return nativePtr; + } + private Object getSyncObject(){ + return this; + } +} +