From e06655f2b504c9b1e64088601c275dda546a5451 Mon Sep 17 00:00:00 2001 From: Amith Kumar Mahale Date: Thu, 1 Aug 2013 18:13:30 +0530 Subject: [PATCH] Minor fix found in developer testing, Change to send number without , and ; to messaging Change-Id: I14c5f3cb00146a9283f9bfa10fa6e9e82195595f Signed-off-by: Amith Kumar Mahale --- src/CallAppControlRequestMgr.cpp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/CallAppControlRequestMgr.cpp b/src/CallAppControlRequestMgr.cpp index bc839a3..af6f3a7 100644 --- a/src/CallAppControlRequestMgr.cpp +++ b/src/CallAppControlRequestMgr.cpp @@ -118,6 +118,27 @@ CallAppControlRequestMgr::AppControlRequestCompleted(void) bool CallAppControlRequestMgr::LaunchComposeMessageAppControl(String& contactNumber, IAppControlResponseListener* pListener) { + String tempContactNumber; + int commaIndex = 0; + int semiColonIndex = 0; + int index = 0; + contactNumber.IndexOf(",", 0, commaIndex); + contactNumber.IndexOf(";", 0, semiColonIndex); + + if(commaIndex != -1 && semiColonIndex != -1) + { + index = commaIndex < semiColonIndex ? commaIndex : semiColonIndex; + } + else if(commaIndex != -1 || semiColonIndex != -1) + { + index = commaIndex > semiColonIndex ? commaIndex : semiColonIndex; + } + else + { + index = contactNumber.GetLength(); + } + contactNumber.SubString(0, index, tempContactNumber); + if (__pOpenedAppControl != null) { //An AppControl is already running. @@ -133,7 +154,7 @@ CallAppControlRequestMgr::LaunchComposeMessageAppControl(String& contactNumber, HashMap extraData; extraData.Construct(); extraData.Add(new (std::nothrow) String(MESSAGE_TYPE), new (std::nothrow) String(MESSAGE_SMS_TYPE)); - extraData.Add(new (std::nothrow) String(MESSAGE_TO), new (std::nothrow) String(contactNumber)); + extraData.Add(new (std::nothrow) String(MESSAGE_TO), new (std::nothrow) String(tempContactNumber)); __pOpenedAppControl = AppManager::FindAppControlN(PROVIDER_ID_MESSAGE, OPERATION_ID_COMPOSE); if (__pOpenedAppControl != null) -- 2.7.4