diff --git a/ability/common/include/common.h b/ability/common/include/common.h index ccdbf28b25cc3c8165be7ba985d4638c1c3ae0c6..dddc473c1c2c56429a122b0aa2c888194fdba15b 100644 --- a/ability/common/include/common.h +++ b/ability/common/include/common.h @@ -122,6 +122,7 @@ constexpr const char *CALL_LOG_URI = "datashare:///com.ohos.calllogability"; constexpr const char *CREATE_CALLLOG = "CREATE TABLE IF NOT EXISTS [calllog](" "[id] INTEGER PRIMARY KEY AUTOINCREMENT, " + "[slot_id] INTEGER NOT NULL DEFAULT 0, " "[phone_number] TEXT, " "[display_name] TEXT, " "[call_direction] INTEGER NOT NULL DEFAULT 0, " diff --git a/jstest/common.js b/jstest/common.js index 27b276ea3b5a4fdc57fe56fb666b3ef59bb55d19..1b0702b56bd2e1aaaa7fedbe45da5667b59f1b2b 100644 --- a/jstest/common.js +++ b/jstest/common.js @@ -84,7 +84,7 @@ export default { getCallLogResultColumns: function() { var resultColumns = [ - "id", "phone_number", "display_name", "call_direction", "voicemail_uri", "sim_type", "is_hd", "is_read", + "id", "slot_id", "phone_number", "display_name", "call_direction", "voicemail_uri", "sim_type", "is_hd", "is_read", "ring_duration", "talk_duration", "format_number", "quicksearch_key", "number_type", "number_type_name", "begin_time", "end_time", "answer_state", "create_time", "number_location", "photo_id", "photo_uri", "country_iso_code", "extra1", "extra2", "extra3", "extra4", "extra5", "extra6" diff --git a/test/unittest/src/calllogability_test.cpp b/test/unittest/src/calllogability_test.cpp index 18a5b6ed1bd78fe781e4c43c4ab2ce8329a62b60..d8481b345ac36a859f33fe4056780d013285383b 100644 --- a/test/unittest/src/calllogability_test.cpp +++ b/test/unittest/src/calllogability_test.cpp @@ -81,6 +81,7 @@ int64_t CalllogAbilityTest::CalllogInsertValue(std::string displayName, OHOS::Da void CalllogAbilityTest::GetAllValuesColumn(std::vector &column) { + column.push_back("slot_id"); column.push_back("phone_number"); column.push_back("display_name"); column.push_back("call_direction"); @@ -124,6 +125,7 @@ OHOS::DataShare::DataShareValuesBucket CalllogAbilityTest::GetCallLogValues( RandomNumberUtils randomNumberUtils; std::string phoneNumber = randomNumberUtils.Generating(number); OHOS::DataShare::DataShareValuesBucket valuesBucket; + valuesBucket.Put("slot_id", ContactsRand()); valuesBucket.Put("phone_number", phoneNumber + callLogTestStringValue); valuesBucket.Put("display_name", "name"); valuesBucket.Put("call_direction", ContactsRand());