blob: 541dca3bee272e0da6e930540db340ee40bc1352 [file] [log] [blame]
alisione2a38e12013-04-25 14:20:20 -04001package com.savoirfairelinux.sflphone.account;
2
3import java.util.ArrayList;
4import java.util.HashMap;
5
6import android.util.Log;
7
alisione2a38e12013-04-25 14:20:20 -04008import com.savoirfairelinux.sflphone.service.ServiceConstants;
alisione2a38e12013-04-25 14:20:20 -04009import com.savoirfairelinux.sflphone.service.VectMap;
10
11public class HistoryHandler {
12 private static final String TAG = HistoryHandler.class.getSimpleName();
13
alisione2a38e12013-04-25 14:20:20 -040014
15 public static ArrayList<HashMap<String, String>> convertSwigToNative(VectMap swigmap) {
16
17 ArrayList<HashMap<String, String>> nativemap = new ArrayList<HashMap<String, String>>();
18
19 Log.w(TAG, "size history " + swigmap.size());
20
21 for (int i = 0; i < swigmap.size(); ++i) {
22 HashMap<String, String> entry = new HashMap<String, String>();
23
24 Log.i(TAG, swigmap.get(i).get(ServiceConstants.HISTORY_ACCOUNT_ID_KEY));
25 Log.i(TAG, swigmap.get(i).get(ServiceConstants.HISTORY_CALLID_KEY));
26 Log.i(TAG, swigmap.get(i).get(ServiceConstants.HISTORY_CONFID_KEY));
27 Log.i(TAG, swigmap.get(i).get(ServiceConstants.HISTORY_DISPLAY_NAME_KEY));
28 Log.i(TAG, swigmap.get(i).get(ServiceConstants.HISTORY_PEER_NUMBER_KEY));
29 Log.i(TAG, swigmap.get(i).get(ServiceConstants.HISTORY_RECORDING_PATH_KEY));
30 Log.i(TAG, swigmap.get(i).get(ServiceConstants.HISTORY_STATE_KEY));
31 Log.i(TAG, swigmap.get(i).get(ServiceConstants.HISTORY_TIMESTAMP_START_KEY));
32 Log.i(TAG, swigmap.get(i).get(ServiceConstants.HISTORY_TIMESTAMP_STOP_KEY));
33 Log.i(TAG, swigmap.get(i).get(ServiceConstants.HISTORY_AUDIO_CODEC_KEY));
alision907bde72013-06-20 14:40:37 -040034
alisione2a38e12013-04-25 14:20:20 -040035
36 entry.put(ServiceConstants.HISTORY_ACCOUNT_ID_KEY, swigmap.get(i).get(ServiceConstants.HISTORY_ACCOUNT_ID_KEY));
37 entry.put(ServiceConstants.HISTORY_CALLID_KEY, swigmap.get(i).get(ServiceConstants.HISTORY_CALLID_KEY));
38 entry.put(ServiceConstants.HISTORY_CONFID_KEY, swigmap.get(i).get(ServiceConstants.HISTORY_CONFID_KEY));
39 entry.put(ServiceConstants.HISTORY_DISPLAY_NAME_KEY, swigmap.get(i).get(ServiceConstants.HISTORY_DISPLAY_NAME_KEY));
40 entry.put(ServiceConstants.HISTORY_PEER_NUMBER_KEY, swigmap.get(i).get(ServiceConstants.HISTORY_PEER_NUMBER_KEY));
41 entry.put(ServiceConstants.HISTORY_RECORDING_PATH_KEY, swigmap.get(i).get(ServiceConstants.HISTORY_RECORDING_PATH_KEY));
42 entry.put(ServiceConstants.HISTORY_STATE_KEY, swigmap.get(i).get(ServiceConstants.HISTORY_STATE_KEY));
43 entry.put(ServiceConstants.HISTORY_TIMESTAMP_START_KEY, swigmap.get(i).get(ServiceConstants.HISTORY_TIMESTAMP_START_KEY));
44 entry.put(ServiceConstants.HISTORY_TIMESTAMP_STOP_KEY, swigmap.get(i).get(ServiceConstants.HISTORY_TIMESTAMP_STOP_KEY));
45 entry.put(ServiceConstants.HISTORY_AUDIO_CODEC_KEY, swigmap.get(i).get(ServiceConstants.HISTORY_AUDIO_CODEC_KEY));
alision907bde72013-06-20 14:40:37 -040046
alisione2a38e12013-04-25 14:20:20 -040047 nativemap.add(entry);
48 }
49
50 return nativemap;
51 }
52}