* Removed custom Spinner, and added Loader instead
* Deleted unused classes
diff --git a/src/com/savoirfairelinux/sflphone/adapters/AccountSelectionAdapter.java b/src/com/savoirfairelinux/sflphone/adapters/AccountSelectionAdapter.java
index 264be71..9f22110 100644
--- a/src/com/savoirfairelinux/sflphone/adapters/AccountSelectionAdapter.java
+++ b/src/com/savoirfairelinux/sflphone/adapters/AccountSelectionAdapter.java
@@ -1,14 +1,8 @@
package com.savoirfairelinux.sflphone.adapters;
import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Stack;
-import android.app.Activity;
import android.content.Context;
-import android.net.Uri;
-import android.os.RemoteException;
-import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -17,35 +11,35 @@
import android.widget.TextView;
import com.savoirfairelinux.sflphone.R;
-import com.savoirfairelinux.sflphone.account.AccountDetailBasic;
+import com.savoirfairelinux.sflphone.model.Account;
import com.savoirfairelinux.sflphone.service.ISipService;
public class AccountSelectionAdapter extends BaseAdapter {
private static final String TAG = AccountSelectionAdapter.class.getSimpleName();
- ArrayList<String> accountIDs;
+ ArrayList<Account> accounts;
Context mContext;
- AccountManager accManager;
+ // AccountManager accManager;
ISipService service;
int selectedAccount = 0;
- public AccountSelectionAdapter(Context cont, ISipService s, ArrayList<String> newList) {
+ public AccountSelectionAdapter(Context cont, ISipService s, ArrayList<Account> newList) {
super();
- accountIDs = newList;
+ accounts = newList;
mContext = cont;
service = s;
- accManager = new AccountManager(mContext);
+ // accManager = new AccountManager(mContext);
}
@Override
public int getCount() {
- return accountIDs.size();
+ return accounts.size();
}
@Override
- public String getItem(int pos) {
- return accountIDs.get(pos);
+ public Account getItem(int pos) {
+ return accounts.get(pos);
}
@Override
@@ -71,8 +65,10 @@
entryView = (AccountView) rowView.getTag();
}
- accManager.displayAccountDetails(accountIDs.get(pos), entryView);
- if(pos == selectedAccount){
+ entryView.alias.setText(accounts.get(pos).getAlias());
+ entryView.host.setText(accounts.get(pos).getHost() + " - " + accounts.get(pos).getRegistered_state());
+ // accManager.displayAccountDetails(accounts.get(pos), entryView);
+ if (pos == selectedAccount) {
entryView.select.setChecked(true);
}
@@ -88,150 +84,161 @@
public RadioButton select;
}
- /**
- * Asynchronous account details retriever
- */
- public class AccountManager {
-
- // private static final String TAG = ImageManager.class.getSimpleName();
-
- private HashMap<String, HashMap<String, String>> accountMap = new HashMap<String, HashMap<String, String>>();
- private AccountQueue accountQueue = new AccountQueue();
- private Thread accountLoaderThread = new Thread(new AccountQueueManager());
-
-
- public AccountManager(Context context) {
- accountLoaderThread.setPriority(Thread.NORM_PRIORITY - 1);
-
- }
-
- public void displayAccountDetails(String id, AccountView account) {
-
- if (accountMap.containsKey(id)) {
-
- HashMap<String, String> details = accountMap.get(id);
- account.alias.setText(details.get(AccountDetailBasic.CONFIG_ACCOUNT_ALIAS));
- account.host.setText(details.get(AccountDetailBasic.CONFIG_ACCOUNT_HOSTNAME));
-
- } else {
- queueAccount(id, account);
- }
- }
-
- private void queueAccount(String id, AccountView row) {
- // This ImageView might have been used for other images, so we clear
- // the queue of old tasks before starting.
-// accountQueue.Clean(row);
- AccountRef p = new AccountRef(id, row);
-
- synchronized (accountQueue.accountRefsStack) {
- accountQueue.accountRefsStack.push(p);
- accountQueue.accountRefsStack.notifyAll();
- }
-
- // Start thread if it's not started yet
- if (accountLoaderThread.getState() == Thread.State.NEW) {
- accountLoaderThread.start();
- }
- }
-
- /** Classes **/
-
- private class AccountRef {
- public String accountID;
- public AccountView row;
-
- public AccountRef(String u, AccountView i) {
- accountID = u;
- row = i;
- }
- }
-
- private class AccountQueue {
- private Stack<AccountRef> accountRefsStack = new Stack<AccountRef>();
-
- // removes all instances of this account
-// public void Clean(AccountView view) {
-//
-// for (int i = 0; i < accountRefsStack.size();) {
-// if (accountRefsStack.get(i).row == view)
-// accountRefsStack.remove(i);
-// else
-// ++i;
-// }
-// }
- }
-
- private class AccountQueueManager implements Runnable {
- @Override
- public void run() {
- try {
- while (true) {
- // Thread waits until there are accountsID in the queue to be retrieved
- if (accountQueue.accountRefsStack.size() == 0) {
- synchronized (accountQueue.accountRefsStack) {
- accountQueue.accountRefsStack.wait();
- }
- }
-
- // When we have accounts to load
- if (accountQueue.accountRefsStack.size() != 0) {
- AccountRef accountToLoad;
-
- synchronized (accountQueue.accountRefsStack) {
- accountToLoad = accountQueue.accountRefsStack.pop();
- }
-
- HashMap<String, String> details = (HashMap<String, String>) service.getAccountDetails(accountToLoad.accountID);
-
- accountMap.put(accountToLoad.accountID, details);
- AccountDisplayer accDisplayer = new AccountDisplayer(details, accountToLoad.row);
- Activity a = (Activity) mContext;
-
- a.runOnUiThread(accDisplayer);
-
- }
-
- if (Thread.interrupted())
- break;
- }
- } catch (InterruptedException e) {
- Log.e(TAG, e.toString());
- } catch (RemoteException e) {
- Log.e(TAG, e.toString());
- }
- }
- }
-
- // Used to display details in the UI thread
- private class AccountDisplayer implements Runnable {
- HashMap<String, String> displayDetails;
- AccountView displayRow;
-
- public AccountDisplayer(HashMap<String, String> details, AccountView row) {
- displayRow = row;
- displayDetails = details;
- }
-
- public void run() {
- displayRow.alias.setText(displayDetails.get(AccountDetailBasic.CONFIG_ACCOUNT_ALIAS));
- displayRow.host.setText(displayDetails.get(AccountDetailBasic.CONFIG_ACCOUNT_HOSTNAME));
- }
- }
-
- public void removeFromCache(Uri uri) {
- if (accountMap.containsKey(uri)) {
- accountMap.remove(uri);
- }
- }
- }
-
+ // /**
+ // * Asynchronous account details retriever
+ // */
+ // public class AccountManager {
+ //
+ // // private static final String TAG = ImageManager.class.getSimpleName();
+ //
+ // private HashMap<String, HashMap<String, String>> accountMap = new HashMap<String, HashMap<String, String>>();
+ // private AccountQueue accountQueue = new AccountQueue();
+ // private Thread accountLoaderThread = new Thread(new AccountQueueManager());
+ //
+ //
+ // public AccountManager(Context context) {
+ // accountLoaderThread.setPriority(Thread.NORM_PRIORITY - 1);
+ //
+ // }
+ //
+ // public void displayAccountDetails(String id, AccountView account) {
+ //
+ // if (accountMap.containsKey(id)) {
+ //
+ // HashMap<String, String> details = accountMap.get(id);
+ // account.alias.setText(details.get(AccountDetailBasic.CONFIG_ACCOUNT_ALIAS));
+ // account.host.setText(details.get(AccountDetailBasic.CONFIG_ACCOUNT_HOSTNAME));
+ //
+ // } else {
+ // queueAccount(id, account);
+ // }
+ // }
+ //
+ // private void queueAccount(String id, AccountView row) {
+ // // This ImageView might have been used for other images, so we clear
+ // // the queue of old tasks before starting.
+ // // accountQueue.Clean(row);
+ // AccountRef p = new AccountRef(id, row);
+ //
+ // synchronized (accountQueue.accountRefsStack) {
+ // accountQueue.accountRefsStack.push(p);
+ // accountQueue.accountRefsStack.notifyAll();
+ // }
+ //
+ // // Start thread if it's not started yet
+ // if (accountLoaderThread.getState() == Thread.State.NEW) {
+ // accountLoaderThread.start();
+ // }
+ // }
+ //
+ // /** Classes **/
+ //
+ // private class AccountRef {
+ // public String accountID;
+ // public AccountView row;
+ //
+ // public AccountRef(String u, AccountView i) {
+ // accountID = u;
+ // row = i;
+ // }
+ // }
+ //
+ // private class AccountQueue {
+ // private Stack<AccountRef> accountRefsStack = new Stack<AccountRef>();
+ //
+ // // removes all instances of this account
+ // // public void Clean(AccountView view) {
+ // //
+ // // for (int i = 0; i < accountRefsStack.size();) {
+ // // if (accountRefsStack.get(i).row == view)
+ // // accountRefsStack.remove(i);
+ // // else
+ // // ++i;
+ // // }
+ // // }
+ // }
+ //
+ // private class AccountQueueManager implements Runnable {
+ // @Override
+ // public void run() {
+ // try {
+ // while (true) {
+ // // Thread waits until there are accountsID in the queue to be retrieved
+ // if (accountQueue.accountRefsStack.size() == 0) {
+ // synchronized (accountQueue.accountRefsStack) {
+ // accountQueue.accountRefsStack.wait();
+ // }
+ // }
+ //
+ // // When we have accounts to load
+ // if (accountQueue.accountRefsStack.size() != 0) {
+ // AccountRef accountToLoad;
+ //
+ // synchronized (accountQueue.accountRefsStack) {
+ // accountToLoad = accountQueue.accountRefsStack.pop();
+ // }
+ //
+ // HashMap<String, String> details = (HashMap<String, String>) service.getAccountDetails(accountToLoad.accountID);
+ //
+ // accountMap.put(accountToLoad.accountID, details);
+ // AccountDisplayer accDisplayer = new AccountDisplayer(details, accountToLoad.row);
+ // Activity a = (Activity) mContext;
+ //
+ // a.runOnUiThread(accDisplayer);
+ //
+ // }
+ //
+ // if (Thread.interrupted())
+ // break;
+ // }
+ // } catch (InterruptedException e) {
+ // Log.e(TAG, e.toString());
+ // } catch (RemoteException e) {
+ // Log.e(TAG, e.toString());
+ // }
+ // }
+ // }
+ //
+ // // Used to display details in the UI thread
+ // private class AccountDisplayer implements Runnable {
+ // HashMap<String, String> displayDetails;
+ // AccountView displayRow;
+ //
+ // public AccountDisplayer(HashMap<String, String> details, AccountView row) {
+ // displayRow = row;
+ // displayDetails = details;
+ // }
+ //
+ // public void run() {
+ // displayRow.alias.setText(displayDetails.get(AccountDetailBasic.CONFIG_ACCOUNT_ALIAS));
+ // displayRow.host.setText(displayDetails.get(AccountDetailBasic.CONFIG_ACCOUNT_HOSTNAME));
+ // }
+ // }
+ //
+ // public void removeFromCache(Uri uri) {
+ // if (accountMap.containsKey(uri)) {
+ // accountMap.remove(uri);
+ // }
+ // }
+ // }
+ //
public void setSelectedAccount(int pos) {
- selectedAccount = pos;
+ selectedAccount = pos;
}
- public String getSelectedAccount() {
- return accountIDs.get(selectedAccount);
+ public Account getSelectedAccount() {
+ return accounts.get(selectedAccount);
+ }
+
+ public void removeAll() {
+ accounts.clear();
+ notifyDataSetChanged();
+
+ }
+
+ public void addAll(ArrayList<Account> results) {
+ accounts.addAll(results);
+ notifyDataSetChanged();
}
}
diff --git a/src/com/savoirfairelinux/sflphone/adapters/CallPagerAdapter.java b/src/com/savoirfairelinux/sflphone/adapters/CallPagerAdapter.java
index 8daa9f1..b6d7f49 100644
--- a/src/com/savoirfairelinux/sflphone/adapters/CallPagerAdapter.java
+++ b/src/com/savoirfairelinux/sflphone/adapters/CallPagerAdapter.java
@@ -120,8 +120,8 @@
}
public void remove(String callID) {
-// calls.remove(callID);
-// notifyDataSetChanged();
+ calls.remove(callID);
+ notifyDataSetChanged();
}
}
\ No newline at end of file
diff --git a/src/com/savoirfairelinux/sflphone/adapters/ContactPictureLoader.java b/src/com/savoirfairelinux/sflphone/adapters/ContactPictureLoader.java
index b020e50..9254e8c 100644
--- a/src/com/savoirfairelinux/sflphone/adapters/ContactPictureLoader.java
+++ b/src/com/savoirfairelinux/sflphone/adapters/ContactPictureLoader.java
@@ -1,3 +1,34 @@
+/*
+ * Copyright (C) 2004-2012 Savoir-Faire Linux Inc.
+ *
+ * Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
+ *
+ * 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 3 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Additional permission under GNU GPL version 3 section 7:
+ *
+ * If you modify this program, or any covered work, by linking or
+ * combining it with the OpenSSL project's OpenSSL library (or a
+ * modified version of that library), containing parts covered by the
+ * terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
+ * grants you additional permission to convey the resulting work.
+ * Corresponding Source for a non-source form of such a combination
+ * shall include the source code for the parts of OpenSSL used as well
+ * as that of the covered work.
+ */
+
package com.savoirfairelinux.sflphone.adapters;
import java.io.InputStream;
diff --git a/src/com/savoirfairelinux/sflphone/adapters/StarredContactsAdapter.java b/src/com/savoirfairelinux/sflphone/adapters/StarredContactsAdapter.java
index db18074..c09dfe7 100644
--- a/src/com/savoirfairelinux/sflphone/adapters/StarredContactsAdapter.java
+++ b/src/com/savoirfairelinux/sflphone/adapters/StarredContactsAdapter.java
@@ -1,3 +1,34 @@
+/*
+ * Copyright (C) 2004-2012 Savoir-Faire Linux Inc.
+ *
+ * Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
+ *
+ * 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 3 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Additional permission under GNU GPL version 3 section 7:
+ *
+ * If you modify this program, or any covered work, by linking or
+ * combining it with the OpenSSL project's OpenSSL library (or a
+ * modified version of that library), containing parts covered by the
+ * terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
+ * grants you additional permission to convey the resulting work.
+ * Corresponding Source for a non-source form of such a combination
+ * shall include the source code for the parts of OpenSSL used as well
+ * as that of the covered work.
+ */
+
package com.savoirfairelinux.sflphone.adapters;
import java.util.ArrayList;
diff --git a/src/com/savoirfairelinux/sflphone/client/CallActivity.java b/src/com/savoirfairelinux/sflphone/client/CallActivity.java
index 1f39852..3c3ac6a 100644
--- a/src/com/savoirfairelinux/sflphone/client/CallActivity.java
+++ b/src/com/savoirfairelinux/sflphone/client/CallActivity.java
@@ -187,13 +187,13 @@
fr.changeCallState(SipCall.CALL_STATE_CURRENT);
} else if (newState.equals("HUNGUP")) {
-// mCallPagerAdapter.remove(callID);
+ mCallPagerAdapter.remove(callID);
} else if (newState.equals("BUSY")) {
-// mCallPagerAdapter.remove(callID);
+ mCallPagerAdapter.remove(callID);
} else if (newState.equals("FAILURE")) {
-// mCallPagerAdapter.remove(callID);
+ mCallPagerAdapter.remove(callID);
} else if (newState.equals("HOLD")) {
fr.changeCallState(SipCall.CALL_STATE_HOLD);
diff --git a/src/com/savoirfairelinux/sflphone/client/SFLPhoneHomeActivity.java b/src/com/savoirfairelinux/sflphone/client/SFLPhoneHomeActivity.java
index c0b9409..d47a653 100644
--- a/src/com/savoirfairelinux/sflphone/client/SFLPhoneHomeActivity.java
+++ b/src/com/savoirfairelinux/sflphone/client/SFLPhoneHomeActivity.java
@@ -2,6 +2,7 @@
* Copyright (C) 2004-2012 Savoir-Faire Linux Inc.
*
* Author: Adrien Beraud <adrien.beraud@gmail.com>
+ * Alexandre Lision <alexandre.lision@savoirfairelinux.com>
*
* 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
@@ -405,7 +406,7 @@
mCallElementList.addCall(c);
CallContact.ContactBuilder builder = new ContactBuilder();
- infos.contact = builder.buildUnknownContact(infos.mPhone);
+ infos.contacts.add(builder.buildUnknownContact(infos.mPhone));
launchCallActivity(infos, CallManagerCallBack.INCOMING_CALL);
@@ -444,7 +445,7 @@
info.mPhone = c.getSipPhone().getNumber();
info.mEmail = c.getmEmail();
info.mCallType = SipCall.CALL_TYPE_OUTGOING;
- info.contact = c;
+ info.contacts.add(c);
launchCallActivity(info, "call");
@@ -465,7 +466,7 @@
CallContact.ContactBuilder builder = new ContactBuilder();
- info.contact = builder.buildUnknownContact(to);
+ info.contacts.add(builder.buildUnknownContact(info.mPhone));
launchCallActivity(info, "call");
diff --git a/src/com/savoirfairelinux/sflphone/fragments/CallFragment.java b/src/com/savoirfairelinux/sflphone/fragments/CallFragment.java
index 5596565..b4f5913 100644
--- a/src/com/savoirfairelinux/sflphone/fragments/CallFragment.java
+++ b/src/com/savoirfairelinux/sflphone/fragments/CallFragment.java
@@ -108,8 +108,8 @@
private void callContact(SipCall.CallInfo infos) {
// TODO off-thread image loading
Bubble contact_bubble;
- if (infos.contact.getPhoto_id() > 0) {
- Bitmap photo = ContactPictureLoader.loadContactPhoto(getActivity().getContentResolver(), infos.contact.getId());
+ if (infos.contacts.get(0).getPhoto_id() > 0) {
+ Bitmap photo = ContactPictureLoader.loadContactPhoto(getActivity().getContentResolver(), infos.contacts.get(0).getId());
contact_bubble = new Bubble(getActivity(), screenCenter.x, screenCenter.y, 150, photo);
} else {
contact_bubble = new Bubble(getActivity(), screenCenter.x, screenCenter.y, 150, R.drawable.ic_contact_picture);
@@ -124,9 +124,9 @@
}
}));
- contact_bubble.contact = infos.contact;
+ contact_bubble.contact = infos.contacts.get(0);
model.listBubbles.add(contact_bubble);
- contacts.put(infos.contact, contact_bubble);
+ contacts.put(infos.contacts.get(0), contact_bubble);
try {
mCallbacks.getService().placeCall(infos.mAccountID, infos.mCallID, infos.mPhone);
diff --git a/src/com/savoirfairelinux/sflphone/fragments/DialingFragment.java b/src/com/savoirfairelinux/sflphone/fragments/DialingFragment.java
index 724e2f9..97afcd0 100644
--- a/src/com/savoirfairelinux/sflphone/fragments/DialingFragment.java
+++ b/src/com/savoirfairelinux/sflphone/fragments/DialingFragment.java
@@ -1,14 +1,44 @@
+/*
+ * Copyright (C) 2004-2012 Savoir-Faire Linux Inc.
+ *
+ * Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
+ *
+ * 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 3 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Additional permission under GNU GPL version 3 section 7:
+ *
+ * If you modify this program, or any covered work, by linking or
+ * combining it with the OpenSSL project's OpenSSL library (or a
+ * modified version of that library), containing parts covered by the
+ * terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
+ * grants you additional permission to convey the resulting work.
+ * Corresponding Source for a non-source form of such a combination
+ * shall include the source code for the parts of OpenSSL used as well
+ * as that of the covered work.
+ */
+
package com.savoirfairelinux.sflphone.fragments;
import java.util.ArrayList;
-import java.util.Random;
import android.app.Activity;
import android.app.Fragment;
+import android.app.LoaderManager.LoaderCallbacks;
import android.content.Context;
+import android.content.Loader;
import android.os.Bundle;
-import android.os.RemoteException;
-import android.text.InputType;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
@@ -16,17 +46,21 @@
import android.view.ViewGroup;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodManager;
+import android.widget.AdapterView;
+import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.Button;
import android.widget.ImageButton;
+import android.widget.RadioButton;
+import android.widget.Spinner;
import com.savoirfairelinux.sflphone.R;
-import com.savoirfairelinux.sflphone.account.AccountSelectionSpinner;
-import com.savoirfairelinux.sflphone.client.receiver.CallListReceiver;
-import com.savoirfairelinux.sflphone.model.SipCall;
+import com.savoirfairelinux.sflphone.adapters.AccountSelectionAdapter;
+import com.savoirfairelinux.sflphone.loaders.AccountsLoader;
+import com.savoirfairelinux.sflphone.model.Account;
import com.savoirfairelinux.sflphone.service.ISipService;
import com.savoirfairelinux.sflphone.views.ClearableEditText;
-public class DialingFragment extends Fragment {
+public class DialingFragment extends Fragment implements LoaderCallbacks<ArrayList<Account>> {
private static final String TAG = HistoryFragment.class.getSimpleName();
public static final String ARG_SECTION_NUMBER = "section_number";
@@ -34,8 +68,11 @@
private ISipService service;
ClearableEditText textField;
- private AccountSelectionSpinner mAccountSelectionSpinner;
+ // private AccountSelectionSpinner mAccountSelectionSpinner;
+
+ AccountSelectionAdapter mAdapter;
private Callbacks mCallbacks = sDummyCallbacks;
+ private Spinner spinnerAccounts;
/**
* A dummy implementation of the {@link Callbacks} interface that does nothing. Used only when this fragment is not attached to an activity.
@@ -88,17 +125,40 @@
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {
View inflatedView = inflater.inflate(R.layout.frag_dialing, parent, false);
+
+ spinnerAccounts = (Spinner) inflatedView.findViewById(R.id.account_selection);
- mAccountSelectionSpinner = (AccountSelectionSpinner) inflatedView.findViewById(R.id.account_selection_button);
+ spinnerAccounts.setOnItemSelectedListener(new OnItemSelectedListener() {
+
+ @Override
+ public void onItemSelected(AdapterView<?> arg0, View view, int pos, long arg3) {
+ // public void onClick(DialogInterface dialog, int which) {
+
+ Log.i(TAG, "Selected Account: " + mAdapter.getItem(pos));
+ if (null != view) {
+ ((RadioButton) view.findViewById(R.id.account_checked)).toggle();
+ }
+ mAdapter.setSelectedAccount(pos);
+ // accountSelectedNotifyAccountList(mAdapter.getItem(pos));
+ // setSelection(cursor.getPosition(),true);
+
+ }
+
+ @Override
+ public void onNothingSelected(AdapterView<?> arg0) {
+ // TODO Auto-generated method stub
+
+ }
+ });
textField = (ClearableEditText) inflatedView.findViewById(R.id.textField);
((ImageButton) inflatedView.findViewById(R.id.buttonCall)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
-
- String accountID = mAccountSelectionSpinner.getAccount();
+
+ Account account = mAdapter.getSelectedAccount();
String to = textField.getText().toString();
- mCallbacks.onCallDialed(accountID, to);
+ mCallbacks.onCallDialed(account.getAccountID(), to);
}
});
@@ -107,7 +167,7 @@
@Override
public void onClick(View v) {
textField.setInputType(EditorInfo.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
- InputMethodManager lManager = (InputMethodManager)getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
+ InputMethodManager lManager = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
lManager.showSoftInput(textField.getEdit_text(), 0);
}
});
@@ -117,7 +177,7 @@
@Override
public void onClick(View v) {
textField.setInputType(EditorInfo.TYPE_CLASS_NUMBER);
- InputMethodManager lManager = (InputMethodManager)getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
+ InputMethodManager lManager = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
lManager.showSoftInput(textField.getEdit_text(), 0);
}
});
@@ -136,9 +196,8 @@
}
-
- public String getSelectedAccount() {
- return mAccountSelectionSpinner.getAccount();
+ public Account getSelectedAccount() {
+ return mAdapter.getSelectedAccount();
}
/**
@@ -150,16 +209,32 @@
if (isReady) {
service = isip;
- ArrayList<String> accountList;
- try {
- accountList = (ArrayList<String>) mCallbacks.getService().getAccountList();
- Log.w(TAG, "SIP service binded accounts " + accountList.size());
- mAccountSelectionSpinner.populate(mCallbacks.getService(), accountList);
- } catch (RemoteException e) {
- Log.i(TAG, e.toString());
- }
+
+ mAdapter = new AccountSelectionAdapter(getActivity(), service, new ArrayList<Account>());
+ spinnerAccounts.setAdapter(mAdapter);
+ getActivity().getLoaderManager().initLoader(555, null, this);
}
}
+ @Override
+ public Loader<ArrayList<Account>> onCreateLoader(int id, Bundle args) {
+ AccountsLoader l = new AccountsLoader(getActivity(), service);
+ l.forceLoad();
+ return l;
+ }
+
+ @Override
+ public void onLoadFinished(Loader<ArrayList<Account>> loader, ArrayList<Account> results) {
+ mAdapter.removeAll();
+ mAdapter.addAll(results);
+
+ }
+
+ @Override
+ public void onLoaderReset(Loader<ArrayList<Account>> arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
}
diff --git a/src/com/savoirfairelinux/sflphone/loaders/AccountsLoader.java b/src/com/savoirfairelinux/sflphone/loaders/AccountsLoader.java
new file mode 100644
index 0000000..7194096
--- /dev/null
+++ b/src/com/savoirfairelinux/sflphone/loaders/AccountsLoader.java
@@ -0,0 +1,63 @@
+package com.savoirfairelinux.sflphone.loaders;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import android.content.AsyncTaskLoader;
+import android.content.Context;
+import android.os.RemoteException;
+import android.util.Log;
+
+import com.savoirfairelinux.sflphone.account.AccountDetailAdvanced;
+import com.savoirfairelinux.sflphone.account.AccountDetailBasic;
+import com.savoirfairelinux.sflphone.model.Account;
+import com.savoirfairelinux.sflphone.service.ISipService;
+
+public class AccountsLoader extends AsyncTaskLoader<ArrayList<Account>> {
+
+ private static final String TAG = AccountsLoader.class.getSimpleName();
+
+ ISipService service;
+
+ public AccountsLoader(Context context, ISipService ref) {
+ super(context);
+ service = ref;
+ }
+
+ @Override
+ public ArrayList<Account> loadInBackground() {
+
+
+ ArrayList<Account> result = new ArrayList<Account>();
+ Account.AccountBuilder builder = Account.AccountBuilder.getInstance();
+
+ ArrayList<String> accountIDs;
+ HashMap<String, String> details;
+ try {
+ accountIDs = (ArrayList<String>) service.getAccountList();
+ for (String id : accountIDs) {
+
+ if(id.contentEquals("IP2IP")){
+ continue;
+ }
+ details = (HashMap<String, String>) service.getAccountDetails(id);
+
+ builder.setAccountID(id).setAlias(details.get(AccountDetailBasic.CONFIG_ACCOUNT_ALIAS))
+ .setHost(details.get(AccountDetailBasic.CONFIG_ACCOUNT_HOSTNAME))
+ .setRegisteredState(details.get(AccountDetailAdvanced.CONFIG_ACCOUNT_REGISTRATION_STATUS));
+
+ try {
+ result.add(builder.build());
+ } catch (Exception e) {
+ Log.e(TAG, e.toString());
+ }
+
+ }
+ } catch (RemoteException e) {
+ Log.e(TAG, e.toString());
+ }
+
+ return result;
+ }
+
+}
diff --git a/src/com/savoirfairelinux/sflphone/loaders/ContactsLoader.java b/src/com/savoirfairelinux/sflphone/loaders/ContactsLoader.java
index 495ebc6..61ebcc3 100644
--- a/src/com/savoirfairelinux/sflphone/loaders/ContactsLoader.java
+++ b/src/com/savoirfairelinux/sflphone/loaders/ContactsLoader.java
@@ -52,7 +52,7 @@
while (cPhones.moveToNext()) {
builder.addPhoneNumber(cPhones.getString(cPhones.getColumnIndex(Phone.NUMBER)), cPhones.getInt(cPhones.getColumnIndex(Phone.TYPE)));
- Log.i(TAG,"Phone:"+cPhones.getString(cPhones.getColumnIndex(Phone.NUMBER)));
+// Log.i(TAG,"Phone:"+cPhones.getString(cPhones.getColumnIndex(Phone.NUMBER)));
}
cPhones.close();
@@ -61,7 +61,7 @@
while (cSip.moveToNext()) {
builder.addSipNumber(cSip.getString(cSip.getColumnIndex(SipAddress.SIP_ADDRESS)), cSip.getInt(cSip.getColumnIndex(SipAddress.TYPE)));
- Log.i(TAG,"Phone:"+cSip.getString(cSip.getColumnIndex(SipAddress.SIP_ADDRESS)));
+// Log.i(TAG,"Phone:"+cSip.getString(cSip.getColumnIndex(SipAddress.SIP_ADDRESS)));
}
cSip.close();
diff --git a/src/com/savoirfairelinux/sflphone/model/Account.java b/src/com/savoirfairelinux/sflphone/model/Account.java
new file mode 100644
index 0000000..13f5d15
--- /dev/null
+++ b/src/com/savoirfairelinux/sflphone/model/Account.java
@@ -0,0 +1,167 @@
+/*
+ * Copyright (C) 2004-2012 Savoir-Faire Linux Inc.
+ *
+ * Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
+ *
+ * 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 3 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Additional permission under GNU GPL version 3 section 7:
+ *
+ * If you modify this program, or any covered work, by linking or
+ * combining it with the OpenSSL project's OpenSSL library (or a
+ * modified version of that library), containing parts covered by the
+ * terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
+ * grants you additional permission to convey the resulting work.
+ * Corresponding Source for a non-source form of such a combination
+ * shall include the source code for the parts of OpenSSL used as well
+ * as that of the covered work.
+ */
+
+package com.savoirfairelinux.sflphone.model;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.util.Log;
+
+public class Account implements Parcelable {
+
+ String accountID;
+ String host;
+ String registered_state;
+ String alias;
+
+ private Account(String bAccountID, String bHost, String bRegistered_state, String bAlias) {
+ accountID = bAccountID;
+ host = bHost;
+ registered_state = bRegistered_state;
+ alias = bAlias;
+ }
+
+ public String getAccountID() {
+ return accountID;
+ }
+
+ public void setAccountID(String accountID) {
+ this.accountID = accountID;
+ }
+
+ public String getHost() {
+ return host;
+ }
+
+ public void setHost(String host) {
+ this.host = host;
+ }
+
+ public String getRegistered_state() {
+ return registered_state;
+ }
+
+ public void setRegistered_state(String registered_state) {
+ this.registered_state = registered_state;
+ }
+
+ public String getAlias() {
+ return alias;
+ }
+
+ public void setAlias(String alias) {
+ this.alias = alias;
+ }
+
+ public Account(Parcel in) {
+ readFromParcel(in);
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int arg1) {
+
+ dest.writeString(accountID);
+ dest.writeString(host);
+ dest.writeString(registered_state);
+ dest.writeString(alias);
+ }
+
+ private void readFromParcel(Parcel in) {
+
+ accountID = in.readString();
+ host = in.readString();
+ registered_state = in.readString();
+ alias = in.readString();
+ }
+
+ public static final Parcelable.Creator<Account> CREATOR = new Parcelable.Creator<Account>() {
+ @Override
+ public Account createFromParcel(Parcel in) {
+ return new Account(in);
+ }
+
+ @Override
+ public Account[] newArray(int size) {
+ return new Account[size];
+ }
+ };
+
+ public static class AccountBuilder {
+
+ String bAccountID;
+ String bHost;
+ String bRegistered_state;
+ String bAlias;
+
+ private static final String TAG = AccountBuilder.class.getSimpleName();
+
+ public AccountBuilder setHost(String h) {
+ Log.i(TAG, "setHost" + h);
+ bHost = h;
+ return this;
+ }
+
+ public AccountBuilder setAlias(String h) {
+ Log.i(TAG, "setAlias" + h);
+ bAlias = h;
+ return this;
+ }
+
+ public AccountBuilder setRegisteredState(String h) {
+ Log.i(TAG, "setRegisteredState" + h);
+ bRegistered_state = h;
+ return this;
+ }
+
+ public AccountBuilder setAccountID(String h) {
+ Log.i(TAG, "setAccountID" + h);
+ bAccountID = h;
+ return this;
+ }
+
+ public Account build() throws Exception {
+ if (bHost.contentEquals("") || bAlias.contentEquals("") || bAccountID.contentEquals("") || bRegistered_state.contentEquals("")) {
+ throw new Exception("Builders parameters missing");
+ }
+ return new Account(bAccountID, bHost, bRegistered_state, bAlias);
+ }
+
+ public static AccountBuilder getInstance() {
+ return new AccountBuilder();
+ }
+ }
+
+}
diff --git a/src/com/savoirfairelinux/sflphone/model/CallContact.java b/src/com/savoirfairelinux/sflphone/model/CallContact.java
index 4a69012..77d9f2b 100644
--- a/src/com/savoirfairelinux/sflphone/model/CallContact.java
+++ b/src/com/savoirfairelinux/sflphone/model/CallContact.java
@@ -1,7 +1,7 @@
/*
* Copyright (C) 2004-2012 Savoir-Faire Linux Inc.
*
- * Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com>
+ * Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
*
* 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
@@ -30,13 +30,10 @@
*/
package com.savoirfairelinux.sflphone.model;
-import java.lang.reflect.Array;
import java.util.ArrayList;
-import java.util.Arrays;
import android.os.Parcel;
import android.os.Parcelable;
-import android.provider.Contacts.Phones;
public class CallContact implements Parcelable {
@@ -237,7 +234,7 @@
number = in.readString();
}
- public static final Parcelable.Creator<Phone> CREATOR = new Parcelable.Creator() {
+ public static final Parcelable.Creator<Phone> CREATOR = new Parcelable.Creator<Phone>() {
@Override
public Phone createFromParcel(Parcel in) {
return new Phone(in);
diff --git a/src/com/savoirfairelinux/sflphone/model/SipCall.java b/src/com/savoirfairelinux/sflphone/model/SipCall.java
index c00f757..6d14257 100644
--- a/src/com/savoirfairelinux/sflphone/model/SipCall.java
+++ b/src/com/savoirfairelinux/sflphone/model/SipCall.java
@@ -42,12 +42,10 @@
import com.savoirfairelinux.sflphone.service.ISipService;
-public class SipCall
-{
+public class SipCall {
final static String TAG = "SipCall";
public CallInfo mCallInfo;
-
public static final int CALL_TYPE_UNDETERMINED = 0;
public static final int CALL_TYPE_INCOMING = 1;
public static final int CALL_TYPE_OUTGOING = 2;
@@ -62,21 +60,20 @@
public static final int CALL_STATE_HOLD = 7;
public static final int CALL_STATE_UNHOLD = 8;
- public static final int MEDIA_STATE_NONE = 0; // No media currently
- public static final int MEDIA_STATE_ACTIVE = 1; // Media is active
- public static final int MEDIA_STATE_LOCAL_HOLD = 2; // Media is put on hold bu user
+ public static final int MEDIA_STATE_NONE = 0; // No media currently
+ public static final int MEDIA_STATE_ACTIVE = 1; // Media is active
+ public static final int MEDIA_STATE_LOCAL_HOLD = 2; // Media is put on hold bu user
public static final int MEDIA_STATE_REMOTE_HOLD = 3; // Media is put on hold by peer
- public static final int MEDIA_STATE_ERROR = 5; // Media is in error state
+ public static final int MEDIA_STATE_ERROR = 5; // Media is in error state
- public static class CallInfo implements Parcelable
- {
+ public static class CallInfo implements Parcelable {
public String mCallID = "";
public String mAccountID = "";
public String mDisplayName = "";
public String mPhone = "";
public String mEmail = "";
public String mRemoteContact = "";
- public CallContact contact = null;
+ public ArrayList<CallContact> contacts = new ArrayList<CallContact>();
public int mCallType = CALL_TYPE_UNDETERMINED;
public int mCallState = CALL_STATE_NONE;
public int mMediaState = MEDIA_STATE_NONE;
@@ -99,7 +96,7 @@
list.add(mRemoteContact);
out.writeStringList(list);
- out.writeParcelable(contact, 0);
+ out.writeTypedList(contacts);
out.writeInt(mCallType);
out.writeInt(mCallState);
out.writeInt(mMediaState);
@@ -115,7 +112,8 @@
}
};
- public CallInfo() {}
+ public CallInfo() {
+ }
private CallInfo(Parcel in) {
ArrayList<String> list = in.createStringArrayList();
@@ -128,7 +126,8 @@
mEmail = list.get(4);
mRemoteContact = list.get(5);
- contact = in.readParcelable(CallContact.class.getClassLoader());
+ contacts = in.createTypedArrayList(CallContact.CREATOR);
+
mCallType = in.readInt();
mCallState = in.readInt();
mMediaState = in.readInt();
@@ -142,18 +141,14 @@
}
}
- public SipCall()
- {
- mCallInfo = new CallInfo();
+ public SipCall() {
+ mCallInfo = new CallInfo();
}
- public SipCall(CallInfo info)
- {
- mCallInfo = info;
+ public SipCall(CallInfo info) {
+ mCallInfo = info;
}
-
-
public void setCallID(String callID) {
mCallInfo.mCallID = callID;
}
@@ -221,39 +216,38 @@
public String getCallStateString() {
String state;
- switch(mCallInfo.mCallState) {
- case CALL_STATE_INCOMING:
- state = "INCOMING";
- break;
- case CALL_STATE_RINGING:
- state = "RINGING";
- break;
- case CALL_STATE_CURRENT:
- state = "CURRENT";
- break;
- case CALL_STATE_HUNGUP:
- state = "HUNGUP";
- break;
- case CALL_STATE_BUSY:
- state = "BUSY";
- break;
- case CALL_STATE_FAILURE:
- state = "FAILURE";
- break;
- case CALL_STATE_HOLD:
- state = "HOLD";
- break;
- case CALL_STATE_UNHOLD:
- state = "UNHOLD";
- break;
- default:
- state = "NULL";
+ switch (mCallInfo.mCallState) {
+ case CALL_STATE_INCOMING:
+ state = "INCOMING";
+ break;
+ case CALL_STATE_RINGING:
+ state = "RINGING";
+ break;
+ case CALL_STATE_CURRENT:
+ state = "CURRENT";
+ break;
+ case CALL_STATE_HUNGUP:
+ state = "HUNGUP";
+ break;
+ case CALL_STATE_BUSY:
+ state = "BUSY";
+ break;
+ case CALL_STATE_FAILURE:
+ state = "FAILURE";
+ break;
+ case CALL_STATE_HOLD:
+ state = "HOLD";
+ break;
+ case CALL_STATE_UNHOLD:
+ state = "UNHOLD";
+ break;
+ default:
+ state = "NULL";
}
return state;
}
-
public void setMediaState(int mediaState) {
mCallInfo.mMediaState = mediaState;
}
@@ -262,13 +256,9 @@
return mCallInfo.mMediaState;
}
-
-
- public boolean notifyServiceAnswer(ISipService service)
- {
+ public boolean notifyServiceAnswer(ISipService service) {
int callState = getCallStateInt();
- if((callState != CALL_STATE_RINGING) &&
- (callState != CALL_STATE_NONE)) {
+ if ((callState != CALL_STATE_RINGING) && (callState != CALL_STATE_NONE)) {
return false;
}
@@ -282,38 +272,32 @@
}
/**
- * Perform hangup action without sending request to the service
- * Used when SipService haved been notified that this call hung up
+ * Perform hangup action without sending request to the service Used when SipService haved been notified that this call hung up
*/
-// public void hangupUpdateUi() {
-// Log.i(TAG, "Hangup call " + mCallInfo.mCallID);
-//
-// if(mCallElementList != null)
-// mCallElementList.removeCall(this);
-//
-// if(mHome != null)
-// mHome.onUnselectedCallAction();
-// }
+ // public void hangupUpdateUi() {
+ // Log.i(TAG, "Hangup call " + mCallInfo.mCallID);
+ //
+ // if(mCallElementList != null)
+ // mCallElementList.removeCall(this);
+ //
+ // if(mHome != null)
+ // mHome.onUnselectedCallAction();
+ // }
/**
* Perform hangup action and send request to the service
*/
- public boolean notifyServiceHangup(ISipService service)
- {
+ public boolean notifyServiceHangup(ISipService service) {
try {
- if((getCallStateInt() == CALL_STATE_NONE) ||
- (getCallStateInt() == CALL_STATE_CURRENT) ||
- (getCallStateInt() == CALL_STATE_HOLD)) {
+ if ((getCallStateInt() == CALL_STATE_NONE) || (getCallStateInt() == CALL_STATE_CURRENT) || (getCallStateInt() == CALL_STATE_HOLD)) {
service.hangUp(mCallInfo.mCallID);
return true;
- }
- else if(getCallStateInt() == CALL_STATE_RINGING) {
- if(getCallType() == CALL_TYPE_INCOMING) {
+ } else if (getCallStateInt() == CALL_STATE_RINGING) {
+ if (getCallType() == CALL_TYPE_INCOMING) {
service.refuse(mCallInfo.mCallID);
return true;
- }
- else if(getCallType() == CALL_TYPE_OUTGOING) {
+ } else if (getCallType() == CALL_TYPE_OUTGOING) {
service.hangUp(mCallInfo.mCallID);
return true;
}
@@ -325,10 +309,9 @@
return false;
}
- public boolean notifyServiceRefuse(ISipService service)
- {
+ public boolean notifyServiceRefuse(ISipService service) {
try {
- if(getCallStateInt() == CALL_STATE_RINGING) {
+ if (getCallStateInt() == CALL_STATE_RINGING) {
service.refuse(mCallInfo.mCallID);
return true;
}
@@ -339,10 +322,9 @@
return false;
}
- public boolean notifyServiceHold(ISipService service)
- {
+ public boolean notifyServiceHold(ISipService service) {
try {
- if(getCallStateInt() == CALL_STATE_CURRENT) {
+ if (getCallStateInt() == CALL_STATE_CURRENT) {
service.hold(mCallInfo.mCallID);
return true;
}
@@ -353,10 +335,9 @@
return false;
}
- public boolean notifyServiceUnhold(ISipService service)
- {
+ public boolean notifyServiceUnhold(ISipService service) {
try {
- if(getCallStateInt() == CALL_STATE_HOLD) {
+ if (getCallStateInt() == CALL_STATE_HOLD) {
service.unhold(mCallInfo.mCallID);
return true;
}
@@ -367,18 +348,15 @@
return false;
}
- public void addToConference()
- {
+ public void addToConference() {
Log.i(TAG, "Add call to conference");
}
- public void sendTextMessage()
- {
+ public void sendTextMessage() {
Log.i(TAG, "Send text message");
}
- public void printCallInfo()
- {
+ public void printCallInfo() {
Log.i(TAG, "CallInfo: CallID: " + mCallInfo.mCallID);
Log.i(TAG, " AccountID: " + mCallInfo.mAccountID);
Log.i(TAG, " Display Name: " + mCallInfo.mDisplayName);
@@ -387,51 +365,49 @@
Log.i(TAG, " Contact: " + mCallInfo.mRemoteContact);
}
-
-
/**
* Compare sip calls based on call ID
*/
@Override
- public boolean equals(Object c){
- if(c instanceof SipCall && ((SipCall) c).mCallInfo.mCallID == mCallInfo.mCallID){
+ public boolean equals(Object c) {
+ if (c instanceof SipCall && ((SipCall) c).mCallInfo.mCallID == mCallInfo.mCallID) {
return true;
}
return false;
-
+
}
public void notifyServiceTransfer(ISipService service, String to) {
try {
- if(getCallStateInt() == CALL_STATE_CURRENT) {
+ if (getCallStateInt() == CALL_STATE_CURRENT) {
service.transfer(mCallInfo.mCallID, to);
}
} catch (RemoteException e) {
Log.e(TAG, "Cannot call service method", e);
- }
+ }
}
public void notifyServiceRecord(ISipService service) {
try {
- if(getCallStateInt() == CALL_STATE_CURRENT) {
+ if (getCallStateInt() == CALL_STATE_CURRENT) {
service.setRecordPath(Environment.getExternalStorageDirectory().getAbsolutePath());
- Log.w(TAG,"Recording path"+service.getRecordPath());
+ Log.w(TAG, "Recording path" + service.getRecordPath());
service.setRecordingCall(mCallInfo.mCallID);
}
} catch (RemoteException e) {
Log.e(TAG, "Cannot call service method", e);
- }
-
+ }
+
}
- public void notifyServiceSendMsg(ISipService service,String msg) {
+ public void notifyServiceSendMsg(ISipService service, String msg) {
try {
- if(getCallStateInt() == CALL_STATE_CURRENT) {
+ if (getCallStateInt() == CALL_STATE_CURRENT) {
service.sendTextMessage(mCallInfo.mCallID, msg, mCallInfo.mDisplayName);
}
} catch (RemoteException e) {
Log.e(TAG, "Cannot call service method", e);
- }
-
+ }
+
}
}
diff --git a/src/com/savoirfairelinux/sflphone/service/SipService.java b/src/com/savoirfairelinux/sflphone/service/SipService.java
index 094bb8c..dc4c854 100644
--- a/src/com/savoirfairelinux/sflphone/service/SipService.java
+++ b/src/com/savoirfairelinux/sflphone/service/SipService.java
@@ -4,6 +4,7 @@
*
* Author: Regis Montoya <r3gis.3R@gmail.com>
* Author: Emeric Vigier <emeric.vigier@savoirfairelinux.com>
+ * Alexandre Lision <alexandre.lision@savoirfairelinux.com>
*
* 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