Change incoming view icon:
when call asking for video and video should automatically accept
This commit is contained in:
parent
b4c251adda
commit
f42cdaa5ca
1 changed files with 19 additions and 9 deletions
|
@ -90,6 +90,12 @@ public class CallIncomingActivity extends LinphoneGenericActivity implements Lin
|
||||||
declineUnlock = (LinearLayout) findViewById(R.id.declineUnlock);
|
declineUnlock = (LinearLayout) findViewById(R.id.declineUnlock);
|
||||||
|
|
||||||
accept = (ImageView) findViewById(R.id.accept);
|
accept = (ImageView) findViewById(R.id.accept);
|
||||||
|
lookupCurrentCall();
|
||||||
|
if (LinphonePreferences.instance() != null && mCall != null && mCall.getRemoteParams() != null &&
|
||||||
|
LinphonePreferences.instance().shouldAutomaticallyAcceptVideoRequests() &&
|
||||||
|
mCall.getRemoteParams().getVideoEnabled()) {
|
||||||
|
accept.setImageResource(R.drawable.call_video_start);
|
||||||
|
}
|
||||||
decline = (ImageView) findViewById(R.id.decline);
|
decline = (ImageView) findViewById(R.id.decline);
|
||||||
arrow = (ImageView) findViewById(R.id.arrow_hangup);
|
arrow = (ImageView) findViewById(R.id.arrow_hangup);
|
||||||
accept.setOnClickListener(new View.OnClickListener() {
|
accept.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@ -206,15 +212,7 @@ public class CallIncomingActivity extends LinphoneGenericActivity implements Lin
|
||||||
mCall = null;
|
mCall = null;
|
||||||
|
|
||||||
// Only one call ringing at a time is allowed
|
// Only one call ringing at a time is allowed
|
||||||
if (LinphoneManager.getLcIfManagerNotDestroyedOrNull() != null) {
|
lookupCurrentCall();
|
||||||
List<LinphoneCall> calls = LinphoneUtils.getLinphoneCalls(LinphoneManager.getLc());
|
|
||||||
for (LinphoneCall call : calls) {
|
|
||||||
if (State.IncomingReceived == call.getState()) {
|
|
||||||
mCall = call;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (mCall == null) {
|
if (mCall == null) {
|
||||||
//The incoming call no longer exists.
|
//The incoming call no longer exists.
|
||||||
Log.d("Couldn't find incoming call");
|
Log.d("Couldn't find incoming call");
|
||||||
|
@ -264,6 +262,18 @@ public class CallIncomingActivity extends LinphoneGenericActivity implements Lin
|
||||||
return super.onKeyDown(keyCode, event);
|
return super.onKeyDown(keyCode, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void lookupCurrentCall() {
|
||||||
|
if (LinphoneManager.getLcIfManagerNotDestroyedOrNull() != null) {
|
||||||
|
List<LinphoneCall> calls = LinphoneUtils.getLinphoneCalls(LinphoneManager.getLc());
|
||||||
|
for (LinphoneCall call : calls) {
|
||||||
|
if (State.IncomingReceived == call.getState()) {
|
||||||
|
mCall = call;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void decline() {
|
private void decline() {
|
||||||
if (alreadyAcceptedOrDeniedCall) {
|
if (alreadyAcceptedOrDeniedCall) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue