From f7d7660662e8b45c355882558fc70584661f4ac7 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Wed, 2 May 2012 10:12:08 +0200 Subject: [PATCH] replace vectores by arrays in linphone core api --- src/org/linphone/HistoryActivity.java | 5 +++-- src/org/linphone/LinphoneUtils.java | 3 +-- src/org/linphone/core/LinphoneCoreImpl.java | 12 ++++++------ submodules/linphone | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/org/linphone/HistoryActivity.java b/src/org/linphone/HistoryActivity.java index 26425456c..ffa379697 100644 --- a/src/org/linphone/HistoryActivity.java +++ b/src/org/linphone/HistoryActivity.java @@ -20,6 +20,8 @@ package org.linphone; +import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.linphone.core.CallDirection; @@ -110,9 +112,8 @@ public class HistoryActivity extends ListActivity { class CallHistoryAdapter extends BaseAdapter { final List mLogs; - @SuppressWarnings("unchecked") CallHistoryAdapter(Context aContext) { - mLogs = LinphoneManager.getLc().getCallLogs(); + mLogs = Arrays.asList(LinphoneManager.getLc().getCallLogs()); } public int getCount() { return mLogs.size(); diff --git a/src/org/linphone/LinphoneUtils.java b/src/org/linphone/LinphoneUtils.java index 14da19f47..41a58cf02 100644 --- a/src/org/linphone/LinphoneUtils.java +++ b/src/org/linphone/LinphoneUtils.java @@ -166,9 +166,8 @@ public final class LinphoneUtils { return calls; } - @SuppressWarnings("unchecked") public static final List getLinphoneCalls(LinphoneCore lc) { - return (List) lc.getCalls(); + return (List) Arrays.asList(lc.getCalls()); } public static final boolean hasExistingResumeableCall(LinphoneCore lc) { diff --git a/src/org/linphone/core/LinphoneCoreImpl.java b/src/org/linphone/core/LinphoneCoreImpl.java index 0dd655fcd..0b2996a03 100644 --- a/src/org/linphone/core/LinphoneCoreImpl.java +++ b/src/org/linphone/core/LinphoneCoreImpl.java @@ -195,11 +195,11 @@ class LinphoneCoreImpl implements LinphoneCore { acceptCall(nativePtr,((LinphoneCallImpl)aCall).nativePtr); } - public synchronized Vector getCallLogs() { + public synchronized LinphoneCallLog[] getCallLogs() { isValid(); - Vector logs = new Vector(); + LinphoneCallLog[] logs = new LinphoneCallLog[getNumberOfCallLogs(nativePtr)]; for (int i=0;i < getNumberOfCallLogs(nativePtr);i++) { - logs.add(new LinphoneCallLogImpl(getCallLog(nativePtr, i))); + logs[i] = new LinphoneCallLogImpl(getCallLog(nativePtr, i)); } return logs; } @@ -540,11 +540,11 @@ class LinphoneCoreImpl implements LinphoneCore { terminateAllCalls(nativePtr); } private native Object getCall(long nativePtr, int position); - @SuppressWarnings("unchecked") public synchronized Vector getCalls() { + public synchronized LinphoneCall[] getCalls() { int size = getCallsNb(nativePtr); - Vector calls = new Vector(size); + LinphoneCall[] calls = new LinphoneCall[size]; for (int i=0; i < size; i++) { - calls.add((LinphoneCall)getCall(nativePtr, i)); + calls[i]=((LinphoneCall)getCall(nativePtr, i)); } return calls; } diff --git a/submodules/linphone b/submodules/linphone index d0ced93c2..504a67b0e 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit d0ced93c25f088c04a9f92b82aa41c5b1f271e23 +Subproject commit 504a67b0e74c9d9a23c95e8e38127368c8276804