From: Amith Kumar Mahale Date: Tue, 23 Apr 2013 11:48:17 +0000 (+0530) Subject: Feature to show group image if a call comes from a group member X-Git-Tag: accepted/tizen_2.1/20130425.023544~1 X-Git-Url: http://review.tizen.org/git/?p=apps%2Fosp%2FCall.git;a=commitdiff_plain;h=17d946effaeb0cffc6d781591183905ff52f416f Feature to show group image if a call comes from a group member Change-Id: Ib0200b617af4625644ff4def2bc97bac7aa03c7d Signed-off-by: Amith Kumar Mahale --- diff --git a/inc/CallInfo.h b/inc/CallInfo.h index 99f074f..d915984 100644 --- a/inc/CallInfo.h +++ b/inc/CallInfo.h @@ -155,6 +155,8 @@ private: //used to store previously fetched contact. Tizen::Social::Contact* __pContact; + // having the address book here + Tizen::Social::Addressbook* __pAddressBook; }; #endif // _PHN_CALL_INFO_H_ diff --git a/src/CallInfo.cpp b/src/CallInfo.cpp index ed7af01..1981d59 100644 --- a/src/CallInfo.cpp +++ b/src/CallInfo.cpp @@ -27,6 +27,7 @@ using namespace Tizen::Base::Collection; using namespace Tizen::Graphics; using namespace Tizen::Media; using namespace Tizen::Social; +using namespace Tizen::Telephony; AppCallInfo::AppCallInfo(void) { @@ -41,6 +42,7 @@ AppCallInfo::AppCallInfo(void) __pEndCallCause = null; __pParticipantCallHandles = null; __pContact = null; + __pAddressBook = null; } AppCallInfo::~AppCallInfo(void) @@ -64,6 +66,10 @@ AppCallInfo::~AppCallInfo(void) { delete __pContact; } + if(__pAddressBook != null) + { + delete __pAddressBook; + } } Long* @@ -347,10 +353,23 @@ AppCallInfo::FetchCallerPhotoN(void) { String thumbnailPath; Bitmap* pThumbnail = null; - // __pContact->GetValue(CONTACT_PROPERTY_ID_THUMBNAIL, thumbnailPath); - thumbnailPath = __pContact->GetThumbnailPath(); + __pAddressBook = AddressbookManager::GetInstance()->GetAddressbookN(); + + result r = __pContact->GetValue(CONTACT_PROPERTY_ID_THUMBNAIL, thumbnailPath); + //Now check if there is a group ring tone + if(thumbnailPath.IsEmpty() == true) + { + IList* pCategoryList = __pAddressBook->GetCategoriesByContactN(__pContact->GetRecordId()); + if(pCategoryList != null && pCategoryList->GetCount() > 0) + { + AppLogDebug("Changes to get thumbnail group photo"); + Category* pCategory = static_cast(pCategoryList->GetAt(0)); + thumbnailPath = pCategory->GetThumbnailPath(); + } + } + //thumbnailPath = __pContact->GetThumbnailPath(); ImageBuffer thumbnailImageBuffer; - result r = thumbnailImageBuffer.Construct(thumbnailPath); + r = thumbnailImageBuffer.Construct(thumbnailPath); if (r == E_SUCCESS) { pThumbnail = thumbnailImageBuffer.GetBitmapN(BITMAP_PIXEL_FORMAT_ARGB8888, BUFFER_SCALING_NONE);