diff --git a/res/layout-land/dialer.xml b/res/layout-land/dialer.xml
index 2ec2197f3..b18e0dd33 100644
--- a/res/layout-land/dialer.xml
+++ b/res/layout-land/dialer.xml
@@ -51,17 +51,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/res/values/custom.xml b/res/values/custom.xml
index 3489ab466..9802a3127 100644
--- a/res/values/custom.xml
+++ b/res/values/custom.xml
@@ -10,8 +10,11 @@
false
true
true
- true
+ false
+ true
true
+ false
+ true
true
Linphone
diff --git a/src/org/linphone/ConferenceActivity.java b/src/org/linphone/ConferenceActivity.java
index 8b5075c5e..f201b2d7b 100644
--- a/src/org/linphone/ConferenceActivity.java
+++ b/src/org/linphone/ConferenceActivity.java
@@ -298,8 +298,6 @@ public class ConferenceActivity extends ListActivity implements
lc().resumeCall(call);
break;
case R.id.unhook_call:
- LinphoneCall currentCall = lc().getCurrentCall();
- if (currentCall != null) lc().pauseCall(currentCall);
try {
lc().acceptCall(call);
} catch (LinphoneCoreException e) {
@@ -454,7 +452,7 @@ public class ConferenceActivity extends ListActivity implements
setVisibility(removeFromConfButton, false);
final int numberOfCalls = linphoneCalls.size();
- setVisibility(v, R.id.addVideo, !showUnhook && numberOfCalls == 1);
+ setVisibility(v, R.id.addVideo, !isInConference && !showUnhook && numberOfCalls == 1);
boolean statusPaused = state== State.Paused || state == State.PausedByRemote;
setVisibility(v, R.id.callee_status_paused, statusPaused);
diff --git a/src/org/linphone/DialerActivity.java b/src/org/linphone/DialerActivity.java
index 7a826da4c..50a6b6910 100644
--- a/src/org/linphone/DialerActivity.java
+++ b/src/org/linphone/DialerActivity.java
@@ -47,7 +47,6 @@ import android.os.Bundle;
import android.os.PowerManager;
import android.preference.PreferenceManager;
import android.view.View;
-import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.widget.TextView;
import android.widget.Toast;
@@ -87,6 +86,7 @@ public class DialerActivity extends LinphoneManagerWaitActivity implements Linph
private LinphoneCall mCurrentCall;
private boolean useIncallActivity;
private boolean useVideoActivity;
+ private boolean useConferenceActivity;
private static final String CURRENT_ADDRESS = "org.linphone.current-address";
private static final String CURRENT_DISPLAYNAME = "org.linphone.current-displayname";
@@ -107,6 +107,7 @@ public class DialerActivity extends LinphoneManagerWaitActivity implements Linph
setContentView(R.layout.dialer);
useIncallActivity = getResources().getBoolean(R.bool.use_incall_activity);
+ useConferenceActivity = getResources().getBoolean(R.bool.use_conference_activity);
useVideoActivity = getResources().getBoolean(R.bool.use_video_activity);
// Don't use Linphone Manager in the onCreate as it takes time in LinphoneService to initialize it.
@@ -231,8 +232,9 @@ public class DialerActivity extends LinphoneManagerWaitActivity implements Linph
if (!mWakeLock.isHeld()) mWakeLock.acquire();
if (useIncallActivity) {
-// LinphoneActivity.instance().startIncallActivity(
-// mDisplayNameView.getText(), mAddress.getPictureUri());
+ LinphoneActivity.instance().startIncallActivity(
+ mDisplayNameView.getText(), mAddress.getPictureUri());
+ } else if (useConferenceActivity) {
LinphoneActivity.instance().startConferenceActivity();
} else {
loadMicAndSpeakerUiStateFromManager();
@@ -249,7 +251,8 @@ public class DialerActivity extends LinphoneManagerWaitActivity implements Linph
private void updateIncallVideoCallButton() {
- if (useIncallActivity) throw new RuntimeException("Internal error");
+ if (useIncallActivity || useConferenceActivity)
+ throw new RuntimeException("Internal error");
boolean prefVideoEnabled = LinphoneManager.getInstance().isVideoEnabled();
AddVideoButton mAddVideo = (AddVideoButton) findViewById(R.id.AddVideo);
@@ -264,7 +267,8 @@ public class DialerActivity extends LinphoneManagerWaitActivity implements Linph
private void loadMicAndSpeakerUiStateFromManager() {
- if (useIncallActivity) throw new RuntimeException("Internal error"); // only dialer widgets are updated with this
+ if (useIncallActivity || useConferenceActivity)
+ throw new RuntimeException("Internal error"); // only dialer widgets are updated with this
mMute.setChecked(LinphoneManager.getLc().isMicMuted());
mSpeaker.setSpeakerOn(LinphoneManager.getInstance().isSpeakerOn());
@@ -272,15 +276,21 @@ public class DialerActivity extends LinphoneManagerWaitActivity implements Linph
private void exitCallMode() {
- // Remove dialog if existing
- try {
-// dismissDialog(incomingCallDialogId);
+ if (getResources().getBoolean(R.bool.use_incoming_call_activity)) {
finishActivity(INCOMING_CALL_ACTIVITY);
- } catch (Throwable e) {/* Exception if never created */}
+ } else if (getResources().getBoolean(R.bool.use_incoming_call_dialog)) {
+ // Remove dialog if existing
+ try {
+ dismissDialog(incomingCallDialogId);
+ } catch (Throwable e) {/* Exception if never created */}
+ }
+
if (useIncallActivity) {
LinphoneActivity.instance().closeIncallActivity();
- } else {
+ } else if(useConferenceActivity) {
+ LinphoneActivity.instance().closeConferenceActivity();
+ }else {
mCallControlRow.setVisibility(View.VISIBLE);
mInCallControlRow.setVisibility(View.GONE);
mInCallAddressLayout.setVisibility(View.GONE);
@@ -308,15 +318,12 @@ public class DialerActivity extends LinphoneManagerWaitActivity implements Linph
private void callPending(final LinphoneCall call) {
-// showDialog(incomingCallDialogId);
- LinphoneAddress address = LinphoneManager.getLc().getRemoteAddress();
- String from = LinphoneManager.extractADisplayName(getResources(), address);
- Intent intent = new Intent()
- .setClass(this, IncomingCallActivity.class)
- .putExtra("name", from)
- .putExtra("number", address.asStringUriOnly());
-
- startActivityForResult(intent, INCOMING_CALL_ACTIVITY);
+ if (getResources().getBoolean(R.bool.use_incoming_call_activity)) {
+ Intent intent = new Intent().setClass(this, IncomingCallActivity.class);
+ startActivityForResult(intent, INCOMING_CALL_ACTIVITY);
+ } else if (getResources().getBoolean(R.bool.use_incoming_call_dialog)) {
+ showDialog(incomingCallDialogId);
+ }
}
@Override
@@ -470,7 +477,7 @@ public class DialerActivity extends LinphoneManagerWaitActivity implements Linph
public void onGlobalStateChangedToOn(String message) {
mCall.setEnabled(!LinphoneManager.getLc().isIncall());
- if (!useIncallActivity) updateIncallVideoCallButton();
+ if (!useIncallActivity && !useConferenceActivity) updateIncallVideoCallButton();
else mHangup.setEnabled(!mCall.isEnabled());
if (getIntent().getData() != null) {
@@ -503,55 +510,4 @@ public class DialerActivity extends LinphoneManagerWaitActivity implements Linph
super.onResume();
}
-
- private void switchControlRow(ViewGroup v, OnClickListener l) {
- final View ok = v.getChildAt(0);
- final View cancel = v.getChildAt(1);
- ok.setOnClickListener(l);
- cancel.setOnClickListener(l);
- findViewById(R.id.IncallControlRow).setVisibility(View.GONE);
- findViewById(R.id.CallControlRow).setVisibility(View.GONE);
- v.setVisibility(View.VISIBLE);
- }
- public void configureForAddingCall() {
- ViewGroup v = (ViewGroup) findViewById(R.id.AddCallControlRow);
- OnClickListener l = new OnClickListener() {
- public void onClick(View v) {
- ViewGroup group = (ViewGroup) v.getParent();
- if (v == group.getChildAt(1)) {
- LinphoneActivity.instance().startConferenceActivity();
- } else {
- LinphoneManager.getInstance().newOutgoingCall(mAddress);
- }
- }
- };
- switchControlRow(v, l);
- }
-
-
- public void configureForTransferingCall(final long callNativeId) {
- throw new RuntimeException("create another activity for this");
-// ViewGroup v = (ViewGroup) findViewById(R.id.transferCallControlRow);
-// OnClickListener l = new OnClickListener() {
-// public void onClick(View v) {
-// ViewGroup group = (ViewGroup) v.getParent();
-// if (v == group.getChildAt(1)) {
-// LinphoneActivity.instance().startConferenceActivity();
-// } else {
-// LinphoneManager.getLc().transferCall(Hacks.createCall(callNativeId),
-// mAddress.getText().toString());
-// }
-// }
-// };
-// switchControlRow(v, l);
- }
-
-
- public void configureForDialer() {
- findViewById(R.id.AddCallControlRow).setVisibility(R.id.transferCallControlRow);
- findViewById(R.id.AddCallControlRow).setVisibility(View.GONE);
- findViewById(R.id.IncallControlRow).setVisibility(View.GONE);
- findViewById(R.id.CallControlRow).setVisibility(View.VISIBLE);
- }
-
}
diff --git a/src/org/linphone/IncallActivity.java b/src/org/linphone/IncallActivity.java
index e108d5c1f..734a7aa70 100644
--- a/src/org/linphone/IncallActivity.java
+++ b/src/org/linphone/IncallActivity.java
@@ -32,6 +32,10 @@ import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;
+/**
+ * @author Guillaume Beraudo
+ *
+ */
public class IncallActivity extends SoftVolumeActivity implements OnClickListener {
public static final String CONTACT_KEY = "contact";
diff --git a/src/org/linphone/LinphoneActivity.java b/src/org/linphone/LinphoneActivity.java
index 80af1ed5e..3f30cfda6 100644
--- a/src/org/linphone/LinphoneActivity.java
+++ b/src/org/linphone/LinphoneActivity.java
@@ -174,17 +174,6 @@ public class LinphoneActivity extends TabActivity implements SensorEventListener
}
break;
case conference_activity:
- if (data == null) {
- DialerActivity.instance().configureForDialer();
- } else if (data.getBooleanExtra(ConferenceActivity.ADD_CALL, false)) {
- DialerActivity.instance().configureForAddingCall();
- gotToDialer();
- } else if (data.getBooleanExtra(ConferenceActivity.TRANSFER_TO_NEW_CALL, false)) {
- long callId = data.getLongExtra(ConferenceActivity.CALL_NATIVE_ID, 0l);
- if (callId == 0) throw new RuntimeException("call id is 0");
- DialerActivity.instance().configureForTransferingCall(callId);
- gotToDialer();
- }
break;
default:
break;
@@ -236,7 +225,9 @@ public class LinphoneActivity extends TabActivity implements SensorEventListener
} else {
if (getResources().getBoolean(R.bool.use_incall_activity)) {
LinphoneAddress address = LinphoneManager.getLc().getRemoteAddress();
- startIncallActivity(LinphoneManager.getInstance().extractADisplayName(getResources(), address), null);
+ startIncallActivity(LinphoneManager.extractADisplayName(getResources(), address), null);
+ } if (getResources().getBoolean(R.bool.use_conference_activity)) {
+ startConferenceActivity();
} else {
// TODO
Log.e("Not handled case: recreation while in call and not using incall activity");
@@ -497,18 +488,19 @@ public class LinphoneActivity extends TabActivity implements SensorEventListener
}
public void startIncallActivity(CharSequence callerName, Uri pictureUri) {
-/* Intent intent = new Intent().setClass(this, IncallActivity.class)
+ Intent intent = new Intent().setClass(this, IncallActivity.class)
.putExtra(IncallActivity.CONTACT_KEY, callerName);
if (pictureUri != null)
intent.putExtra(IncallActivity.PICTURE_URI_KEY, pictureUri.toString());
- startActivityForResult(intent, INCALL_ACTIVITY);*/
- // Hacked
- startConferenceActivity();
+ startActivityForResult(intent, INCALL_ACTIVITY);
}
public void closeIncallActivity() {
finishActivity(INCALL_ACTIVITY);
}
+ public void closeConferenceActivity() {
+ finishActivity(conference_activity);
+ }
public void startVideoActivity() {
mHandler.post(new Runnable() {