alision | e2a38e1 | 2013-04-25 14:20:20 -0400 | [diff] [blame] | 1 | package com.savoirfairelinux.sflphone.account; |
| 2 | |
| 3 | import java.util.ArrayList; |
| 4 | import java.util.HashMap; |
| 5 | |
| 6 | import android.util.Log; |
| 7 | |
alision | e2a38e1 | 2013-04-25 14:20:20 -0400 | [diff] [blame] | 8 | import com.savoirfairelinux.sflphone.service.ServiceConstants; |
alision | e2a38e1 | 2013-04-25 14:20:20 -0400 | [diff] [blame] | 9 | import com.savoirfairelinux.sflphone.service.VectMap; |
| 10 | |
| 11 | public class HistoryHandler { |
| 12 | private static final String TAG = HistoryHandler.class.getSimpleName(); |
| 13 | |
alision | e2a38e1 | 2013-04-25 14:20:20 -0400 | [diff] [blame] | 14 | |
| 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)); |
alision | 907bde7 | 2013-06-20 14:40:37 -0400 | [diff] [blame^] | 34 | |
alision | e2a38e1 | 2013-04-25 14:20:20 -0400 | [diff] [blame] | 35 | |
| 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)); |
alision | 907bde7 | 2013-06-20 14:40:37 -0400 | [diff] [blame^] | 46 | |
alision | e2a38e1 | 2013-04-25 14:20:20 -0400 | [diff] [blame] | 47 | nativemap.add(entry); |
| 48 | } |
| 49 | |
| 50 | return nativemap; |
| 51 | } |
| 52 | } |