Fix for 37448
authorAmith Kumar Mahale <amith.m@samsung.com>
Tue, 7 May 2013 12:08:05 +0000 (17:38 +0530)
committerAmith Kumar Mahale <amith.m@samsung.com>
Tue, 7 May 2013 12:08:05 +0000 (17:38 +0530)
Change-Id: I6366d8e23e68e85013378c2e7835e8d48b00b421
Signed-off-by: Amith Kumar Mahale <amith.m@samsung.com>
inc/CallPresentationModel.h
inc/CallTypes.h
res/eng-GB.xml
src/CallApp.cpp
src/CallErrorMsgPopup.cpp
src/CallIncomingCallForm.cpp
src/CallPresentationModel.cpp
src/CallTypes.cpp

index abcbef8..6631416 100644 (file)
@@ -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
index cbb4d4c..d64ab4a 100644 (file)
@@ -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
index 1bd4308..821e4ad 100644 (file)
     <text id="IDS_DATETIME_JAN">Jan</text>
     <text id="IDS_SELECTED_ITEM_STRING">%d call log selected</text>
     <text id="IDS_NUMBER_UNKNOWN">Unknown</text>
+       <text id="IDS_GPRS_NUMBER">GPRS is not supported</text>
 </string_table>
index 81832ed..678d5ba 100644 (file)
@@ -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;
index 4434c9f..86880bf 100644 (file)
@@ -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:
        {
index 7b4a2c7..861214b 100644 (file)
@@ -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();
index e2156c2..468f732 100644 (file)
@@ -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");
index 3075991..2bd9fcf 100644 (file)
@@ -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";