+
+void
+IncomingCallForm::OnScreenOff(void)
+{
+ __pCallPresentor->StopAlert();
+}
+
+void
+IncomingCallForm::CallDisconnected(void)
+{
+ //check if no call option popup is shown, then remain on incoming call screen.
+ //As user has neither accepted nor rejected incoming call.
+ if (__pOptionPopup == null)
+ {
+ return;
+ }
+
+ //fetch already active call list and show updated option popup
+ ArrayListT<AppCallInfo>* pCallList = static_cast<ArrayListT<AppCallInfo>*>(__pCallPresentor->GetCallListN());
+ if (pCallList != null && pCallList->GetCount() > 0)
+ {
+ //then atleast 1 active call exist.
+ AppCallInfo phnCallInfo;
+ pCallList->GetAt(0,phnCallInfo);
+ //Check if only 1 call exist and it is on Hold
+ if(pCallList->GetCount() == 1 && phnCallInfo.IsOnHold())
+ {
+ //directly accept call
+ __pCallPresentor->AcceptIncomingCall(ANSERWING_OPTION_ACCEPT_CALL,__incomingCallHandle);
+ }
+ else
+ {
+ //Either 1 call exist and not "on Hold".
+ //Or 2 calls exist.
+ if(__pOptionPopup != null)
+ {
+ delete __pOptionPopup;
+ __pOptionPopup = null;
+ }
+ __pOptionPopup = new (std::nothrow) CallOptionPopup(*this,*(__pCallPresentor));
+ __pOptionPopup->Initialize();
+ __pOptionPopup->SetShowState(true);
+ __pOptionPopup->Draw();
+ __pOptionPopup->Show();
+ }
+ pCallList->RemoveAll();
+ }
+ else
+ {
+ //no active call - Accept the incoming call
+ __pCallPresentor->AcceptIncomingCall(ANSERWING_OPTION_ACCEPT_CALL,__incomingCallHandle);
+ }
+ delete pCallList;
+ pCallList = null;
+}