Minor fix found in developer testing, Change to send number without , and ; to messaging
authorAmith Kumar Mahale <amith.m@samsung.com>
Thu, 1 Aug 2013 12:43:30 +0000 (18:13 +0530)
committerAmith Kumar Mahale <amith.m@samsung.com>
Thu, 1 Aug 2013 12:43:30 +0000 (18:13 +0530)
Change-Id: I14c5f3cb00146a9283f9bfa10fa6e9e82195595f
Signed-off-by: Amith Kumar Mahale <amith.m@samsung.com>
src/CallAppControlRequestMgr.cpp

index bc839a3..af6f3a7 100644 (file)
@@ -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)