-create LinphoneService

-fix landscape ui
-create History tab view
This commit is contained in:
Jehan Monnier 2010-02-18 18:29:40 +01:00
parent 7b6ccba59e
commit 3f0612f88f
5 changed files with 99 additions and 3 deletions

31
LinphoneCallLog.java Normal file
View file

@ -0,0 +1,31 @@
/*
LinPhoneCallLog.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 LinphoneCallLog {
public enum CallDirection {
CallOutgoing,Callincoming
}
public LinphoneAddress getFrom();
public LinphoneAddress getTo ();
public LinphoneCallLog.CallDirection getDirection();
}

46
LinphoneCallLogImpl.java Normal file
View file

@ -0,0 +1,46 @@
/*
LinPhoneCallLogImpl.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;
class LinphoneCallLogImpl implements LinphoneCallLog {
protected final long nativePtr;
private native long getFrom(long nativePtr);
private native long getTo(long nativePtr);
private native boolean isIncoming(long nativePtr);
LinphoneCallLogImpl(long aNativePtr) {
nativePtr = aNativePtr;
}
public CallDirection getDirection() {
return isIncoming(nativePtr)?CallDirection.Callincoming:CallDirection.CallOutgoing;
}
public LinphoneAddress getFrom() {
return new LinphoneAddressImpl(getFrom(nativePtr));
}
public LinphoneAddress getTo() {
return new LinphoneAddressImpl(getTo(nativePtr));
}
}

View file

@ -18,6 +18,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package org.linphone.core;
import java.util.List;
public interface LinphoneCore {
@ -116,4 +118,9 @@ public interface LinphoneCore {
public void acceptCall();
/**
* @return a list of LinphoneCallLog
*/
public List<LinphoneCallLog> getCallLogs();
}

View file

@ -20,6 +20,8 @@ package org.linphone.core;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
class LinphoneCoreImpl implements LinphoneCore {
@ -42,6 +44,9 @@ class LinphoneCoreImpl implements LinphoneCore {
private native boolean isInCall(long nativePtr);
private native boolean isInComingInvitePending(long nativePtr);
private native void acceptCall(long nativePtr);
private native long getCallLog(long nativePtr,int position);
private native int getNumberOfCallLogs(long nativePtr);
LinphoneCoreImpl(LinphoneCoreListener listener, File userConfig,File factoryConfig,Object userdata) throws IOException {
mListener=listener;
@ -109,4 +114,11 @@ class LinphoneCoreImpl implements LinphoneCore {
acceptCall(nativePtr);
}
public List<LinphoneCallLog> getCallLogs() {
List<LinphoneCallLog> logs = new ArrayList<LinphoneCallLog>();
for (int i=0;i < getNumberOfCallLogs(nativePtr);i++) {
logs.add(new LinphoneCallLogImpl(getCallLog(nativePtr, i)));
}
return logs;
}
}

View file

@ -18,7 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package org.linphone.core;
import org.linphone.Linphone;
import org.linphone.LinphoneService;
import android.util.Log;
@ -35,14 +35,14 @@ class LinphoneProxyConfigImpl implements LinphoneProxyConfig {
setProxy(proxy);
enableRegister(enableRegister);
ownPtr=true;
Log.w(Linphone.TAG, "route ["+route+"] not used yet");
Log.w(LinphoneService.TAG, "route ["+route+"] not used yet");
}
protected LinphoneProxyConfigImpl(long aNativePtr) {
nativePtr = aNativePtr;
ownPtr=false;
}
protected void finalize() throws Throwable {
Log.e(Linphone.TAG,"fixme, should release underlying proxy config");
Log.e(LinphoneService.TAG,"fixme, should release underlying proxy config");
// FIXME if (ownPtr) delete(nativePtr);
}
private native long newLinphoneProxyConfig();