Change-Id: I6366d8e23e68e85013378c2e7835e8d48b00b421
Signed-off-by: Amith Kumar Mahale <amith.m@samsung.com>
result GetSimInfo(void);
//Used to check if sim is available
bool IsSimAvailable(void);
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
public:
//set the telephony event listener
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_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;
//Panel
extern const wchar_t* PANEL_DIALER;
extern const wchar_t* PANEL_LOGS;
ERROR_BARRING_PWD_TOO_LONG,
ERROR_FLIGHT_MODE_SET,
ERROR_GENERAL,
ERROR_BARRING_PWD_TOO_LONG,
ERROR_FLIGHT_MODE_SET,
ERROR_GENERAL,
};
enum DialerRequestType
};
enum DialerRequestType
<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_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>
{
//Pattern to compare all characters except 0-9 * # P ; , +
String phoneNumberPattern(L"[^0-9*#P,p+;]");
{
//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);
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 ; , +
//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;
{
//return phone number is invalid
return false;
+ case ERROR_GPRS_NUMBER:
+ {
+ msg.Append(AppUtility::GetResourceString(IDS_GPRS_NUMBER));
+ }
+ break;
+
case ERROR_GENERAL:
default:
{
case ERROR_GENERAL:
default:
{
void
IncomingCallForm::OnTouchPressed(const Control& source, const Point& currentPosition, const TouchEventInfo& touchInfo)
{
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();
if (currentPosition.x < VALID_TOUCH_X_OFFSET && currentPosition.y < VALID_TOUCH_Y_OFFSET)
{
Rectangle rect = source.GetBounds();
using namespace Tizen::Social;
using namespace Tizen::Ui::Scenes;
using namespace Tizen::Telephony;
using namespace Tizen::Social;
using namespace Tizen::Ui::Scenes;
using namespace Tizen::Telephony;
+using namespace Tizen::Base::Utility;
CallPresentationModel* CallPresentationModel::__pInstance = null;
CallPresentationModel* CallPresentationModel::__pInstance = null;
__pTelEventListener = pTelEventListener;
}
__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;
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
NetworkStatus networkStatus;
result r;
//Check if Telephony Manager is initialized
__pTelEventListener->HandleTelephonyError(ERROR_DIAL_FAILED);
return ;
}
__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");
//setup outgoing call
errorCode = __pTelephonyMgr->SetupMoCall(contactNumber, isEmergency);
TryCatch(errorCode == ERROR_NONE,,"Error occurred while setup MO call");
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_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";
//Panel
const wchar_t* PANEL_DIALER = L"PanelDialer";
const wchar_t* PANEL_LOGS = L"PanelLogs";