Start incoming call fragment when call received.
diff --git a/src/com/savoirfairelinux/sflphone/client/CallActivity.java b/src/com/savoirfairelinux/sflphone/client/CallActivity.java
index c9392b9..980e94d 100644
--- a/src/com/savoirfairelinux/sflphone/client/CallActivity.java
+++ b/src/com/savoirfairelinux/sflphone/client/CallActivity.java
@@ -95,12 +95,6 @@
Intent intent = new Intent(this, SipService.class);
bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
- /*
- findViewById(R.id.buttonanswer).setOnClickListener(this);
- findViewById(R.id.buttonhangup).setOnClickListener(this);
- findViewById(R.id.buttonhold).setOnClickListener(this);
- findViewById(R.id.buttonunhold).setOnClickListener(this);
- */
setCallStateDisplay(mCall.getCallStateString());
LocalBroadcastManager.getInstance(this).registerReceiver(mMessageReceiver, new IntentFilter(CallManagerCallBack.NEW_CALL_CREATED));
@@ -130,31 +124,7 @@
{
}
};
-
- /*
- @Override
- public void onClick(View view)
- {
- Log.i(TAG, "On click action");
- switch (view.getId()) {
- case R.id.buttonanswer:
- mCall.notifyServiceAnswer(service);
- break;
- case R.id.buttonhangup:
- if (mCall.notifyServiceHangup(service))
- finish();
- break;
- case R.id.buttonhold:
- mCall.notifyServiceHold(service);
- break;
- case R.id.buttonunhold:
- mCall.notifyServiceUnhold(service);
- break;
- default:
- Log.e(TAG, "Invalid button clicked");
- }
- }
- */
+
private void processCallStateChangedSignal(Intent intent)
{
Bundle bundle = intent.getBundleExtra("com.savoirfairelinux.sflphone.service.newstate");
diff --git a/src/com/savoirfairelinux/sflphone/client/IncomingCallFragment.java b/src/com/savoirfairelinux/sflphone/client/IncomingCallFragment.java
index 7f586d8..302ece5 100644
--- a/src/com/savoirfairelinux/sflphone/client/IncomingCallFragment.java
+++ b/src/com/savoirfairelinux/sflphone/client/IncomingCallFragment.java
@@ -24,7 +24,7 @@
public void setCall(SipCall call)
{
- mCall = call; // = new WeakReference<SipCall>(mCall);
+ mCall = call;
if(isAdded())
updateUI();
}
diff --git a/src/com/savoirfairelinux/sflphone/client/OngoingCallFragment.java b/src/com/savoirfairelinux/sflphone/client/OngoingCallFragment.java
index 6bbc3ad..2c34d2c 100644
--- a/src/com/savoirfairelinux/sflphone/client/OngoingCallFragment.java
+++ b/src/com/savoirfairelinux/sflphone/client/OngoingCallFragment.java
@@ -54,6 +54,23 @@
return;
contact_name_txt.setText(mCall.getDisplayName());
callstatus_txt.setText(mCall.getCallStateString());
+
+ int state = mCall.getCallStateInt();
+ if(state == SipCall.CALL_STATE_HOLD) {
+ suspend_btn.setText("Resume");
+ } else {
+ suspend_btn.setText("Suspend");
+ }
+ /*
+ switch(mCall.getCallStateInt()) {
+ case SipCall.CALL_STATE_HOLD:
+ suspend_btn.setText("Resume");
+ break;
+ case SipCall.CALL_STATE_HOLD:
+ suspend_btn.setText("Resume");
+ break;
+
+ }*/
}
@Override
@@ -69,7 +86,10 @@
if (v == end_btn) {
listener.onCallEnded();
} else if (v == suspend_btn) {
- listener.onCallSuspended();
+ if(mCall.getCallStateInt() == SipCall.CALL_STATE_HOLD)
+ listener.onCallResumed();
+ else
+ listener.onCallSuspended();
}
}
}
\ No newline at end of file
diff --git a/src/com/savoirfairelinux/sflphone/client/SFLPhoneHomeActivity.java b/src/com/savoirfairelinux/sflphone/client/SFLPhoneHomeActivity.java
index 39af89f..4afc441 100644
--- a/src/com/savoirfairelinux/sflphone/client/SFLPhoneHomeActivity.java
+++ b/src/com/savoirfairelinux/sflphone/client/SFLPhoneHomeActivity.java
@@ -261,6 +261,8 @@
SipCall c = new SipCall(infos);
mCallElementList.addCall(c);
+
+ launchCallActivity(infos);
}
@Override
diff --git a/src/com/savoirfairelinux/sflphone/fragments/CallElementListFragment.java b/src/com/savoirfairelinux/sflphone/fragments/CallElementListFragment.java
index 05c4660..de02875 100644
--- a/src/com/savoirfairelinux/sflphone/fragments/CallElementListFragment.java
+++ b/src/com/savoirfairelinux/sflphone/fragments/CallElementListFragment.java
@@ -152,7 +152,7 @@
/**
* Runnable that fill information in a contact card asynchroniously.
*/
- public static class InfosLoader implements Runnable {
+ /* public static class InfosLoader implements Runnable {
private View view;
private long cid;
private ContentResolver cr;
@@ -192,21 +192,10 @@
view.post(new Runnable() {
@Override
public void run() {
- /*
- * ImageView photo_view = (ImageView) view.findViewById(R.id.photo); TextView phones_txt = (TextView)
- * view.findViewById(R.id.phones);
- *
- * if (photo_bmp != null) { photo_view.setImageBitmap(bmp); photo_view.setVisibility(View.VISIBLE); } else {
- * photo_view.setVisibility(View.GONE); }
- *
- * if (numbers.size() > 0) { String phonestxt = numbers.get(0); for (int i = 1, n = numbers.size(); i < n; i++) phonestxt += "\n"
- * + numbers.get(i); phones_txt.setText(phonestxt); phones_txt.setVisibility(View.VISIBLE); } else
- * phones_txt.setVisibility(View.GONE);
- */
}
});
}
- }
+ }*/
public CallElementListFragment() {
super();