* #25270 Overall improvements of transitions between calls and call actions
* #25117 Refactor and stability
diff --git a/src/com/savoirfairelinux/sflphone/service/CallManagerCallBack.java b/src/com/savoirfairelinux/sflphone/service/CallManagerCallBack.java
index f8a352f..965d2b8 100644
--- a/src/com/savoirfairelinux/sflphone/service/CallManagerCallBack.java
+++ b/src/com/savoirfairelinux/sflphone/service/CallManagerCallBack.java
@@ -18,6 +18,7 @@
static public final String CONF_CREATED = "conf_created";
static public final String CONF_REMOVED = "conf_removed";
static public final String CONF_CHANGED = "conf_changed";
+ static public final String RECORD_STATE_CHANGED = "record_state";
public CallManagerCallBack(Context context) {
@@ -33,13 +34,24 @@
@Override
public void on_call_state_changed(String callID, String state) {
Log.d(TAG, "on_call_state_changed(" + callID + ", " + state + ")");
- sendCallStateChangedMessage(callID, state);
+ Bundle bundle = new Bundle();
+ bundle.putString("CallID", callID);
+ bundle.putString("State", state);
+ Intent intent = new Intent(CALL_STATE_CHANGED);
+ intent.putExtra("com.savoirfairelinux.sflphone.service.newstate", bundle);
+ LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent);
}
@Override
public void on_incoming_call(String accountID, String callID, String from) {
Log.d(TAG, "on_incoming_call(" + accountID + ", " + callID + ", " + from + ")");
- sendIncomingCallMessage(accountID, callID, from);
+ Bundle bundle = new Bundle();
+ bundle.putString("AccountID", accountID);
+ bundle.putString("CallID", callID);
+ bundle.putString("From", from);
+ Intent intent = new Intent(INCOMING_CALL);
+ intent.putExtra("com.savoirfairelinux.sflphone.service.newcall", bundle);
+ LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent);
}
@Override
@@ -58,12 +70,18 @@
@Override
public void on_incoming_message(String ID, String from, String msg){
Log.w(TAG,"on_incoming_message:"+msg);
- sendIncomingTextMessage(ID, from, msg);
+ Bundle bundle = new Bundle();
+
+ bundle.putString("CallID", ID);
+ bundle.putString("From", from);
+ bundle.putString("Msg", msg);
+ Intent intent = new Intent(INCOMING_TEXT);
+ intent.putExtra("com.savoirfairelinux.sflphone.service.newtext", bundle);
+ LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent);
}
@Override
public void on_conference_removed(String confID){
- Log.w(TAG,"CONFERENCE REMOVED:"+confID);
Intent intent = new Intent(CONF_REMOVED);
intent.putExtra("confID", confID);
LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent);
@@ -71,41 +89,18 @@
@Override
public void on_conference_state_changed(String confID, String state){
- Log.w(TAG,"CONFERENCE STATE CHANGED:"+confID);
Intent intent = new Intent(CONF_CHANGED);
intent.putExtra("confID", confID);
intent.putExtra("State", state);
LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent);
}
-
- private void sendCallStateChangedMessage(String callID, String state) {
- Bundle bundle = new Bundle();
- bundle.putString("CallID", callID);
- bundle.putString("State", state);
- Intent intent = new Intent(CALL_STATE_CHANGED);
- intent.putExtra("com.savoirfairelinux.sflphone.service.newstate", bundle);
- LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent);
- }
-
- private void sendIncomingCallMessage(String accountID, String callID, String from) {
- Bundle bundle = new Bundle();
- bundle.putString("AccountID", accountID);
- bundle.putString("CallID", callID);
- bundle.putString("From", from);
- Intent intent = new Intent(INCOMING_CALL);
- intent.putExtra("com.savoirfairelinux.sflphone.service.newcall", bundle);
- LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent);
- }
- private void sendIncomingTextMessage(String id, String from, String msg) {
- Bundle bundle = new Bundle();
-
- bundle.putString("CallID", id);
- bundle.putString("From", from);
- bundle.putString("Msg", msg);
- Intent intent = new Intent(INCOMING_TEXT);
- intent.putExtra("com.savoirfairelinux.sflphone.service.newtext", bundle);
+ @Override
+ public void on_record_playback_filepath(String id, String filename){
+ Intent intent = new Intent(RECORD_STATE_CHANGED);
+ intent.putExtra("id", id);
+ intent.putExtra("file", filename);
LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent);
-
}
+
}