From: Kisub Song Date: Mon, 3 Sep 2012 12:56:27 +0000 (+0900) Subject: Update change log and spec for wrt-plugins-tizen_0.2.76 X-Git-Tag: 2.0_alpha~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8e59a1e0d37c497ecba48bfe258c4fdff692bc13;p=framework%2Fweb%2Fwrt-plugins-tizen.git Update change log and spec for wrt-plugins-tizen_0.2.76 Changed Modules : Power and MediaContent [Version] 0.2.76 [Project] GT-I8800, Public [Title] SEL Verification [Team] WebAPI [BinType] PDA [Customer] Open [Issue#] Jira N_SE-8554 [Problem] Power - Wrong internal brightness value stored when bright lock is requested two times. [Cause] Wrong internal value saving. [Solution] Use device_set_brightness_from_settings api instead of saving internal value. [Issue#] N_SE-8252 [Problem] MediaContent - Don't check offset value. And bug of CAPI function(media_filter_set_offse) [Cause] N/A [Solution] Removed offset, count,offset value check code. (now on, check for an error in the CAPI) [SCMRequest] N/A --- diff --git a/debian/changelog b/debian/changelog index 929430a..21d6c3e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,16 @@ +wrt-plugins-tizen (0.2.76) unstable; urgency=low + + * Bug fix on Power and MediaContent + * Git : slp/pkgs/w/wrt-plugins-tizen + * Tag : wrt-plugins-tizen_0.2.76 + + -- Kisub Song Mon, 03 Sep 2012 21:50:35 +0900 + wrt-plugins-tizen (0.2.75) unstable; urgency=low * Bug fix on Messaging, Download, Systeminfo and Contact * Git : slp/pkgs/w/wrt-plugins-tizen - * Tag : wrt-plugins-tizen_0.2.74 + * Tag : wrt-plugins-tizen_0.2.75 -- Kisub Song Sat, 01 Sep 2012 00:10:05 +0900 diff --git a/packaging/wrt-plugins-tizen.spec b/packaging/wrt-plugins-tizen.spec index af7a58d..74cab58 100755 --- a/packaging/wrt-plugins-tizen.spec +++ b/packaging/wrt-plugins-tizen.spec @@ -1,6 +1,6 @@ Name: wrt-plugins-tizen Summary: JavaScript plugins for WebRuntime -Version: 0.2.75 +Version: 0.2.76 Release: 0 Group: TO_BE_FILLED License: TO_BE_FILLED diff --git a/src/platform/Tizen/Contact/ContactSearchEngine.cpp b/src/platform/Tizen/Contact/ContactSearchEngine.cpp index eb3ed46..dc29dd4 100755 --- a/src/platform/Tizen/Contact/ContactSearchEngine.cpp +++ b/src/platform/Tizen/Contact/ContactSearchEngine.cpp @@ -43,8 +43,8 @@ using namespace std; map ContactSearchEngine::attrEnumMap = { {"id", contact_attribute_e::CONTACT_ID}, + {"addressBookId", contact_attribute_e::ADDRESSBOOK_ID}, {"readOnly", contact_attribute_e::ATTRIBUTE_MAX}, - {"accountId", contact_attribute_e::ATTRIBUTE_MAX}, {"prefix", contact_attribute_e::NAME_PREFIX}, {"name.firstName", contact_attribute_e::NAME_FIRST}, {"name.middleName", contact_attribute_e::NAME_MIDDLE}, @@ -59,12 +59,12 @@ map ContactSearchEngine::attrEnumMap = { {"addresses.streetAddress", contact_attribute_e::ADDRESS_STREET}, {"addresses.additionalInformation", contact_attribute_e::ADDRESS_ADDITIONAL}, {"addresses.postalCode", contact_attribute_e::ADDRESS_POSTAL_CODE}, - {"addresses.types", contact_attribute_e::ATTRIBUTE_MAX}, + {"addresses.types", contact_attribute_e::ADDRESS_TYPES}, {"photoURI", contact_attribute_e::CONTACT_PHOTO_URI}, {"phoneNumbers.number", contact_attribute_e::NUMBER_ADDRESS}, {"phoneNumbers.types", contact_attribute_e::NUMBER_TYPES}, {"emails.email", contact_attribute_e::EMAIL_ADDRESS}, - {"emails.types", contact_attribute_e::EMAIL_TYPE}, + {"emails.types", contact_attribute_e::EMAIL_TYPES}, {"birthday", contact_attribute_e::EVENT_DATE}, {"anniversaries.date", contact_attribute_e::EVENT_DATE}, {"organizations.name", contact_attribute_e::ORGANIZATION_NAME}, @@ -196,24 +196,19 @@ ContactArrayPtr ContactSearchEngine::getContactSearchResult() err = QUERY_SUCCESS; if (!nameAlreadyChecked && - (pattr == CONTACT_ID || pattr == NAME_FIRST || pattr == NAME_LAST || - pattr == NAME_MIDDLE || pattr == NAME_DISPLAY)) + (pattr == CONTACT_ID || pattr == ADDRESSBOOK_ID || pattr == NAME_FIRST || + pattr == NAME_LAST ||pattr == NAME_MIDDLE || + pattr == NAME_PREFIX || pattr == NAME_DISPLAY)) { char* str; str = query_get_attribute(m_contact_query_service, CONTACT_ID, &err); if( str ) - { contact->setId(str); - } - str = query_get_attribute(m_contact_query_service, ACCOUNT_ID, &err); + str = query_get_attribute(m_contact_query_service, ADDRESSBOOK_ID, &err); if( str ) - { - int accountId = ContactUtility::strToInt(str); - int addressBookId = find_addressbook_id(accountId, &err); - contact->setAddressBookId(addressBookId); - } + contact->setAddressBookId(str); str = query_get_attribute(m_contact_query_service, CONTACT_IS_FAVORITE, &err); if( str ) @@ -268,12 +263,12 @@ ContactArrayPtr ContactSearchEngine::getContactSearchResult() numberAlreadyChecked = true; } - else if (!emailAlreadyChecked && (pattr == EMAIL_ADDRESS || pattr == EMAIL_TYPE)) + else if (!emailAlreadyChecked && (pattr == EMAIL_ADDRESS || pattr == EMAIL_TYPES)) { do { char *email = query_get_attribute(m_contact_query_service, EMAIL_ADDRESS, &err); - char *emailType = query_get_attribute(m_contact_query_service, EMAIL_TYPE, &err); + char *emailType = query_get_attribute(m_contact_query_service, EMAIL_TYPES, &err); setEmailAddresses(contact, email, emailType); @@ -297,7 +292,8 @@ ContactArrayPtr ContactSearchEngine::getContactSearchResult() else if (!addrAlreadyChecked && (pattr == ADDRESS_COUNTRY || pattr == ADDRESS_REGION || pattr == ADDRESS_CITY || pattr == ADDRESS_STREET || - pattr == ADDRESS_POSTAL_CODE || pattr == ADDRESS_ADDITIONAL) ) + pattr == ADDRESS_POSTAL_CODE || pattr == ADDRESS_ADDITIONAL || + pattr == ADDRESS_TYPES) ) { do { @@ -307,8 +303,9 @@ ContactArrayPtr ContactSearchEngine::getContactSearchResult() char *street = query_get_attribute(m_contact_query_service, ADDRESS_STREET, &err); char *postal_code = query_get_attribute(m_contact_query_service, ADDRESS_POSTAL_CODE, &err); char *additional = query_get_attribute(m_contact_query_service, ADDRESS_ADDITIONAL, &err); + char *types = query_get_attribute(m_contact_query_service, ADDRESS_TYPES, &err); - setAddresses(contact, country, region, city, NULL, street, postal_code, additional); + setAddresses(contact, country, region, city, NULL, street, postal_code, additional, types); } while ( fetch_next_row(m_contact_query_service) == QUERY_SUCCESS ); @@ -702,7 +699,7 @@ void ContactSearchEngine::setPlatformAttrValue(Contact& contact, contact_attribu case NUMBER_TYPES: break; case EMAIL_ADDRESS: - case EMAIL_TYPE: + case EMAIL_TYPES: break; case URL_ADDRESS: @@ -882,9 +879,9 @@ void ContactSearchEngine::setUrlAddresses(ContactPtr& contact, char *url, char * tokenize(type,tokens, ","); for (unsigned int i=0; isetType(WEBSITE_TYPE_HOMEPAGE); - else if (tokens[i].compare("BLOG") == 0) + else if (tokens[i].compare("WORK") == 0) urlType->setType(WEBSITE_TYPE_BLOG); } } @@ -893,7 +890,8 @@ void ContactSearchEngine::setUrlAddresses(ContactPtr& contact, char *url, char * } void ContactSearchEngine::setAddresses(ContactPtr& contact, - char *country, char *region, char* city, char *county, char *street, char *postal_code, char *additional) + char *country, char *region, char* city, char *county, + char *street, char *postal_code, char *additional, char *types) { if(country == NULL && region == NULL && city == NULL && county == NULL && street == NULL && postal_code == NULL && additional == NULL) @@ -919,6 +917,22 @@ void ContactSearchEngine::setAddresses(ContactPtr& contact, if(additional) addr->setAdditionalInformation(string(additional)); + if(types) + { + vector tokens; + tokenize(types,tokens, ","); + + for (unsigned int i=0; iaddType(CONTACT_ADDRESS_TYPE_WORK); + else if (tokens[i].compare("PREF") == 0) + addr->addType(CONTACT_ADDRESS_TYPE_PREF); + else if (tokens[i].compare("HOME") == 0) + addr->addType(CONTACT_ADDRESS_TYPE_HOME); + } + } + contact->addAddress(addr); } diff --git a/src/platform/Tizen/Contact/ContactSearchEngine.h b/src/platform/Tizen/Contact/ContactSearchEngine.h index 94b243e..d630cf6 100755 --- a/src/platform/Tizen/Contact/ContactSearchEngine.h +++ b/src/platform/Tizen/Contact/ContactSearchEngine.h @@ -93,7 +93,7 @@ private: void setPhoneNumber(TizenApis::Api::Contact::ContactPtr& contact, char *number, char *type); void setEmailAddresses(TizenApis::Api::Contact::ContactPtr& contact, char *email, char *type); void setUrlAddresses(TizenApis::Api::Contact::ContactPtr& contact, char *url, char *type); - void setAddresses(TizenApis::Api::Contact::ContactPtr& contact, char *country, char *region, char* city, char *county, char *street, char *postal_code, char *additional); + void setAddresses(TizenApis::Api::Contact::ContactPtr& contact, char *country, char *region, char* city, char *county, char *street, char *postal_code, char *additional, char *types); void setEvent(TizenApis::Api::Contact::ContactPtr& contact, char *date, char *type); void setOrganization(TizenApis::Api::Contact::ContactPtr& contact, char* org_name, char* org_dept, char* org_title, char* org_role); diff --git a/src/platform/Tizen/Contact/query-svc/query-service.h b/src/platform/Tizen/Contact/query-svc/query-service.h index 0937b92..4c64b51 100755 --- a/src/platform/Tizen/Contact/query-svc/query-service.h +++ b/src/platform/Tizen/Contact/query-svc/query-service.h @@ -35,6 +35,7 @@ extern "C" { typedef enum { CONTACT_ID = 0, + ADDRESSBOOK_ID, CONTACT_IS_FAVORITE, CONTACT_RINGTONE, @@ -56,7 +57,7 @@ typedef enum NUMBER_TYPES, EMAIL_ADDRESS = 70, - EMAIL_TYPE, + EMAIL_TYPES, URL_ADDRESS = 80, URL_TYPE, @@ -67,7 +68,7 @@ typedef enum ADDRESS_STREET, ADDRESS_POSTAL_CODE, ADDRESS_ADDITIONAL, - ADDRESS_TYPE, + ADDRESS_TYPES, CATEGORY_INFO = 110, @@ -79,7 +80,9 @@ typedef enum ORGANIZATION_TITLE, ORGANIZATION_ROLE, - ACCOUNT_ID = 150, + DATA_ID = 160, + CONTACT_DEFAULT_NUM, + CONTACT_DEFAULT_EMAIL, ATTRIBUTE_MAX = 512 }contact_attribute_e; @@ -226,12 +229,8 @@ API char* query_get_x_attribute(ADVANCED_HANDLE handle, contact_x_attribute_e at // Not common APIs API int get_contact_version(); -API int find_addressbook_id(int account_id, query_error *error_code); - API void refresh_addressbook_list(void *data); -API int* get_all_addressbook_id(int* total_count); - #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/src/platform/Tizen/Contact/query-svc/query-svc.c b/src/platform/Tizen/Contact/query-svc/query-svc.c index c914e91..6a7d2cf 100755 --- a/src/platform/Tizen/Contact/query-svc/query-svc.c +++ b/src/platform/Tizen/Contact/query-svc/query-svc.c @@ -68,73 +68,6 @@ API void refresh_addressbook_list(void *data) contacts_svc_list_foreach(CTS_LIST_ALL_ADDRESSBOOK, list_cb, NULL); } - -API int find_addressbook_id(int account_id, query_error *error_code) -{ - int ret; - int addressbook_id = -1; - - ADVANCED_SVC_TRACE("account_id : %d", account_id); - - if(account_id == 0) - return 0; - - if(g_addressbook_list == NULL) - { - ADVANCED_SVC_TRACE("GENERATE ADDRESSBOOK LIST"); - ret = contacts_svc_list_foreach(CTS_LIST_ALL_ADDRESSBOOK, list_cb, NULL); - } - - GList* tmp_list = g_addressbook_list; - while(tmp_list) - { - addressbook_list* info = (addressbook_list*)tmp_list->data; - if(info->account_id == account_id) - { - addressbook_id = info->addressbook_id; - break; - } - tmp_list = g_list_next(tmp_list); - } - if(addressbook_id == -1) - *error_code = QUERY_NO_RECORD; - else - *error_code = QUERY_SUCCESS; - - ADVANCED_SVC_TRACE("addressbook_id : %d", addressbook_id); - - return addressbook_id; -} - -API int* get_all_addressbook_id(int* total_count) -{ - int i = 0; - int* id_list = NULL; - - if(g_addressbook_list == NULL) - { - ADVANCED_SVC_TRACE("GENERATE ADDRESSBOOK LIST"); - contacts_svc_list_foreach(CTS_LIST_ALL_ADDRESSBOOK, list_cb, NULL); - } - - id_list = g_new0(int, (total_addressbook_id + 2)); - id_list[i] = 0; - - GList* tmp_list = g_addressbook_list; - while(tmp_list) - { - i++; - addressbook_list* info = (addressbook_list*)tmp_list->data; - - id_list[i] = info->addressbook_id; - tmp_list = g_list_next(tmp_list); - } - - *total_count = total_addressbook_id + 1; - - return id_list; -} - int _value_to_projection(stmt hstmt, char** projection, int count) { int pos = 0; @@ -361,12 +294,12 @@ void __convert_x_info_to_str(int db_value, GString* type_str) g_string_append_printf (type_str, "%d", db_value); } -void __convert_is_favorite_to_str(int db_value, GString* type_str) +void __convert_bool_to_str(int db_value, GString* type_str) { if(db_value == 1) - g_string_append_printf (type_str, "%s", is_favorite_str[1]); + g_string_append_printf (type_str, "%s", bool_str[1]); else - g_string_append_printf (type_str, "%s", is_favorite_str[0]); + g_string_append_printf (type_str, "%s", bool_str[0]); } int _int_value_to_projection(tables_e table, db_datatype datatype, stmt hstmt, char** projection, int count) @@ -405,10 +338,10 @@ int _int_value_to_projection(tables_e table, db_datatype datatype, stmt hstmt, c } }else if(table == CONTACT_TABLE) { - __convert_is_favorite_to_str(db_value, type_str); + __convert_bool_to_str(db_value, type_str); }else if(table == PERSON_TABLE) { - __convert_is_favorite_to_str(db_value, type_str); + __convert_bool_to_str(db_value, type_str); } *projection = (char*)g_strdup(type_str->str); @@ -655,6 +588,9 @@ query_error _make_contact_info(advanced_handle_t* q_handle, projection_type type }else if(strcmp(field_key[FIELD_DATA1], projection) == 0 && q_handle->attribute_list[NUMBER_TYPES] == 1) { count = _int_value_to_projection(DATA_TABLE, DB_DATATYPE_NUMBER, q_handle->hstmt, &(num_info->number_type), count); + }else if(strcmp(field_key[FIELD_DATA_ID], projection) == 0 && q_handle->attribute_list[NUMBER_TYPES] == 1) + { + count = _value_to_projection(q_handle->hstmt, &(num_info->number_id), count); } } break; @@ -663,9 +599,12 @@ query_error _make_contact_info(advanced_handle_t* q_handle, projection_type type if(strcmp(field_key[FIELD_DATA2], projection) == 0 && q_handle->attribute_list[EMAIL_ADDRESS] == 1) { count = _value_to_projection(q_handle->hstmt, &(email_info->email_addr), count); - }else if(strcmp(field_key[FIELD_DATA1], projection) == 0 && q_handle->attribute_list[EMAIL_TYPE] == 1) + }else if(strcmp(field_key[FIELD_DATA1], projection) == 0 && q_handle->attribute_list[EMAIL_TYPES] == 1) { count = _int_value_to_projection(DATA_TABLE, DB_DATATYPE_EMAIL, q_handle->hstmt, &(email_info->email_type), count); + }else if(strcmp(field_key[FIELD_DATA_ID], projection) == 0 && q_handle->attribute_list[EMAIL_TYPES] == 1) + { + count = _value_to_projection(q_handle->hstmt, &(email_info->email_id), count); } } @@ -709,7 +648,7 @@ query_error _make_contact_info(advanced_handle_t* q_handle, projection_type type }else if(strcmp(field_key[FIELD_DATA7], projection) == 0 && q_handle->attribute_list[ADDRESS_ADDITIONAL] == 1) { count = _value_to_projection(q_handle->hstmt, &(address_info->addtional), count); - }else if(strcmp(field_key[FIELD_DATA1], projection) == 0 && q_handle->attribute_list[ADDRESS_TYPE] == 1) + }else if(strcmp(field_key[FIELD_DATA1], projection) == 0 && q_handle->attribute_list[ADDRESS_TYPES] == 1) { count = _int_value_to_projection(DATA_TABLE, DB_DATATYPE_ADDRESS, q_handle->hstmt, &(address_info->type), count); } @@ -829,6 +768,12 @@ query_error _make_contact_info(advanced_handle_t* q_handle, projection_type type { count = _int_value_to_projection(CONTACT_TABLE, DB_DATATYPE_INVALID, q_handle->hstmt, &(q_handle->result_set[q_handle->pos].contact_info->raw_contact_info->is_favorite), count); + }else if(strcmp(field_key[FIELD_CONTACT_DEFAULT_NUM], projection) == 0) + { + count = _value_to_projection(q_handle->hstmt, &(q_handle->result_set[q_handle->pos].contact_info->raw_contact_info->default_num), count); + }else if(strcmp(field_key[FIELD_CONTACT_DEFAULT_EMAIL], projection) == 0) + { + count = _value_to_projection(q_handle->hstmt, &(q_handle->result_set[q_handle->pos].contact_info->raw_contact_info->default_email), count); }else if(strcmp(field_key[FIELD_CHANGED_TIME], projection) == 0) { int changed_time = 0; @@ -836,14 +781,9 @@ query_error _make_contact_info(advanced_handle_t* q_handle, projection_type type changed_time = _ct_query_column_int(q_handle->hstmt, count++); snprintf(tmp_string, 64, "%d", changed_time); q_handle->result_set[q_handle->pos].contact_info->raw_contact_info->last_updated_time_stamp = (char*)g_strdup(tmp_string); - }else if(strcmp(field_key[FIELD_CONTACT_ACCOUNT_ID], projection) == 0) + }else if(strcmp(field_key[FIELD_CONTACT_ADDRESSBOOK_ID], projection) == 0) { - int db_value = _ct_query_column_int(q_handle->hstmt, count++); - if(db_value != 0) - { - q_handle->result_set[q_handle->pos].contact_info->raw_contact_info->account_id = g_new0(char, 64); - snprintf(q_handle->result_set[q_handle->pos].contact_info->raw_contact_info->account_id, 64, "%d", db_value); - } + count = _value_to_projection(q_handle->hstmt, &(q_handle->result_set[q_handle->pos].contact_info->raw_contact_info->addressbook_id), count); }else if(strcmp(field_key[FIELD_UID], projection) == 0) { count = _value_to_projection(q_handle->hstmt, &(q_handle->result_set[q_handle->pos].contact_info->raw_contact_info->uid), count); @@ -895,6 +835,84 @@ CATCH: return error_code; } +query_error _post_process_contact_info(advanced_handle_t* q_handle, projection_type type, target_table_e join_table) +{ + query_error error_code = QUERY_SUCCESS; + + if(join_table != ONLY_PERSON && join_table != JOIN_PERSON_DATA) + { + contact_t* contact_info = q_handle->result_set[q_handle->pos].contact_info; + if(contact_info == NULL) + return error_code; + + raw_contact_t* raw_contact_info = contact_info->raw_contact_info; + if(raw_contact_info == NULL) + return error_code; + + if(raw_contact_info->default_email) + { + GList* email_list = contact_info->email_list; + while(email_list) + { + email_t* email_info = (email_t*)email_list->data; + + if(email_info->email_id != NULL && + strcmp(raw_contact_info->default_email, email_info->email_id) == 0) + { + GString* type_str = g_string_new (""); + g_string_append_printf(type_str, "%s", "PREF"); + char *old_type_str = email_info->email_type; + if(old_type_str != NULL && old_type_str[0] != '\0') + { + g_string_append_printf(type_str, ",%s", old_type_str); + } + + OBJ_FREE(old_type_str); + + email_info->email_type = (char*)g_strdup(type_str->str); + + g_string_free(type_str, TRUE); + } + + email_list = g_list_next(email_list); + } + } + + if(raw_contact_info->default_num) + { + GList* number_list = contact_info->number_list; + while(number_list) + { + number_t* number_info = (number_t*)number_list->data; + + if(number_info->number_id != NULL && + strcmp(raw_contact_info->default_num, number_info->number_id) == 0) + { + GString* type_str = g_string_new (""); + g_string_append_printf(type_str, "%s", "PREF"); + char *old_type_str = number_info->number_type; + if(old_type_str != NULL && old_type_str[0] != '\0') + { + g_string_append_printf(type_str, ",%s", old_type_str); + } + + OBJ_FREE(old_type_str); + + number_info->number_type = (char*)g_strdup(type_str->str); + + g_string_free(type_str, TRUE); + + break; + } + + number_list = g_list_next(number_list); + } + } + } + + return error_code; +} + API ADVANCED_HANDLE query_init(query_error* error_code, query_type_e query_type) { ADVANCED_RETURN_VAL((query_type >= QUERY_TO_PERSON), {}, NULL, ("INVALID QUERY TYPE")); @@ -987,6 +1005,32 @@ API query_error query_set_attribute(ADVANCED_HANDLE handle, contact_attribute_e projection_info->field = g_strdup(column_name); q_handle->projection = g_list_append(q_handle->projection, projection_info); + if(attribute == NUMBER_TYPES) + { + column_name = _convert_attribute_to_column_name(DATA_ID); + projection_info = g_new0(projection_t, 1); + projection_info->field = g_strdup(column_name); + q_handle->projection = g_list_append(q_handle->projection, projection_info); + + column_name = _convert_attribute_to_column_name(CONTACT_DEFAULT_NUM); + projection_info = g_new0(projection_t, 1); + projection_info->field = g_strdup(column_name); + q_handle->projection = g_list_append(q_handle->projection, projection_info); + } + + if(attribute == EMAIL_TYPES) + { + column_name = _convert_attribute_to_column_name(DATA_ID); + projection_info = g_new0(projection_t, 1); + projection_info->field = g_strdup(column_name); + q_handle->projection = g_list_append(q_handle->projection, projection_info); + + column_name = _convert_attribute_to_column_name(CONTACT_DEFAULT_EMAIL); + projection_info = g_new0(projection_t, 1); + projection_info->field = g_strdup(column_name); + q_handle->projection = g_list_append(q_handle->projection, projection_info); + } + if(q_handle->query_type == QUERY_TO_PERSON) table_name = _convert_person_attribute_to_table_name(attribute); @@ -1470,6 +1514,8 @@ query_error _query_result_set(advanced_handle_t* q_handle, int rc, int count, pr _ct_query_finalize(q_handle->hstmt); + _post_process_contact_info(q_handle, type, join_table); + CATCH: return error_code; } @@ -2464,32 +2510,7 @@ API query_error query_set_condition(ADVANCED_HANDLE handle, contact_attribute_e condition_txt->attribute = attribute; if(type == INTEGER) { - if(attribute == ACCOUNT_ID) - { - int total_count = 0; - - char *end_ptr = value; - errno = 0; - int integer_value = (int)strtol(value, &end_ptr, 0); - if(errno == ERANGE || end_ptr == value) - { - return QUERY_INVALID_TYPE; - } - - get_all_addressbook_id(&total_count); - GList* tmp_list = g_addressbook_list; - while(tmp_list) - { - addressbook_list* info = (addressbook_list*)tmp_list->data; - if(integer_value == info->account_id) - { - condition_txt->int_value = info->addressbook_id; - break; - } - tmp_list = g_list_next(tmp_list); - } - }else - condition_txt->int_value = _convert_type_string_to_int(attribute, value); + condition_txt->int_value = _convert_type_string_to_int(attribute, value); }else if(type == STRING) { condition_txt->value = g_strdup(value); @@ -2639,6 +2660,7 @@ API query_error fetch_next_row(ADVANCED_HANDLE handle) q_handle->result_set[q_handle->return_array_pos].contact_info->address_info->street = g_strdup(address_info->street); q_handle->result_set[q_handle->return_array_pos].contact_info->address_info->postal_code = g_strdup(address_info->postal_code); q_handle->result_set[q_handle->return_array_pos].contact_info->address_info->addtional = g_strdup(address_info->addtional); + q_handle->result_set[q_handle->return_array_pos].contact_info->address_info->type = g_strdup(address_info->type); ADVANCED_SVC_TRACE("street : %s", q_handle->result_set[q_handle->return_array_pos].contact_info->address_info->street); _free_address_info((address_t*)tmp_list->data); @@ -2958,39 +2980,9 @@ char* _get_attribute_value(advanced_handle_t* q_handle, contact_attribute_e attr ADVANCED_CATCH_SET_ERROR_POINTER((q_handle->result_set[q_handle->return_array_pos].contact_info->raw_contact_info != NULL), {}, QUERY_NO_RECORD, ("no data")); value = q_handle->result_set[q_handle->return_array_pos].contact_info->raw_contact_info->uid; break; - case ACCOUNT_ID : - { + case ADDRESSBOOK_ID : ADVANCED_CATCH_SET_ERROR_POINTER((q_handle->result_set[q_handle->return_array_pos].contact_info->raw_contact_info != NULL), {}, QUERY_NO_RECORD, ("no data")); - if(q_handle->result_set[q_handle->return_array_pos].contact_info->raw_contact_info->account_id != NULL) - { - int int_value = 0; - int total_count = 0; - char *value = q_handle->result_set[q_handle->return_array_pos].contact_info->raw_contact_info->account_id; - char *end_ptr = value; - errno = 0; - int_value = (int)strtol(value, &end_ptr, 0); - if(errno == ERANGE || end_ptr == value) - { - return QUERY_INVALID_TYPE; - } - - get_all_addressbook_id(&total_count); - - GList* tmp_list = g_addressbook_list; - while(tmp_list) - { - addressbook_list* info = (addressbook_list*)tmp_list->data; - if(int_value == info->addressbook_id) - { - memset(q_handle->result_set[q_handle->return_array_pos].contact_info->raw_contact_info->account_id, 0x00, 64); - snprintf(q_handle->result_set[q_handle->return_array_pos].contact_info->raw_contact_info->account_id, 64, "%d", info->account_id); - value = q_handle->result_set[q_handle->return_array_pos].contact_info->raw_contact_info->account_id; - break; - } - tmp_list = g_list_next(tmp_list); - } - } - } + value = q_handle->result_set[q_handle->return_array_pos].contact_info->raw_contact_info->addressbook_id; break; case CONTACT_IS_FAVORITE: ADVANCED_CATCH_SET_ERROR_POINTER((q_handle->result_set[q_handle->return_array_pos].contact_info->raw_contact_info != NULL), {}, QUERY_NO_RECORD, ("no data")); @@ -3052,7 +3044,7 @@ char* _get_attribute_value(advanced_handle_t* q_handle, contact_attribute_e attr ADVANCED_CATCH_SET_ERROR_POINTER((q_handle->result_set[q_handle->return_array_pos].contact_info->email_info != NULL), {}, QUERY_NO_RECORD, ("no data")); value = q_handle->result_set[q_handle->return_array_pos].contact_info->email_info->email_addr; break; - case EMAIL_TYPE: + case EMAIL_TYPES: ADVANCED_CATCH_SET_ERROR_POINTER((q_handle->result_set[q_handle->return_array_pos].contact_info->email_info != NULL), {}, QUERY_NO_RECORD, ("no data")); value = q_handle->result_set[q_handle->return_array_pos].contact_info->email_info->email_type; break; @@ -3088,7 +3080,7 @@ char* _get_attribute_value(advanced_handle_t* q_handle, contact_attribute_e attr ADVANCED_CATCH_SET_ERROR_POINTER((q_handle->result_set[q_handle->return_array_pos].contact_info->address_info != NULL), {}, QUERY_NO_RECORD, ("no data")); value = q_handle->result_set[q_handle->return_array_pos].contact_info->address_info->addtional; break; - case ADDRESS_TYPE: + case ADDRESS_TYPES: ADVANCED_CATCH_SET_ERROR_POINTER((q_handle->result_set[q_handle->return_array_pos].contact_info->address_info != NULL), {}, QUERY_NO_RECORD, ("no data")); value = q_handle->result_set[q_handle->return_array_pos].contact_info->address_info->type; break; diff --git a/src/platform/Tizen/Contact/query-svc/query-type.h b/src/platform/Tizen/Contact/query-svc/query-type.h index ca8c6db..d6fea92 100755 --- a/src/platform/Tizen/Contact/query-svc/query-type.h +++ b/src/platform/Tizen/Contact/query-svc/query-type.h @@ -55,7 +55,7 @@ extern "C" { #ifdef ADVANCED_USE_DLOG_MESSAGE #define ADVANCED_SVC_TRACE(fmt, arg...) \ - SLOGD("\n[QUERY_SVC]%s %d: " fmt "", __FUNCTION__, __LINE__, ##arg); + SLOGD("[QUERY_SVC]%s %d: " fmt "", __FUNCTION__, __LINE__, ##arg); #else #define ADVANCED_SVC_TRACE(fmt, arg...) \ // fprintf(stderr, "\n[QUERY_SVC]%s %d: " fmt "", __FUNCTION__, __LINE__, ##arg); @@ -283,7 +283,7 @@ static char* addr_type_str[MAX_ADDRESS_TYPE] = "PARCEL", }; -static char* is_favorite_str[2] = +static char* bool_str[2] = { "FALSE", "TRUE", @@ -338,9 +338,12 @@ typedef struct typedef struct { char* contact_id; + char* addressbook_id; char* ringtone; char* note; char* is_favorite; + char* default_num; + char* default_email; char* photo_uri; char* birth_day; char* last_updated_time_stamp; @@ -348,7 +351,6 @@ typedef struct char* send_to_voice_mail; char* latitude; char* longitude; - char* account_id; char* uid; }raw_contact_t; @@ -369,6 +371,7 @@ typedef struct typedef struct { + char* number_id; char* number; char* number_type; char* number_label; // not use @@ -376,6 +379,7 @@ typedef struct typedef struct { + char* email_id; char* email_addr; char* email_type; char* email_label; // not use diff --git a/src/platform/Tizen/Contact/query-svc/query-utility.c b/src/platform/Tizen/Contact/query-svc/query-utility.c index c22db1c..dcb7927 100755 --- a/src/platform/Tizen/Contact/query-svc/query-utility.c +++ b/src/platform/Tizen/Contact/query-svc/query-utility.c @@ -283,7 +283,7 @@ predefine_datatype _convert_attribute_to_mimetype_id(contact_attribute_e attribu data_type = DATATYPE_NUMBER; break; case EMAIL_ADDRESS: - case EMAIL_TYPE: + case EMAIL_TYPES: data_type = DATATYPE_EMAIL; break; case URL_ADDRESS: @@ -310,7 +310,7 @@ predefine_datatype _convert_attribute_to_mimetype_id(contact_attribute_e attribu case ADDRESS_STREET: case ADDRESS_POSTAL_CODE: case ADDRESS_ADDITIONAL: - case ADDRESS_TYPE: + case ADDRESS_TYPES: data_type = DATATYPE_ADDRESS; break; case CATEGORY_INFO: @@ -332,7 +332,7 @@ predefine_datatype _convert_attribute_to_mimetype_id(contact_attribute_e attribu case CONTACT_LAST_UPDATED_TIME_STAMP: case CONTACT_ID : case CONTACT_UID : - case ACCOUNT_ID : + case ADDRESSBOOK_ID : default: break; } @@ -480,8 +480,8 @@ char* _convert_attribute_to_condition_column_name(contact_attribute_e attribute) case CONTACT_UID : field_name = condition_field_key[FIELD_UID]; break; - case ACCOUNT_ID : - field_name = condition_field_key[FIELD_CONTACT_ACCOUNT_ID]; + case ADDRESSBOOK_ID : + field_name = condition_field_key[FIELD_CONTACT_ADDRESSBOOK_ID]; break; case CONTACT_IS_FAVORITE : field_name = condition_field_key[FIELD_IS_FAVORITE]; @@ -534,7 +534,7 @@ char* _convert_attribute_to_condition_column_name(contact_attribute_e attribute) case EMAIL_ADDRESS: field_name = condition_field_key[FIELD_DATA2]; break; - case EMAIL_TYPE: + case EMAIL_TYPES: field_name = condition_field_key[FIELD_DATA1]; break; case URL_ADDRESS: @@ -564,7 +564,7 @@ char* _convert_attribute_to_condition_column_name(contact_attribute_e attribute) case ADDRESS_ADDITIONAL: field_name = condition_field_key[FIELD_DATA7]; break; - case ADDRESS_TYPE: + case ADDRESS_TYPES: field_name = condition_field_key[FIELD_DATA1]; break; // case CATEGORY_INFO: @@ -612,15 +612,15 @@ primitive_type _convert_check_attribute_primitive_type(contact_attribute_e attri switch(attribute) { case CONTACT_ID : - case ACCOUNT_ID : + case ADDRESSBOOK_ID : // case CONTACT_READ_ONLY : // case CONTACT_SEND_TO_VOICE_MAIL : case CONTACT_LAST_UPDATED_TIME_STAMP : case CONTACT_IS_FAVORITE : case NUMBER_TYPES: - case EMAIL_TYPE: + case EMAIL_TYPES: case URL_TYPE: - case ADDRESS_TYPE: + case ADDRESS_TYPES: case EVENT_TYPE: type = INTEGER; break; @@ -730,8 +730,8 @@ char* _convert_attribute_to_column_name(contact_attribute_e attribute) case CONTACT_ID : field_name = field_key[FIELD_DATA_CONTACT_ID]; break; - case ACCOUNT_ID : - field_name = field_key[FIELD_CONTACT_ACCOUNT_ID]; + case ADDRESSBOOK_ID : + field_name = field_key[FIELD_CONTACT_ADDRESSBOOK_ID]; break; case CONTACT_IS_FAVORITE : field_name = field_key[FIELD_IS_FAVORITE]; @@ -786,7 +786,7 @@ char* _convert_attribute_to_column_name(contact_attribute_e attribute) case EMAIL_ADDRESS: field_name = field_key[FIELD_DATA1]; break; - case EMAIL_TYPE: + case EMAIL_TYPES: field_name = field_key[FIELD_DATA2]; break; case URL_ADDRESS: @@ -816,7 +816,7 @@ char* _convert_attribute_to_column_name(contact_attribute_e attribute) case ADDRESS_ADDITIONAL: field_name = field_key[FIELD_DATA7]; break; - case ADDRESS_TYPE: + case ADDRESS_TYPES: field_name = field_key[FIELD_DATA1]; break; // case CATEGORY_INFO: @@ -849,6 +849,15 @@ char* _convert_attribute_to_column_name(contact_attribute_e attribute) // case ORGANIZATION_LOGO_URI: // field_name = field_key[FIELD_DATA6]; // break; + case DATA_ID: + field_name = field_key[FIELD_DATA_ID]; + break; + case CONTACT_DEFAULT_NUM: + field_name = field_key[FIELD_CONTACT_DEFAULT_NUM]; + break; + case CONTACT_DEFAULT_EMAIL: + field_name = field_key[FIELD_CONTACT_DEFAULT_EMAIL]; + break; default: break; } @@ -958,7 +967,7 @@ char* _convert_attribute_to_table_name(contact_attribute_e attribute) case CONTACT_IS_FAVORITE: case CONTACT_RINGTONE : case CONTACT_NOTE : - case ACCOUNT_ID: + case ADDRESSBOOK_ID: case CONTACT_UID: { table_name = table_key[TABLE_CONTACT]; @@ -977,7 +986,7 @@ char* _convert_attribute_to_table_name(contact_attribute_e attribute) case NUMBER_ADDRESS: case NUMBER_TYPES: case EMAIL_ADDRESS: - case EMAIL_TYPE: + case EMAIL_TYPES: case URL_ADDRESS: case URL_TYPE: case ADDRESS_COUNTRY: @@ -987,7 +996,7 @@ char* _convert_attribute_to_table_name(contact_attribute_e attribute) case ADDRESS_STREET: case ADDRESS_POSTAL_CODE: case ADDRESS_ADDITIONAL: - case ADDRESS_TYPE: + case ADDRESS_TYPES: // case CATEGORY_INFO: case EVENT_DATE: case EVENT_TYPE: @@ -1275,9 +1284,12 @@ void _free_raw_contact_info(raw_contact_t* raw_contact_info) return; OBJ_FREE(raw_contact_info->contact_id); + OBJ_FREE(raw_contact_info->addressbook_id); OBJ_FREE(raw_contact_info->ringtone); OBJ_FREE(raw_contact_info->note); OBJ_FREE(raw_contact_info->is_favorite); + OBJ_FREE(raw_contact_info->default_num); + OBJ_FREE(raw_contact_info->default_email); OBJ_FREE(raw_contact_info->photo_uri); OBJ_FREE(raw_contact_info->birth_day); OBJ_FREE(raw_contact_info->last_updated_time_stamp); @@ -1285,7 +1297,6 @@ void _free_raw_contact_info(raw_contact_t* raw_contact_info) OBJ_FREE(raw_contact_info->send_to_voice_mail); OBJ_FREE(raw_contact_info->latitude); OBJ_FREE(raw_contact_info->longitude); - OBJ_FREE(raw_contact_info->account_id); OBJ_FREE(raw_contact_info->uid); OBJ_FREE(raw_contact_info); } @@ -1322,6 +1333,7 @@ void _free_num_info(number_t* num_info) OBJ_FREE(num_info->number); OBJ_FREE(num_info->number_type); OBJ_FREE(num_info->number_label); + OBJ_FREE(num_info->number_id); OBJ_FREE(num_info); } @@ -1333,6 +1345,7 @@ void _free_email_info(email_t* email_info) OBJ_FREE(email_info->email_addr); OBJ_FREE(email_info->email_type); OBJ_FREE(email_info->email_label); + OBJ_FREE(email_info->email_id); OBJ_FREE(email_info); } @@ -1844,17 +1857,17 @@ int _convert_type_string_to_int(contact_attribute_e attribute, const char* value switch(attribute) { case CONTACT_ID : - case ACCOUNT_ID : + case ADDRESSBOOK_ID : { char *end_ptr = value; errno = 0; integer_value = (int)strtol(value, &end_ptr, 0); if(errno == ERANGE || end_ptr == value) { - ADVANCED_SVC_TRACE("contact_id is wrong : %s", contact_id); + ADVANCED_SVC_TRACE("id is wrong : %s", integer_value); return 0; } - ADVANCED_SVC_TRACE("id : %d", id); + ADVANCED_SVC_TRACE("id : %d", integer_value); } break; case CONTACT_LAST_UPDATED_TIME_STAMP : @@ -1864,7 +1877,7 @@ int _convert_type_string_to_int(contact_attribute_e attribute, const char* value integer_value = (int)strtol(value, &end_ptr, 0); if(errno == ERANGE || end_ptr == value) { - ADVANCED_SVC_TRACE("contact_id is wrong : %s", contact_id); + ADVANCED_SVC_TRACE("stamp is wrong : %s", integer_value); return 0; } } @@ -1934,7 +1947,7 @@ int _convert_type_string_to_int(contact_attribute_e attribute, const char* value } } break; - case EMAIL_TYPE: + case EMAIL_TYPES: { for(i = 1; i <= MAX_EMAIL_TYPE; i++) { @@ -1972,7 +1985,7 @@ int _convert_type_string_to_int(contact_attribute_e attribute, const char* value } } break; - case ADDRESS_TYPE: + case ADDRESS_TYPES: { for(i = 1; i <= MAX_ADDRESS_TYPE; i++) { @@ -2035,9 +2048,9 @@ int _is_type_bitwise_int(contact_attribute_e attribute) switch(attribute) { case NUMBER_TYPES: - case EMAIL_TYPE: + case EMAIL_TYPES: case URL_TYPE: - case ADDRESS_TYPE: + case ADDRESS_TYPES: return TRUE; break; default: diff --git a/src/platform/Tizen/Contact/query-svc/query-utility.h b/src/platform/Tizen/Contact/query-svc/query-utility.h index fb8432b..6202f99 100755 --- a/src/platform/Tizen/Contact/query-svc/query-utility.h +++ b/src/platform/Tizen/Contact/query-svc/query-utility.h @@ -75,7 +75,9 @@ typedef enum FIELD_CONTACT_PERSON_ID, FIELD_CONTACT_CONTACT_ID, - FIELD_CONTACT_ACCOUNT_ID, + FIELD_CONTACT_ADDRESSBOOK_ID, + FIELD_CONTACT_DEFAULT_NUM, + FIELD_CONTACT_DEFAULT_EMAIL, FIELD_CHANGED_TIME, FIELD_IS_FAVORITE, FIELD_PHOTO_URI, @@ -84,6 +86,7 @@ typedef enum FIELD_UID, FIELD_DATA_PERSON_ID, + FIELD_DATA_ID, FIELD_DATA_CONTACT_ID, FIELD_DATA_DATATYPE_ID, FIELD_DATA1, @@ -126,6 +129,8 @@ static char* field_key[FIELD_MAX] = "contacts.person_id", "contacts.contact_id", "contacts.addrbook_id", + "contacts.default_num", + "contacts.default_email", "contacts.changed_time", "contacts.is_favorite", "contacts.image0", @@ -133,6 +138,7 @@ static char* field_key[FIELD_MAX] = "contacts.note", "contacts.uid", "data.person_id", + "data.id", "data.contact_id", "data.datatype", "data.data1", @@ -174,6 +180,8 @@ static char* condition_field_key[FIELD_MAX] = "person_id", "contact_id", "addrbook_id", + "default_num", + "default_email", "changed_time", "is_favorite", "image0", @@ -181,6 +189,7 @@ static char* condition_field_key[FIELD_MAX] = "note", "uid", "person_id", + "id", "contact_id", "datatype", "data1", diff --git a/src/platform/Tizen/Power/PowerManager.cpp b/src/platform/Tizen/Power/PowerManager.cpp index 2f70ff5..bafac80 100755 --- a/src/platform/Tizen/Power/PowerManager.cpp +++ b/src/platform/Tizen/Power/PowerManager.cpp @@ -32,7 +32,6 @@ PowerManager::PowerManager() LogDebug("entered"); m_resource = PowerStateRequest::UNDEFINED_RESOURCE; m_state = PowerStateRequest::UNDEFINED_STATE; - m_brightnessLevel = DEVICE_ERROR_INVALID_PARAMETER; m_requestFailed = false; } @@ -131,11 +130,6 @@ void PowerManager::OnRequestReceived(const IEventRequestPtr &event) ThrowMsg(PlatformException, "Platform error: "<= 6) //optional unsigned long? count { long count = filterConverter->toLong(arguments[5]); - - if(count > 0) - { - dplEvent->setLimit(count); - } - else if ( count == 0) - { - dplEvent->setLimit(-1); // -1 is all row. - } - else - { - cbm->callOnError(JSTizenExceptionFactory::makeErrorObject(context, - JSTizenException::INVALID_VALUES_ERROR, "Argument is invalid")); - return JSValueMakeUndefined(context); - } - + dplEvent->setLimit(count); } if(argumentCount >= 7) //optional unsigned long? offset { long offset = filterConverter->toLong(arguments[6]); - if(offset != 0) - { - dplEvent->setOffset(offset); - } - else - { - dplEvent->setOffset(0); - } + dplEvent->setOffset(offset); } dplEvent->setPrivateData( DPL::StaticPointerCast (cbm)); dplEvent->setForAsynchronousCall(&MediacontentManagerController::getInstance());