Fixed call transfer
This commit is contained in:
parent
fe2d8b16c2
commit
777359e29f
6 changed files with 33 additions and 8 deletions
|
@ -633,6 +633,18 @@ public abstract class MainActivity extends LinphoneGenericActivity
|
|||
}
|
||||
}
|
||||
|
||||
public void newOutgoingCall(String to) {
|
||||
if (LinphoneManager.getCore().getCallsNb() > 0) {
|
||||
Intent intent = new Intent(this, DialerActivity.class);
|
||||
intent.addFlags(
|
||||
Intent.FLAG_ACTIVITY_NO_ANIMATION | Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
|
||||
intent.putExtra("SipUri", to);
|
||||
this.startActivity(intent);
|
||||
} else {
|
||||
LinphoneManager.getCallManager().newOutgoingCall(to, null);
|
||||
}
|
||||
}
|
||||
|
||||
private void addFlagsToIntent(Intent intent) {
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION | Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
|
||||
}
|
||||
|
|
|
@ -929,7 +929,7 @@ public class CallActivity extends LinphoneGenericActivity
|
|||
private void goBackToDialer() {
|
||||
Intent intent = new Intent();
|
||||
intent.setClass(this, DialerActivity.class);
|
||||
intent.putExtra("Transfer", false);
|
||||
intent.putExtra("isTransfer", false);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION | Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
@ -937,7 +937,7 @@ public class CallActivity extends LinphoneGenericActivity
|
|||
private void goBackToDialerAndDisplayTransferButton() {
|
||||
Intent intent = new Intent();
|
||||
intent.setClass(this, DialerActivity.class);
|
||||
intent.putExtra("Transfer", true);
|
||||
intent.putExtra("isTransfer", true);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION | Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ import android.widget.TableLayout;
|
|||
import android.widget.TextView;
|
||||
import org.linphone.LinphoneManager;
|
||||
import org.linphone.R;
|
||||
import org.linphone.activities.MainActivity;
|
||||
import org.linphone.contacts.views.ContactAvatar;
|
||||
import org.linphone.core.Address;
|
||||
import org.linphone.core.ChatRoom;
|
||||
|
@ -304,7 +305,7 @@ public class ContactDetailsFragment extends Fragment implements ContactsUpdatedL
|
|||
@Override
|
||||
public void onClick(View v) {
|
||||
String tag = (String) v.getTag();
|
||||
LinphoneManager.getCallManager().newOutgoingCall(tag, null);
|
||||
((MainActivity) getActivity()).newOutgoingCall(tag);
|
||||
}
|
||||
});
|
||||
if (contactAddress != null) {
|
||||
|
|
|
@ -116,13 +116,26 @@ public class DialerActivity extends MainActivity implements AddressText.AddressC
|
|||
Manifest.permission.READ_CONTACTS
|
||||
};
|
||||
|
||||
mIsTransfer = false;
|
||||
if (getIntent() != null) {
|
||||
mIsTransfer = getIntent().getBooleanExtra("isTransfer", false);
|
||||
}
|
||||
|
||||
handleIntentParams(getIntent());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onNewIntent(Intent intent) {
|
||||
super.onNewIntent(intent);
|
||||
|
||||
handleIntentParams(intent);
|
||||
|
||||
if (intent != null) {
|
||||
mIsTransfer = intent.getBooleanExtra("isTransfer", mIsTransfer);
|
||||
if (mAddress != null && intent.getStringExtra("SipUri") != null) {
|
||||
mAddress.setText(intent.getStringExtra("SipUri"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -207,9 +220,7 @@ public class DialerActivity extends MainActivity implements AddressText.AddressC
|
|||
}
|
||||
});
|
||||
|
||||
mIsTransfer = false;
|
||||
if (getIntent() != null) {
|
||||
mIsTransfer = getIntent().getBooleanExtra("Transfer", false);
|
||||
mAddress.setText(getIntent().getStringExtra("SipUri"));
|
||||
}
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ import java.util.Arrays;
|
|||
import java.util.List;
|
||||
import org.linphone.LinphoneManager;
|
||||
import org.linphone.R;
|
||||
import org.linphone.activities.MainActivity;
|
||||
import org.linphone.contacts.ContactsManager;
|
||||
import org.linphone.contacts.LinphoneContact;
|
||||
import org.linphone.contacts.views.ContactAvatar;
|
||||
|
@ -80,7 +81,7 @@ public class HistoryDetailFragment extends Fragment {
|
|||
new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
LinphoneManager.getCallManager().newOutgoingCall(mSipUri, mDisplayName);
|
||||
((MainActivity) getActivity()).newOutgoingCall(mSipUri);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ import java.util.List;
|
|||
import org.linphone.LinphoneContext;
|
||||
import org.linphone.LinphoneManager;
|
||||
import org.linphone.R;
|
||||
import org.linphone.activities.MainActivity;
|
||||
import org.linphone.call.views.LinphoneLinearLayoutManager;
|
||||
import org.linphone.contacts.ContactsManager;
|
||||
import org.linphone.contacts.ContactsUpdatedListener;
|
||||
|
@ -206,8 +207,7 @@ public class HistoryFragment extends Fragment
|
|||
address = log.getToAddress();
|
||||
}
|
||||
if (address != null) {
|
||||
LinphoneManager.getCallManager()
|
||||
.newOutgoingCall(address.asStringUriOnly(), null);
|
||||
((MainActivity) getActivity()).newOutgoingCall(address.asStringUriOnly());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue