From: Amith Kumar Mahale Date: Tue, 7 May 2013 12:08:05 +0000 (+0530) Subject: Fix for 37448 X-Git-Tag: submit/tizen_2.1/20130514.050952~3 X-Git-Url: http://review.tizen.org/git/?p=apps%2Fosp%2FCall.git;a=commitdiff_plain;h=4f9ce1622ba528aca7834f198a0830bdd1f8cd93 Fix for 37448 Change-Id: I6366d8e23e68e85013378c2e7835e8d48b00b421 Signed-off-by: Amith Kumar Mahale --- diff --git a/inc/CallPresentationModel.h b/inc/CallPresentationModel.h index abcbef8..6631416 100644 --- a/inc/CallPresentationModel.h +++ b/inc/CallPresentationModel.h @@ -62,6 +62,7 @@ private: result GetSimInfo(void); //Used to check if sim is available bool IsSimAvailable(void); + bool IfNumberEndsWithHash(Tizen::Base::String& contactNumber); public: //set the telephony event listener diff --git a/inc/CallTypes.h b/inc/CallTypes.h index cbb4d4c..d64ab4a 100644 --- a/inc/CallTypes.h +++ b/inc/CallTypes.h @@ -180,6 +180,7 @@ extern const wchar_t* IDS_REJECT_MESSAGE_CREATE; extern const wchar_t* IDS_VIEW_CONTACT; extern const wchar_t* IDS_INVALID_NUMBER; extern const wchar_t* IDS_NUMBER_UNKNOWN; +extern const wchar_t* IDS_GPRS_NUMBER; //Panel extern const wchar_t* PANEL_DIALER; extern const wchar_t* PANEL_LOGS; @@ -440,6 +441,7 @@ enum ErrorCodes ERROR_BARRING_PWD_TOO_LONG, ERROR_FLIGHT_MODE_SET, ERROR_GENERAL, + ERROR_GPRS_NUMBER, }; enum DialerRequestType diff --git a/res/eng-GB.xml b/res/eng-GB.xml index 1bd4308..821e4ad 100644 --- a/res/eng-GB.xml +++ b/res/eng-GB.xml @@ -175,4 +175,5 @@ Jan %d call log selected Unknown + GPRS is not supported diff --git a/src/CallApp.cpp b/src/CallApp.cpp index 81832ed..678d5ba 100644 --- a/src/CallApp.cpp +++ b/src/CallApp.cpp @@ -516,16 +516,12 @@ CallApp::CheckNumberIsValid(String phoneNumber) { //Pattern to compare all characters except 0-9 * # P ; , + String phoneNumberPattern(L"[^0-9*#P,p+;]"); - String phoneNumberEndingWithHash(L"#$"); - RegularExpression checkPhoneNumber,checkHash; + RegularExpression checkPhoneNumber; checkPhoneNumber.Construct(phoneNumberPattern); - checkHash.Construct(phoneNumberEndingWithHash); //If there is any character other than these listed above then display invalid number bool resultMatch = checkPhoneNumber.Match(phoneNumber,false); //return false for patterns other than 0-9 * # P ; , + - bool endsWithHash = checkHash.Match(phoneNumber,false); - //returns false for any numbers that end with Hash - if(resultMatch == true || endsWithHash == true) + if(resultMatch == true) { //return phone number is invalid return false; diff --git a/src/CallErrorMsgPopup.cpp b/src/CallErrorMsgPopup.cpp index 4434c9f..86880bf 100644 --- a/src/CallErrorMsgPopup.cpp +++ b/src/CallErrorMsgPopup.cpp @@ -228,6 +228,12 @@ ErrorMsgPopup::FetchErrorMessage(int errorCode) } break; + case ERROR_GPRS_NUMBER: + { + msg.Append(AppUtility::GetResourceString(IDS_GPRS_NUMBER)); + } + break; + case ERROR_GENERAL: default: { diff --git a/src/CallIncomingCallForm.cpp b/src/CallIncomingCallForm.cpp index 7b4a2c7..861214b 100644 --- a/src/CallIncomingCallForm.cpp +++ b/src/CallIncomingCallForm.cpp @@ -1300,7 +1300,7 @@ IncomingCallForm::SetBitmapToRejectMessageButton(const String& btnName, const St void IncomingCallForm::OnTouchPressed(const Control& source, const Point& currentPosition, const TouchEventInfo& touchInfo) { - __pCallPresentor->StopAlert(); + //__pCallPresentor->StopAlert(); if (currentPosition.x < VALID_TOUCH_X_OFFSET && currentPosition.y < VALID_TOUCH_Y_OFFSET) { Rectangle rect = source.GetBounds(); diff --git a/src/CallPresentationModel.cpp b/src/CallPresentationModel.cpp index e2156c2..468f732 100644 --- a/src/CallPresentationModel.cpp +++ b/src/CallPresentationModel.cpp @@ -40,6 +40,7 @@ using namespace Tizen::Media; using namespace Tizen::Social; using namespace Tizen::Ui::Scenes; using namespace Tizen::Telephony; +using namespace Tizen::Base::Utility; CallPresentationModel* CallPresentationModel::__pInstance = null; @@ -133,11 +134,26 @@ CallPresentationModel::SetTelEventListener(ITelephonyEventListener* pTelEventLis __pTelEventListener = pTelEventListener; } +bool +CallPresentationModel::IfNumberEndsWithHash(Tizen::Base::String& phoneNumber) +{ + String phoneNumberEndingWithHash(L"#$"); + RegularExpression checkHash; + checkHash.Construct(phoneNumberEndingWithHash); + bool endsWithHash = checkHash.Match(phoneNumber,false); + if(endsWithHash == true) + { + return true; + } + return false; +} + void CallPresentationModel::DialCall(String& contactNumber, bool isEmergency) { int errorCode = ERROR_NONE; bool isCallServiceAvailable = false; + bool numberEndsWithHash = false; NetworkStatus networkStatus; result r; //Check if Telephony Manager is initialized @@ -172,6 +188,14 @@ CallPresentationModel::DialCall(String& contactNumber, bool isEmergency) __pTelEventListener->HandleTelephonyError(ERROR_DIAL_FAILED); return ; } + // check if GPRS number + numberEndsWithHash = IfNumberEndsWithHash(contactNumber); + if(numberEndsWithHash == true) + { + __pTelEventListener->HandleTelephonyError(ERROR_GPRS_NUMBER); + return ; + } + //setup outgoing call errorCode = __pTelephonyMgr->SetupMoCall(contactNumber, isEmergency); TryCatch(errorCode == ERROR_NONE,,"Error occurred while setup MO call"); diff --git a/src/CallTypes.cpp b/src/CallTypes.cpp index 3075991..2bd9fcf 100644 --- a/src/CallTypes.cpp +++ b/src/CallTypes.cpp @@ -177,6 +177,7 @@ const wchar_t* IDS_REJECT_MESSAGE_CREATE = L"IDS_REJECT_MESSAGE_CREATE"; const wchar_t* IDS_VIEW_CONTACT = L"IDS_VIEW_CONTACT"; const wchar_t* IDS_INVALID_NUMBER = L"IDS_INVALID_NUMBER"; const wchar_t* IDS_NUMBER_UNKNOWN = L"IDS_NUMBER_UNKNOWN"; +const wchar_t* IDS_GPRS_NUMBER = L"IDS_GPRS_NUMBER"; //Panel const wchar_t* PANEL_DIALER = L"PanelDialer"; const wchar_t* PANEL_LOGS = L"PanelLogs";