From f0d174fe3affd1d5dead0f3c4517a36ae86aa557 Mon Sep 17 00:00:00 2001
From: Piotr Kosko
Date: Fri, 26 Jan 2018 11:04:18 +0100
Subject: [PATCH 01/16] [version] 2.15
- version increased
- fixed minor style issue
Change-Id: I70a371ce7e6834bf73c413e19de37111168c9147
Signed-off-by: Piotr Kosko
---
packaging/webapi-plugins.spec | 2 +-
src/download/download_instance.cc | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/packaging/webapi-plugins.spec b/packaging/webapi-plugins.spec
index 977ccc8..3b4e9b2 100644
--- a/packaging/webapi-plugins.spec
+++ b/packaging/webapi-plugins.spec
@@ -10,7 +10,7 @@
%define crosswalk_extensions_path %{_libdir}/%{crosswalk_extensions}
Name: webapi-plugins
-Version: 2.14
+Version: 2.15
Release: 0
License: Apache-2.0 and BSD-3-Clause and MIT
Group: Development/Libraries
diff --git a/src/download/download_instance.cc b/src/download/download_instance.cc
index 73bd411..fda4c57 100644
--- a/src/download/download_instance.cc
+++ b/src/download/download_instance.cc
@@ -188,8 +188,7 @@ void DownloadInstance::OnStateChanged(int download_id, download_state_e state, v
CallbackPtr downCbPtr = static_cast(user_data);
// Prevent to call finished, cancelled or failed function more than once
- if (DOWNLOAD_STATE_COMPLETED == downCbPtr->state ||
- DOWNLOAD_STATE_CANCELED == downCbPtr->state ||
+ if (DOWNLOAD_STATE_COMPLETED == downCbPtr->state || DOWNLOAD_STATE_CANCELED == downCbPtr->state ||
DOWNLOAD_STATE_FAILED == downCbPtr->state) {
LoggerD("Already finished job, not calling callback for %d state", downCbPtr->state);
return;
--
2.7.4
From ba2505210e9d1b649802676a8791f87e6d474c90 Mon Sep 17 00:00:00 2001
From: Michal Bistyga
Date: Fri, 2 Feb 2018 12:37:08 +0100
Subject: [PATCH 02/16] [Bluetooth] Fixing undefined behaviour during cast
Char is unsigned by default on ARM architecture. static_cast from double to unsigned char is undefined behaviour and complier overwritten any negative value with 0.
[Validation]
tests 100% pass rate
Change-Id: Iec39a3c17b18ec7aa4f020fe5de709d66fa426fd
Signed-off-by: Michal Bistyga
---
src/bluetooth/bluetooth_gatt_service.cc | 2 +-
src/bluetooth/bluetooth_health_channel.cc | 2 +-
src/bluetooth/bluetooth_socket.cc | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/bluetooth/bluetooth_gatt_service.cc b/src/bluetooth/bluetooth_gatt_service.cc
index 14f4bc7..f6798a8 100644
--- a/src/bluetooth/bluetooth_gatt_service.cc
+++ b/src/bluetooth/bluetooth_gatt_service.cc
@@ -424,7 +424,7 @@ void BluetoothGATTService::WriteValue(const picojson::value& args, picojson::obj
int value_size = value_array.size();
std::unique_ptr value_data(new char[value_size]);
for (int i = 0; i < value_size; ++i) {
- value_data[i] = static_cast(value_array[i].get());
+ value_data[i] = (int) value_array[i].get();
}
struct Data {
diff --git a/src/bluetooth/bluetooth_health_channel.cc b/src/bluetooth/bluetooth_health_channel.cc
index 8d19279..e119693 100644
--- a/src/bluetooth/bluetooth_health_channel.cc
+++ b/src/bluetooth/bluetooth_health_channel.cc
@@ -77,7 +77,7 @@ void BluetoothHealthChannel::SendData(const picojson::value& data, picojson::obj
std::unique_ptr data_ptr{new char[data_size]};
for (std::size_t i = 0; i < data_size; ++i) {
- data_ptr[i] = static_cast(binary_data[i].get());
+ data_ptr[i] = (int) binary_data[i].get();
}
int ntv_ret = bt_hdp_send_data(channel, data_ptr.get(), data_size);
diff --git a/src/bluetooth/bluetooth_socket.cc b/src/bluetooth/bluetooth_socket.cc
index 7625ae4..fea9ed1 100644
--- a/src/bluetooth/bluetooth_socket.cc
+++ b/src/bluetooth/bluetooth_socket.cc
@@ -63,7 +63,7 @@ void BluetoothSocket::WriteData(const picojson::value& data, picojson::object& o
std::unique_ptr data_ptr{new char[data_size]};
for (std::size_t i = 0; i < data_size; ++i) {
- data_ptr[i] = static_cast(binary_data[i].get());
+ data_ptr[i] = (int) binary_data[i].get();
}
if (kBluetoothError == bt_socket_send_data(socket, data_ptr.get(), data_size)) {
--
2.7.4
From ce879c7ab668c7f6f04077bb94903e0b7ac2035f Mon Sep 17 00:00:00 2001
From: Michal Bistyga
Date: Fri, 2 Feb 2018 16:09:33 +0100
Subject: [PATCH 03/16] [NFC] Fixing undefined behaviour during static_cast to
unsigned char
Validation:
Automatic tests 100% pass rate
TODO manual tests
Change-Id: I9c15efc77c82f0f7e4019913b2bd02d0f8047bb1
Signed-off-by: Michal Bistyga
---
src/nfc/nfc_api.js | 5 +++--
src/nfc/nfc_util.cc | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/nfc/nfc_api.js b/src/nfc/nfc_api.js
index 6c3f19b..c282348 100644
--- a/src/nfc/nfc_api.js
+++ b/src/nfc/nfc_api.js
@@ -692,7 +692,7 @@ NFCAdapter.prototype.removeHCEEventListener = function() {
NFCAdapter.prototype.sendHostAPDUResponse = function(apdu, successCallback, errorCallback) {
var args = validator_.validateArgs(arguments, [
- {name: 'apdu', type: types_.ARRAY, values: types_.OCTET},
+ {name: 'apdu', type: types_.ARRAY, values: types_.BYTE},
{name: 'successCallback', type: types_.FUNCTION, optional: true, nullable: true},
{name: 'errorCallback', type: types_.FUNCTION, optional: true, nullable: true}
]);
@@ -1102,7 +1102,8 @@ function NFCTag(tagid) {
var args = validator_.validateArgs(arguments, [
{
name: 'data',
- type: types_.ARRAY
+ type: types_.ARRAY,
+ values: types_.BYTE
},
{
name: 'dataCallback',
diff --git a/src/nfc/nfc_util.cc b/src/nfc/nfc_util.cc
index 46be48b..8a5928f 100644
--- a/src/nfc/nfc_util.cc
+++ b/src/nfc/nfc_util.cc
@@ -336,7 +336,7 @@ unsigned char* NFCUtil::DoubleArrayToUCharArray(const picojson::array& array_in)
ScopeLogger();
unsigned char* result_array = new unsigned char[array_in.size()];
for (std::size_t i = 0; i < array_in.size(); ++i) {
- result_array[i] = static_cast(array_in.at(i).get());
+ result_array[i] = (int) array_in.at(i).get();
}
return result_array;
}
--
2.7.4
From 868d6551b4d2ca28a0cf597673d82e6c765ba92f Mon Sep 17 00:00:00 2001
From: Piotr Kosko
Date: Mon, 5 Feb 2018 07:49:29 +0100
Subject: [PATCH 04/16] [version] 2.16
Change-Id: I7316b54e3c6ab3fe41b5e2e1ac6e4b1a9e7dfa35
Signed-off-by: Piotr Kosko
---
packaging/webapi-plugins.spec | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packaging/webapi-plugins.spec b/packaging/webapi-plugins.spec
index 3b4e9b2..f3b3345 100644
--- a/packaging/webapi-plugins.spec
+++ b/packaging/webapi-plugins.spec
@@ -10,7 +10,7 @@
%define crosswalk_extensions_path %{_libdir}/%{crosswalk_extensions}
Name: webapi-plugins
-Version: 2.15
+Version: 2.16
Release: 0
License: Apache-2.0 and BSD-3-Clause and MIT
Group: Development/Libraries
--
2.7.4
From 31177b000157a07480049a6d726650eb7c827d36 Mon Sep 17 00:00:00 2001
From: Piotr Kosko
Date: Mon, 5 Feb 2018 13:48:16 +0100
Subject: [PATCH 05/16] [SecureElement][NFC][Messageport] Fixing casting
problems
[Bug] Casting double -> char should not be done directly.
[Verification] Passing values greater than 127 to API makes that
values are correctly translated.
TCT passrate 100%.
Change-Id: I786392fd3be2e7d0eb5211e224a25c8078f383e9
Signed-off-by: Piotr Kosko
---
src/messageport/messageport_instance.cc | 4 ++--
src/nfc/nfc_message_utils.cc | 12 ++++++------
src/secureelement/secureelement_instance.cc | 6 +++---
3 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/messageport/messageport_instance.cc b/src/messageport/messageport_instance.cc
index 2614fda..28df499 100644
--- a/src/messageport/messageport_instance.cc
+++ b/src/messageport/messageport_instance.cc
@@ -403,7 +403,7 @@ void MessageportInstance::RemoteMessagePortSendmessage(const picojson::value& ar
size_t i = 0;
for (auto iter = value_array.begin(); iter != value_array.end(); ++iter, ++i) {
- arr[i] = static_cast((*iter).get());
+ arr[i] = (int)(*iter).get();
}
bundle_add_byte(bundle, (*it).get("key").to_str().c_str(), arr, size);
delete[] arr;
@@ -421,7 +421,7 @@ void MessageportInstance::RemoteMessagePortSendmessage(const picojson::value& ar
size_t j = 0;
for (auto byteIter = byteStream.begin(); byteIter != byteStream.end(); ++byteIter, ++j) {
- arr[j] = static_cast((*byteIter).get());
+ arr[j] = (int)(*byteIter).get();
}
bundle_set_byte_array_element(bundle, (*it).get("key").to_str().c_str(), i, arr,
diff --git a/src/nfc/nfc_message_utils.cc b/src/nfc/nfc_message_utils.cc
index 4581c5e..1e36a2f 100644
--- a/src/nfc/nfc_message_utils.cc
+++ b/src/nfc/nfc_message_utils.cc
@@ -301,7 +301,7 @@ PlatformResult NFCMessageUtils::ReportNDEFMessage(const picojson::value& args,
std::unique_ptr data(new unsigned char[size]);
for (ssize_t i = 0; i < size; i++) {
- data[i] = static_cast(raw_data[i].get());
+ data[i] = (int)raw_data[i].get();
}
return ReportNdefMessageFromData(data.get(), size, out);
@@ -321,19 +321,19 @@ static PlatformResult NdefRecordGetHandle(picojson::value& record,
auto type_size = type_data.size();
std::unique_ptr type(new unsigned char[type_size]);
for (size_t i = 0; i < type_size; i++) {
- type[i] = static_cast(type_data[i].get());
+ type[i] = (int)type_data[i].get();
}
const picojson::array& id_data = FromJson(record_obj, "id");
auto id_size = id_data.size();
std::unique_ptr id(new unsigned char[id_size]);
for (size_t i = 0; i < id_size; i++) {
- id[i] = static_cast(id_data[i].get());
+ id[i] = (int)(id_data[i].get());
}
const picojson::array& payload_data = FromJson(record_obj, "payload");
auto payload_size = payload_data.size();
std::unique_ptr payload(new unsigned char[payload_size]);
for (size_t i = 0; i < payload_size; i++) {
- payload[i] = static_cast(payload_data[i].get());
+ payload[i] = (int)payload_data[i].get();
}
if ((tnf_from_json < TNF_MIN) || (tnf_from_json > TNF_MAX)) {
return LogAndCreateResult(ErrorCode::TYPE_MISMATCH_ERR, "Type mismatch", ("Not supported TNF"));
@@ -531,7 +531,7 @@ PlatformResult NFCMessageUtils::ReportNDEFRecord(const picojson::value& args,
std::unique_ptr data(new unsigned char[size]);
for (ssize_t i = 0; i < size; i++) {
- data[i] = static_cast(raw_data[i].get());
+ data[i] = (int)raw_data[i].get();
}
nfc_ndef_message_h message_handle = NULL;
@@ -900,7 +900,7 @@ PlatformResult NFCMessageUtils::ReportNDEFRecordMedia(const picojson::value& arg
std::unique_ptr data(new unsigned char[size]);
for (ssize_t i = 0; i < size; i++) {
- data[i] = static_cast(raw_data[i].get());
+ data[i] = (int)raw_data[i].get();
}
nfc_ndef_record_h handle = NULL;
diff --git a/src/secureelement/secureelement_instance.cc b/src/secureelement/secureelement_instance.cc
index ac4139a..7313d70 100644
--- a/src/secureelement/secureelement_instance.cc
+++ b/src/secureelement/secureelement_instance.cc
@@ -378,7 +378,7 @@ TizenResult SecureElementInstance::OpenBasicChannel(picojson::object const& args
};
for (size_t i = 0; i < v_aid_size; i++) {
- aid[i] = static_cast(v_aid[i].get());
+ aid[i] = (int)v_aid[i].get();
}
int ret = smartcard_session_open_basic_channel(session, aid, v_aid_size, P2, &channel);
@@ -423,7 +423,7 @@ TizenResult SecureElementInstance::OpenLogicalChannel(picojson::object const& ar
};
for (size_t i = 0; i < v_aid_size; i++) {
- aid[i] = static_cast(v_aid[i].get());
+ aid[i] = (int)v_aid[i].get();
}
int ret = smartcard_session_open_logical_channel(session, aid, v_aid_size, P2, &channel);
@@ -554,7 +554,7 @@ TizenResult SecureElementInstance::Transmit(picojson::object const& args,
};
for (size_t i = 0; i < v_cmd_size; i++) {
- cmd[i] = static_cast(v_cmd[i].get());
+ cmd[i] = (int) v_cmd[i].get();
}
int length = 0;
--
2.7.4
From ef32d62d2e9b62628e4db33dd25c1c903c018213 Mon Sep 17 00:00:00 2001
From: Jakub Skowron
Date: Wed, 7 Feb 2018 15:02:53 +0100
Subject: [PATCH 06/16] [Filesystem] Fix return on error in FileWriteString and
FileWriteBytes
Change-Id: I0377b1a7eaa60a1b5d50c759005d2c6063400332
Signed-off-by: Jakub Skowron
---
src/filesystem/filesystem_instance.cc | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/filesystem/filesystem_instance.cc b/src/filesystem/filesystem_instance.cc
index eaceadc..fbd555f 100644
--- a/src/filesystem/filesystem_instance.cc
+++ b/src/filesystem/filesystem_instance.cc
@@ -397,7 +397,9 @@ void FilesystemInstance::FileWriteString(const picojson::value& args, picojson::
} catch (std::runtime_error& e) {
LoggerE("Cannot write to file %s, cause: %s", location.c_str(), e.what());
PrepareError(FilesystemError::Other, out);
+ return;
}
+
ReportSuccess(out);
}
@@ -421,7 +423,9 @@ void FilesystemInstance::FileWriteBytes(const picojson::value& args, picojson::o
} catch (std::runtime_error& e) {
LoggerE("Cannot write to %s, cause: %s", location.c_str(), e.what());
PrepareError(FilesystemError::Other, out);
+ return;
}
+
ReportSuccess(out);
}
--
2.7.4
From 514c95b53cc0826130cfc10db153fef97373e688 Mon Sep 17 00:00:00 2001
From: Michal Bistyga
Date: Thu, 8 Feb 2018 13:41:42 +0100
Subject: [PATCH 07/16] [Calendar] Fixing multiple bugs in calendar API
3 bugs has been fixed:
1) User couldn't add new calendar to database
1a) Resolved by sending new object, no calendar through JSON
2) Calendar object was not updated with id got from native layer
2a) Resolved by returning id to js layer and...
2b) Changing setting its as result.id, not just a result
3) Every event has been set to calendar with id 0
3a) Resolved by utilizing not used calendarId attribute
[Verification]
verified in chrome console
tct-tests 100% passrate
Change-Id: I5edcf33d8dd753fc044d2b61677439145f4a73d1
Signed-off-by: Michal Bistyga
---
src/calendar/calendar_item.cc | 18 +++++++++++++++---
src/calendar/calendar_manager.cc | 5 ++---
src/calendar/js/calendar_manager.js | 6 ++++--
3 files changed, 21 insertions(+), 8 deletions(-)
diff --git a/src/calendar/calendar_item.cc b/src/calendar/calendar_item.cc
index 6ac5c8c..9bba6c4 100644
--- a/src/calendar/calendar_item.cc
+++ b/src/calendar/calendar_item.cc
@@ -22,6 +22,7 @@
#include
#include "common/converter.h"
#include "common/logger.h"
+#include "common/picojson.h"
using namespace common;
namespace extension {
namespace calendar {
@@ -54,7 +55,7 @@ const PlatformPropertyMap CalendarItem::platform_property_map_ = {
{"id.uid",
{{CALENDAR_BOOK_TYPE_EVENT, _calendar_event.id},
{CALENDAR_BOOK_TYPE_TODO, _calendar_todo.uid}}},
- {"calendar_id",
+ {"calendarId",
{{CALENDAR_BOOK_TYPE_EVENT, _calendar_event.calendar_book_id},
{CALENDAR_BOOK_TYPE_TODO, _calendar_todo.calendar_book_id}}},
{"description",
@@ -377,7 +378,13 @@ PlatformResult CalendarItem::SetInt(int type, calendar_record_h rec, const std::
return PlatformResult(ErrorCode::NO_ERROR);
}
- int value = common::FromJson(in, property.c_str());
+ int value = 0;
+ auto jsonValue = common::FindValue(in, property.c_str());
+ if (jsonValue.is()) {
+ value = common::FromJson(in, property.c_str());
+ } else { // CalendarId is stored in js as string, while native api use int
+ value = common::stol(common::FromJson(in, property.c_str()));
+ }
return SetInt(type, rec, property, value);
}
@@ -1462,6 +1469,11 @@ PlatformResult CalendarItem::FromJson(int type, calendar_record_h rec, const pic
return status;
}
+ status = SetInt(type, rec, "calendarId", in);
+ if (status.IsError()) {
+ return status;
+ }
+
if (type == CALENDAR_BOOK_TYPE_EVENT) {
status = SetEnum(type, rec, "priority", in, kEventPriority);
if (status.IsError()) {
@@ -1552,7 +1564,7 @@ PlatformResult CalendarItem::ToJson(int type, calendar_record_h rec, picojson::o
out["id"] = id_val;
int calendar_id;
- status = GetInt(type, rec, "calendar_id", &calendar_id);
+ status = GetInt(type, rec, "calendarId", &calendar_id);
if (status.IsError()) {
return status;
}
diff --git a/src/calendar/calendar_manager.cc b/src/calendar/calendar_manager.cc
index 4c2edaf..db72589 100644
--- a/src/calendar/calendar_manager.cc
+++ b/src/calendar/calendar_manager.cc
@@ -179,8 +179,6 @@ PlatformResult CalendarManager::AddCalendar(const JsonObject& args, JsonObject&
return LogAndCreateResult(ErrorCode::UNKNOWN_ERR, "DB Connection failed.");
}
- const JsonObject& calendar = FromJson(args, "calendar");
-
calendar_record_h handle = nullptr;
PlatformResult status = CalendarRecord::CreateCalendar(&handle);
if (status.IsError()) {
@@ -189,7 +187,7 @@ PlatformResult CalendarManager::AddCalendar(const JsonObject& args, JsonObject&
CalendarRecordPtr record_ptr = CalendarRecordPtr(handle, CalendarRecord::Deleter);
- status = CalendarRecord::CalendarFromJson(record_ptr.get(), calendar);
+ status = CalendarRecord::CalendarFromJson(record_ptr.get(), args);
if (status.IsError()) {
return status;
}
@@ -200,6 +198,7 @@ PlatformResult CalendarManager::AddCalendar(const JsonObject& args, JsonObject&
if (status.IsError()) {
return status;
}
+ out.insert(std::make_pair("id", picojson::value(std::to_string(record_id))));
return PlatformResult(ErrorCode::NO_ERROR);
}
diff --git a/src/calendar/js/calendar_manager.js b/src/calendar/js/calendar_manager.js
index 37d1652..9f5bcca 100755
--- a/src/calendar/js/calendar_manager.js
+++ b/src/calendar/js/calendar_manager.js
@@ -141,7 +141,9 @@ CalendarManager.prototype.addCalendar = function() {
}]);
var callArgs = {
- calendar: args.calendar
+ name: args.calendar.name,
+ accountId: args.calendar.accountId,
+ type: args.calendar.type
};
var result = native_.callSync('CalendarManager_addCalendar', callArgs);
@@ -151,7 +153,7 @@ CalendarManager.prototype.addCalendar = function() {
}
args.calendar.id = new InternalCalendar({
- id: native_.getResultObject(result)
+ id: native_.getResultObject(result).id
});
};
--
2.7.4
From 1c72703064f683c4c9cf9a30c15838ed2b751769 Mon Sep 17 00:00:00 2001
From: Pawel Wasowski
Date: Mon, 12 Feb 2018 12:14:15 +0100
Subject: [PATCH 08/16] [NFC] Fix memory management problems
This commit prevents crashes, fixing 2 memory management problems:
1. user_data passed to nfc_tag_transceive was deleted twice
2. buffer argument of tagTransceiveCb was deleted inside the function;
according to Native NFC API reference: "buffer will be automatically
destroyed when the callback function returns. (Do not release buffer.)"
[Verification] NFCTag.transceive() function was tested in Chrome
DevTools console and worked fine.
Change-Id: I509c368d817b6663373ba0614af73402f8ad47a6
Signed-off-by: Pawel Wasowski
---
src/nfc/nfc_adapter.cc | 19 ++++++++-----------
src/nfc/nfc_util.cc | 2 +-
2 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/src/nfc/nfc_adapter.cc b/src/nfc/nfc_adapter.cc
index d29aa70..874fa6e 100644
--- a/src/nfc/nfc_adapter.cc
+++ b/src/nfc/nfc_adapter.cc
@@ -1133,8 +1133,6 @@ PlatformResult NFCAdapter::TagWriteNDEF(int tag_id, const picojson::value& args)
static void tagTransceiveCb(nfc_error_e err, unsigned char* buffer, int buffer_size, void* data) {
ScopeLogger();
- std::unique_ptr buffer_ptr(buffer);
- buffer = nullptr;
if (!data) {
// no callback id - unable to report success, neither error
@@ -1161,7 +1159,10 @@ static void tagTransceiveCb(nfc_error_e err, unsigned char* buffer, int buffer_s
picojson::value response = createEventSuccess(callback_id);
picojson::object& response_obj = response.get();
tools::ReportSuccess(response_obj);
- response_obj[JSON_DATA] = picojson::value(NFCUtil::FromUCharArray(buffer_ptr.get(), buffer_size));
+ /* buffer contains response to the sent message
+ * According to the native API reference, it must not be freed
+ */
+ response_obj[JSON_DATA] = picojson::value(NFCUtil::FromUCharArray(buffer, buffer_size));
NFCAdapter::GetInstance()->RespondAsync(response.serialize().c_str());
}
@@ -1188,17 +1189,17 @@ PlatformResult NFCAdapter::TagTransceive(int tag_id, const picojson::value& args
const picojson::array& data_array =
FromJson(args.get(), JSON_DATA);
- unsigned char* buffer = NFCUtil::DoubleArrayToUCharArray(data_array);
+ // this buffer contains the message to be sent; it may be deleted just after nfc_tag_transceive
+ // call
+ std::unique_ptr buffer(NFCUtil::DoubleArrayToUCharArray(data_array));
double* callback_id_pointer = new double(callback_id);
- int ret = nfc_tag_transceive(m_last_tag_handle, buffer, data_array.size(), tagTransceiveCb,
+ int ret = nfc_tag_transceive(m_last_tag_handle, buffer.get(), data_array.size(), tagTransceiveCb,
(void*)callback_id_pointer);
if (NFC_ERROR_NONE != ret) {
delete callback_id_pointer;
callback_id_pointer = nullptr;
- delete[] buffer;
- buffer = nullptr;
// for permission related error throw exception
if (NFC_ERROR_SECURITY_RESTRICTED == ret || NFC_ERROR_PERMISSION_DENIED == ret) {
@@ -1215,10 +1216,6 @@ PlatformResult NFCAdapter::TagTransceive(int tag_id, const picojson::value& args
picojson::value event = CreateEventError(callback_id, result);
NFCAdapter::GetInstance()->RespondAsync(event.serialize().c_str());
}
- delete callback_id_pointer;
- callback_id_pointer = nullptr;
- delete[] buffer;
- buffer = nullptr;
return PlatformResult(ErrorCode::NO_ERROR);
}
diff --git a/src/nfc/nfc_util.cc b/src/nfc/nfc_util.cc
index 8a5928f..fcfb13e 100644
--- a/src/nfc/nfc_util.cc
+++ b/src/nfc/nfc_util.cc
@@ -336,7 +336,7 @@ unsigned char* NFCUtil::DoubleArrayToUCharArray(const picojson::array& array_in)
ScopeLogger();
unsigned char* result_array = new unsigned char[array_in.size()];
for (std::size_t i = 0; i < array_in.size(); ++i) {
- result_array[i] = (int) array_in.at(i).get();
+ result_array[i] = (int)array_in.at(i).get();
}
return result_array;
}
--
2.7.4
From 02b9ee041cf7bc7fc4fd3771866b6dd98ead45f0 Mon Sep 17 00:00:00 2001
From: Piotr Kosko
Date: Mon, 26 Feb 2018 10:33:00 +0100
Subject: [PATCH 09/16] [version] 2.17
Change-Id: I3bf56e2b79bff86daefb7b9c3c8d53b41d5ac22c
Signed-off-by: Piotr Kosko
---
packaging/webapi-plugins.spec | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packaging/webapi-plugins.spec b/packaging/webapi-plugins.spec
index f3b3345..22baca9 100644
--- a/packaging/webapi-plugins.spec
+++ b/packaging/webapi-plugins.spec
@@ -10,7 +10,7 @@
%define crosswalk_extensions_path %{_libdir}/%{crosswalk_extensions}
Name: webapi-plugins
-Version: 2.16
+Version: 2.17
Release: 0
License: Apache-2.0 and BSD-3-Clause and MIT
Group: Development/Libraries
--
2.7.4
From 0a888a1f9d98fac52b9f94c3b321620de4b77f76 Mon Sep 17 00:00:00 2001
From: Pawel Kaczmarczyk
Date: Mon, 19 Mar 2018 15:45:33 +0100
Subject: [PATCH 10/16] [Systeminfo] Fix for incorrect USB storage capacity
USB_DEVICE has not been reporting correct capacity values
on TV profile. It was caused by different way of handling
reading storage properties.
[Fix]
Each storage type is treated in the same way when
getting information about storage's space.
[Verification] Tested in Chromium cosole
tct-systeminfo-tizen-tests passrate: 100%
tct-filesystem-tizen-tests passrate: 100%
Change-Id: I1d2a8a40a2cac18d5961a301bdd3e586cc3eedad
Signed-off-by: Pawel Kaczmarczyk
---
.../filesystem/filesystem_provider_deviced.cc | 7 +--
.../filesystem/filesystem_provider_deviced.h | 1 -
.../filesystem/filesystem_provider_storage.cc | 2 +-
src/common/filesystem/filesystem_storage.cc | 3 +-
src/common/filesystem/filesystem_storage.h | 7 ++-
src/systeminfo/systeminfo_manager.cc | 44 ++++++++-----------
src/systeminfo/systeminfo_manager.h | 11 ++---
src/systeminfo/systeminfo_properties_manager.cc | 51 ++++++++++++----------
8 files changed, 57 insertions(+), 69 deletions(-)
diff --git a/src/common/filesystem/filesystem_provider_deviced.cc b/src/common/filesystem/filesystem_provider_deviced.cc
index 2ce1ab4..cb33bd7 100644
--- a/src/common/filesystem/filesystem_provider_deviced.cc
+++ b/src/common/filesystem/filesystem_provider_deviced.cc
@@ -194,7 +194,7 @@ void FilesystemProviderDeviced::UnregisterDeviceChangeState() {
std::shared_ptr FilesystemProviderDeviced::GetStorage(const DeviceListElem& elem) {
ScopeLogger();
- return std::make_shared(GetIdFromUUID(elem.fs_uuid_enc),
+ return std::make_shared(elem.storage_id,
(elem.block_type ? StorageType::kMmc : StorageType::kUsbDevice),
(elem.state ? StorageState::kMounted : StorageState::kUnmounted),
elem.mount_point, GetNameFromPath(elem.devnode));
@@ -214,11 +214,6 @@ std::string FilesystemProviderDeviced::GetNameFromPath(const char* const char_pa
return name;
}
-int FilesystemProviderDeviced::GetIdFromUUID(const char* const char_uuid) {
- ScopeLogger();
- return (int)std::hash()(std::string(char_uuid));
-}
-
Storages FilesystemProviderDeviced::GetStorages() {
ScopeLogger();
if (!is_initialized_) {
diff --git a/src/common/filesystem/filesystem_provider_deviced.h b/src/common/filesystem/filesystem_provider_deviced.h
index 2c47aa6..65746b8 100644
--- a/src/common/filesystem/filesystem_provider_deviced.h
+++ b/src/common/filesystem/filesystem_provider_deviced.h
@@ -54,7 +54,6 @@ class FilesystemProviderDeviced : public IFilesystemProvider {
void BlockSignalCallback(DeviceListElem elem);
static std::string GetNameFromPath(const char* const char_path);
- static int GetIdFromUUID(const char* const char_uuid);
static std::shared_ptr GetStorage(const DeviceListElem& elem);
static std::shared_ptr GetStorageUsb(const UsbListElem& elem);
static Storages GetStoragesFromGVariant(GVariant* variant);
diff --git a/src/common/filesystem/filesystem_provider_storage.cc b/src/common/filesystem/filesystem_provider_storage.cc
index a82e630..2a8116c 100644
--- a/src/common/filesystem/filesystem_provider_storage.cc
+++ b/src/common/filesystem/filesystem_provider_storage.cc
@@ -70,7 +70,7 @@ void OnStorageChange(int storage_id, storage_state_e state, void* user_data) {
FilesystemProviderStorage* provider = static_cast(user_data);
for (auto& storage : provider->GetStorages()) {
- if (storage->id_ == storage_id) {
+ if (storage->id() == storage_id) {
StorageState previous_state = storage->state_;
storage->state_ = TranslateCoreStorageState(state);
if (provider->GetListener()) {
diff --git a/src/common/filesystem/filesystem_storage.cc b/src/common/filesystem/filesystem_storage.cc
index 0efc186..a321cbc 100644
--- a/src/common/filesystem/filesystem_storage.cc
+++ b/src/common/filesystem/filesystem_storage.cc
@@ -70,9 +70,8 @@ picojson::value Storage::ToJson() const {
return value;
}
-Storage::Storage(Storage const& other) : VirtualRoot(other) {
+Storage::Storage(Storage const& other) : VirtualRoot(other), id_(other.id_) {
ScopeLogger();
- this->id_ = other.id_;
}
VirtualRoot::VirtualRoot(VirtualRoot const& other) {
diff --git a/src/common/filesystem/filesystem_storage.h b/src/common/filesystem/filesystem_storage.h
index 9628977..8ff7828 100644
--- a/src/common/filesystem/filesystem_storage.h
+++ b/src/common/filesystem/filesystem_storage.h
@@ -75,9 +75,12 @@ class Storage : public VirtualRoot {
Storage(int id, StorageType type, StorageState state, std::string const& path = "",
std::string const& name = "");
Storage(Storage const& other);
-
- int id_;
virtual picojson::value ToJson() const;
+ int id() const {
+ return id_;
+ }
+ private:
+ int id_;
};
} // namespace common
diff --git a/src/systeminfo/systeminfo_manager.cc b/src/systeminfo/systeminfo_manager.cc
index 147b884..f7afef0 100644
--- a/src/systeminfo/systeminfo_manager.cc
+++ b/src/systeminfo/systeminfo_manager.cc
@@ -16,6 +16,7 @@
#include "systeminfo/systeminfo_manager.h"
+#include
#include
#include
#include
@@ -142,12 +143,6 @@ static gboolean OnStorageChangedCb(gpointer event_ptr) {
return G_SOURCE_CONTINUE;
}
-static void OnMmcChangedCb(keynode_t* node, void* event_ptr) {
- ScopeLogger();
- SysteminfoManager* manager = static_cast(event_ptr);
- manager->CallListenerCallback(kPropertyIdStorage);
-}
-
static void OnDisplayChangedCb(keynode_t* node, void* event_ptr) {
ScopeLogger();
SysteminfoManager* manager = static_cast(event_ptr);
@@ -454,10 +449,6 @@ SysteminfoManager::SysteminfoManager(SysteminfoInstance* instance)
wifi_manager_(nullptr),
cpu_load_(0),
last_cpu_load_(0),
- available_capacity_internal_(0),
- last_available_capacity_internal_(0),
- available_capacity_mmc_(0),
- last_available_capacity_mmc_(0),
tapi_manager_(new TapiManager()),
cpu_event_id_(0),
storage_event_id_(0),
@@ -986,8 +977,6 @@ PlatformResult SysteminfoManager::UnregisterCpuListener() {
PlatformResult SysteminfoManager::RegisterStorageListener() {
ScopeLogger();
PlatformResult ret = PlatformResult(ErrorCode::NO_ERROR);
- CHECK_LISTENER_ERROR(
- SysteminfoUtils::RegisterVconfCallback(VCONFKEY_SYSMAN_MMC_STATUS, OnMmcChangedCb, this))
storage_event_id_ =
g_timeout_add_seconds(kPropertyWatcherTime, OnStorageChangedCb, static_cast(this));
@@ -998,8 +987,6 @@ PlatformResult SysteminfoManager::RegisterStorageListener() {
PlatformResult SysteminfoManager::UnregisterStorageListener() {
ScopeLogger();
PlatformResult ret = PlatformResult(ErrorCode::NO_ERROR);
- CHECK_LISTENER_ERROR(
- SysteminfoUtils::UnregisterVconfCallback(VCONFKEY_SYSMAN_MMC_STATUS, OnMmcChangedCb))
g_source_remove(storage_event_id_);
storage_event_id_ = 0;
@@ -1438,14 +1425,22 @@ void SysteminfoManager::SetCpuInfoLoad(double load) {
cpu_load_ = load;
}
-void SysteminfoManager::SetAvailableCapacityInternal(unsigned long long capacity) {
+void SysteminfoManager::RemoveUnmounted(const std::vector& currently_mounted) {
ScopeLogger();
- available_capacity_internal_ = capacity;
+ for (auto it = available_capacity_map_.begin(); it != available_capacity_map_.end();) {
+ int storage_id = it->first;
+ if (std::find(currently_mounted.begin(), currently_mounted.end(), storage_id) ==
+ currently_mounted.end()) {
+ it = available_capacity_map_.erase(it);
+ } else {
+ it++;
+ }
+ }
}
-void SysteminfoManager::SetAvailableCapacityMmc(unsigned long long capacity) {
+void SysteminfoManager::SetAvailableCapacity(int id, unsigned long long capacity) {
ScopeLogger();
- available_capacity_mmc_ = capacity;
+ available_capacity_map_[id] = capacity;
}
int SysteminfoManager::GetChangedTapiIndex(TapiHandle* tapi) {
@@ -1584,17 +1579,12 @@ void SysteminfoManager::CallStorageListenerCallback() {
picojson::value result = picojson::value(picojson::object());
PlatformResult ret = GetPropertiesManager().GetPropertyValue(property_id, true, &result);
if (ret.IsSuccess()) {
- // check if anything changed
- if (available_capacity_internal_ == last_available_capacity_internal_ &&
- available_capacity_mmc_ == last_available_capacity_mmc_) {
+ if (available_capacity_map_ != last_available_capacity_map_) {
+ last_available_capacity_map_ = available_capacity_map_;
+ PostListenerResponse(property_id, result);
+ } else {
LoggerD("Storage state didn't change, ignoring");
- return;
}
- // refresh previous values
- last_available_capacity_internal_ = available_capacity_internal_;
- last_available_capacity_mmc_ = available_capacity_mmc_;
-
- PostListenerResponse(property_id, result);
}
} else {
LoggerD("listener for %s property is not registered, ignoring", property_id.c_str());
diff --git a/src/systeminfo/systeminfo_manager.h b/src/systeminfo/systeminfo_manager.h
index 12bfff2..5650b4a 100644
--- a/src/systeminfo/systeminfo_manager.h
+++ b/src/systeminfo/systeminfo_manager.h
@@ -75,8 +75,8 @@ class SysteminfoManager {
};
void SetCpuInfoLoad(double load);
- void SetAvailableCapacityInternal(unsigned long long capacity);
- void SetAvailableCapacityMmc(unsigned long long capacity);
+ void RemoveUnmounted(const std::vector& currentlyMounted);
+ void SetAvailableCapacity(int id, unsigned long long capacity);
std::string GetCameraTypes(unsigned int index);
unsigned int GetCameraTypesCount();
@@ -139,11 +139,8 @@ class SysteminfoManager {
double cpu_load_;
double last_cpu_load_;
- unsigned long long available_capacity_internal_;
- unsigned long long last_available_capacity_internal_;
- unsigned long long available_capacity_mmc_;
- unsigned long long last_available_capacity_mmc_;
-
+ std::map last_available_capacity_map_;
+ std::map available_capacity_map_;
std::unique_ptr tapi_manager_;
std::set registered_listeners_;
diff --git a/src/systeminfo/systeminfo_properties_manager.cc b/src/systeminfo/systeminfo_properties_manager.cc
index 1868a24..ce87eac 100644
--- a/src/systeminfo/systeminfo_properties_manager.cc
+++ b/src/systeminfo/systeminfo_properties_manager.cc
@@ -1122,16 +1122,13 @@ PlatformResult SysteminfoPropertiesManager::ReportMemory(picojson::object* out)
return PlatformResult(ErrorCode::NO_ERROR);
}
-static void CreateStorageInfo(const std::string& type, struct statvfs& fs, picojson::object* out) {
+static void CreateStorageInfo(const std::string& type, unsigned long long total_space,
+ unsigned long long available_space, picojson::object* out) {
ScopeLogger();
out->insert(std::make_pair("type", picojson::value(type)));
- out->insert(std::make_pair(
- "capacity", picojson::value(std::to_string(static_cast(fs.f_frsize) *
- static_cast(fs.f_blocks)))));
- out->insert(std::make_pair(
- "availableCapacity",
- picojson::value(std::to_string(static_cast(fs.f_bsize) *
- static_cast(fs.f_bavail)))));
+ out->insert(std::make_pair("capacity", picojson::value(std::to_string(total_space))));
+ out->insert(
+ std::make_pair("availableCapacity", picojson::value(std::to_string(available_space))));
bool isRemovable = (type == kTypeInternal) ? false : true;
out->insert(std::make_pair("isRemovable", picojson::value(isRemovable)));
}
@@ -1153,10 +1150,10 @@ static std::string FromStorageTypeToStringType(common::StorageType type) {
PlatformResult SysteminfoPropertiesManager::ReportStorage(picojson::object* out) {
ScopeLogger();
- struct statvfs fs;
picojson::value result = picojson::value(picojson::array());
picojson::array& array = result.get();
+ std::vector found_storages_ids;
// handling storages from provider
common::FilesystemProvider& provider(common::FilesystemProvider::Create());
@@ -1164,27 +1161,35 @@ PlatformResult SysteminfoPropertiesManager::ReportStorage(picojson::object* out)
LoggerD("Storages found %d", storages.size());
for (auto storage : storages) {
if (storage->state() == common::StorageState::kMounted) {
- // TODO change implementation to support all types of storages and not limited number
- if (common::StorageType::kInternal == storage->type()) {
- if (storage_get_internal_memory_size(&fs) < 0) {
- LoggerE("Storage unit %s not detected", storage->name().c_str());
- return PlatformResult(ErrorCode::UNKNOWN_ERR, "There are no storage units detected");
- }
- manager_.SetAvailableCapacityInternal(fs.f_bavail);
- } else if (common::StorageType::kMmc == storage->type()) {
- if (storage_get_external_memory_size(&fs) < 0) {
- LoggerE("Storage unit %s not detected", storage->name().c_str());
- return PlatformResult(ErrorCode::UNKNOWN_ERR, "MMC mounted, but not accessible");
- }
- manager_.SetAvailableCapacityMmc(fs.f_bavail);
+ unsigned long long available;
+ unsigned long long total_capacity;
+
+ int err;
+ err = storage_get_available_space(storage->id(), &available);
+ if (STORAGE_ERROR_NONE != err) {
+ LoggerE("Could not get available space for storage: %s, error code: %d",
+ storage->name().c_str(), err);
+ return PlatformResult(ErrorCode::UNKNOWN_ERR, "Could not get storage available space");
+ }
+
+ err = storage_get_total_space(storage->id(), &total_capacity);
+ if (STORAGE_ERROR_NONE != err) {
+ LoggerE("Could not get total space for storage: %s, error code: %d",
+ storage->name().c_str(), err);
+ return PlatformResult(ErrorCode::UNKNOWN_ERR, "Could not get storage total space");
}
+ found_storages_ids.push_back(storage->id());
+ manager_.SetAvailableCapacity(storage->id(), available);
+
array.push_back(picojson::value(picojson::object()));
picojson::object& external_obj = array.back().get();
- CreateStorageInfo(FromStorageTypeToStringType(storage->type()), fs, &external_obj);
+ CreateStorageInfo(FromStorageTypeToStringType(storage->type()), total_capacity, available,
+ &external_obj);
}
}
+ manager_.RemoveUnmounted(found_storages_ids);
out->insert(std::make_pair("storages", picojson::value(result)));
return PlatformResult(ErrorCode::NO_ERROR);
}
--
2.7.4
From 9a93036c33ec14f521c52e9a42eed6db488c79c6 Mon Sep 17 00:00:00 2001
From: Rafal Walczyna
Date: Fri, 23 Mar 2018 11:05:05 +0100
Subject: [PATCH 11/16] [NFC] Fix isActivatedHandlerFunctions return values
Functions IsActivatedHandlerForCategory and IsActivatedHandlerForAID
always return false. After fix they work properly.
TCT tests needs fixing, after fix there will be 100% passrate.
Tested on TW1 tizen3.0
Change-Id: I9a4833d4073e512e9414e63325515ebfa8d6b8a4
Signed-off-by: Rafal Walczyna
---
src/nfc/nfc_adapter.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/nfc/nfc_adapter.cc b/src/nfc/nfc_adapter.cc
index 874fa6e..3a6f9eb 100644
--- a/src/nfc/nfc_adapter.cc
+++ b/src/nfc/nfc_adapter.cc
@@ -1385,7 +1385,7 @@ PlatformResult NFCAdapter::IsActivatedHandlerForAID(const std::string& type, con
nfc_se_type_e se_type;
PlatformResult result = NFCUtil::ToSecureElementType(type, &se_type);
- if (!result.IsError()) {
+ if (result.IsError()) {
LoggerE("Error: %s", result.message().c_str());
return result;
}
@@ -1406,7 +1406,7 @@ PlatformResult NFCAdapter::IsActivatedHandlerForCategory(
nfc_se_type_e se_type;
PlatformResult result = NFCUtil::ToSecureElementType(type, &se_type);
- if (!result.IsError()) {
+ if (result.IsError()) {
LoggerE("Error: %s", result.message().c_str());
return result;
}
--
2.7.4
From 332d39f94f6adf7fd894d0cd52a871628a3ae2f9 Mon Sep 17 00:00:00 2001
From: Piotr Kosko
Date: Fri, 23 Mar 2018 12:10:31 +0100
Subject: [PATCH 12/16] [version] 2.18
Change-Id: I171c24fc4170a519fef7fde45b4e223843cf33c0
---
packaging/webapi-plugins.spec | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packaging/webapi-plugins.spec b/packaging/webapi-plugins.spec
index 22baca9..1f08c55 100644
--- a/packaging/webapi-plugins.spec
+++ b/packaging/webapi-plugins.spec
@@ -10,7 +10,7 @@
%define crosswalk_extensions_path %{_libdir}/%{crosswalk_extensions}
Name: webapi-plugins
-Version: 2.17
+Version: 2.18
Release: 0
License: Apache-2.0 and BSD-3-Clause and MIT
Group: Development/Libraries
--
2.7.4
From 447e8ff4934d2c0c87b3c1d1bc82152a15aa9337 Mon Sep 17 00:00:00 2001
From: Lukasz Wojciechowski
Date: Sat, 10 Mar 2018 03:25:34 +0100
Subject: [PATCH 13/16] [Push] Prefix string type with namespace std
The patch fixes build break in Tizen:4.0:Unified.
The string type without std::string is not recognized by compiler.
Change-Id: I048bad0a1d71cb841965a84b2d11d2afb9c19eea
Signed-off-by: Lukasz Wojciechowski
(cherry picked from commit a2c7a32a5fbc41e6bf20c891797c786e946628c9)
---
src/push/push_manager_common.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/push/push_manager_common.cc b/src/push/push_manager_common.cc
index 406eb4c..c307e95 100644
--- a/src/push/push_manager_common.cc
+++ b/src/push/push_manager_common.cc
@@ -93,8 +93,8 @@ void PushManagerCommon::notificationToJson(push_service_notification_h noti,
// parse query string and find value for alertMessage
pcrecpp::StringPiece input(fullMessage);
pcrecpp::RE re("([^=]+)=([^&]*)&?");
- string key;
- string value;
+ std::string key;
+ std::string value;
while (re.Consume(&input, &key, &value)) {
if (key == "alertMessage") {
(*obj)["alertMessage"] = picojson::value(value);
--
2.7.4
From 398a65abe664ff9505250d87f7aa820b902bd32c Mon Sep 17 00:00:00 2001
From: Rafal Walczyna
Date: Tue, 27 Mar 2018 13:55:44 +0200
Subject: [PATCH 14/16] [common] Fixing coverity issues
Issues: 110672, 108789, 108137, 107617,
106435, 112265, 112254, 107669, 105923
[Verification] 100% passrate in:
bookmark, calendar, contact, content, datacontrol,
filesystem, keymanager
Change-Id: Id667a94fe653f831a8cfdd70813c8ace91e1cf5d
Signed-off-by: Rafal Walczyna
---
src/bookmark/bookmark_instance.cc | 6 +++++-
src/calendar/calendar_manager.cc | 2 +-
src/contact/contact_manager.cc | 18 +++++++++++++++---
src/contact/person.cc | 6 +++++-
src/content/content_manager.cc | 5 ++++-
src/datacontrol/datacontrol_instance.cc | 8 ++------
src/filesystem/filesystem_manager.cc | 1 +
src/keymanager/keymanager_instance.cc | 8 ++++++--
8 files changed, 39 insertions(+), 15 deletions(-)
diff --git a/src/bookmark/bookmark_instance.cc b/src/bookmark/bookmark_instance.cc
index 884dba1..145d6b4 100644
--- a/src/bookmark/bookmark_instance.cc
+++ b/src/bookmark/bookmark_instance.cc
@@ -70,7 +70,11 @@ bool BookmarkInstance::bookmark_foreach(Context& ctx, bp_bookmark_info_fmt& info
if (ids_count > 0) {
for (int i = 0; i < ids_count; i++) {
- bp_bookmark_adaptor_get_easy_all(ids[i], &info);
+ if (bp_bookmark_adaptor_get_easy_all(ids[i], &info) < 0) {
+ int errorcode = bp_bookmark_adaptor_get_errorcode();
+ LoggerW("bp_bookmark_adaptor_get_easy_all for id %d returns error: %d", ids[i], errorcode);
+ continue;
+ }
item.id = ids[i];
item.bookmark_info = info;
if ((ctx.shouldGetItems && item.bookmark_info.parent != ctx.id) ||
diff --git a/src/calendar/calendar_manager.cc b/src/calendar/calendar_manager.cc
index db72589..1606635 100644
--- a/src/calendar/calendar_manager.cc
+++ b/src/calendar/calendar_manager.cc
@@ -36,7 +36,7 @@ const int kUnifiedCalendardId = 0;
using namespace common;
-CalendarManager::CalendarManager() {
+CalendarManager::CalendarManager() : is_connected_(false) {
ScopeLogger();
if (CALENDAR_ERROR_NONE == calendar_connect()) {
LoggerD("Calendar DB connected");
diff --git a/src/contact/contact_manager.cc b/src/contact/contact_manager.cc
index 6fe6b98..7730068 100644
--- a/src/contact/contact_manager.cc
+++ b/src/contact/contact_manager.cc
@@ -106,7 +106,11 @@ PlatformResult ContactManagerGetAddressBooks(const JsonObject& args, JsonArray&
single_obj["readOnly"] = JsonValue(CONTACTS_ADDRESS_BOOK_MODE_READONLY == mode);
out.push_back(single);
- contacts_list_next(*contacts_list_ptr);
+ error_code = contacts_list_next(*contacts_list_ptr);
+ if (CONTACTS_ERROR_NONE != error_code) {
+ LoggerW("contacts_list_next() failed: %d, ignoring remaining contacts", error_code);
+ break;
+ }
}
return PlatformResult(ErrorCode::NO_ERROR);
@@ -771,7 +775,11 @@ PlatformResult ContactManagerFind(const JsonObject& args, JsonArray& out) {
out.push_back(JsonValue(obj));
- contacts_list_next(person_list);
+ error_code = contacts_list_next(person_list);
+ if (CONTACTS_ERROR_NONE != error_code) {
+ LoggerW("contacts_list_next() failed: %d, ignoring remaining contacts", error_code);
+ break;
+ }
}
return PlatformResult(ErrorCode::NO_ERROR);
@@ -954,7 +962,11 @@ PlatformResult ContactManagerFindByUsageCount(const JsonObject& args, JsonArray&
out.push_back(JsonValue(obj));
- contacts_list_next(person_list);
+ error_code = contacts_list_next(person_list);
+ if (CONTACTS_ERROR_NONE != error_code) {
+ LoggerW("contacts_list_next() failed: %d, ignoring remaining contacts", error_code);
+ break;
+ }
}
return PlatformResult(ErrorCode::NO_ERROR);
diff --git a/src/contact/person.cc b/src/contact/person.cc
index 909d221..136407e 100644
--- a/src/contact/person.cc
+++ b/src/contact/person.cc
@@ -246,7 +246,11 @@ PlatformResult GetUsageCount(const JsonObject& args, JsonObject& out) {
usage_count += usage_count_tmp;
- contacts_list_next(list);
+ ret = contacts_list_next(list);
+ if (CONTACTS_ERROR_NONE != ret) {
+ LoggerW("contacts_list_next() failed: %d, ignoring remaining contacts", ret);
+ break;
+ }
}
out.insert(
diff --git a/src/content/content_manager.cc b/src/content/content_manager.cc
index ab88887..edd86d5 100644
--- a/src/content/content_manager.cc
+++ b/src/content/content_manager.cc
@@ -1383,7 +1383,10 @@ int ContentManager::getLyrics(const picojson::value& args, picojson::object& res
}
metadata_extractor_h extractor;
- metadata_extractor_create(&extractor);
+ ret = metadata_extractor_create(&extractor);
+ if (METADATA_EXTRACTOR_ERROR_NONE != ret) {
+ LOGGER(ERROR) << "metadata_extractor_create failed, error: " << ret;
+ }
std::unique_ptr::type, int (*)(metadata_extractor_h)>
extractor_ptr(extractor, &metadata_extractor_destroy); // automatically release the memory
diff --git a/src/datacontrol/datacontrol_instance.cc b/src/datacontrol/datacontrol_instance.cc
index 97c3720..00a41e3 100644
--- a/src/datacontrol/datacontrol_instance.cc
+++ b/src/datacontrol/datacontrol_instance.cc
@@ -413,9 +413,7 @@ int DatacontrolInstance::RunMAPDataControlJob(const std::string& providerId,
result = job(handle, &info->requestId);
RETURN_IF_FAIL(result, "Doing job failed with error");
- IdMap[info->requestId] = info.get();
-
- info.release();
+ IdMap[info->requestId] = info.release();
return result;
}
@@ -448,9 +446,7 @@ int DatacontrolInstance::RunSQLDataControlJob(const std::string& providerId,
result = job(handle, &info->requestId);
RETURN_IF_FAIL(result, "Doing job failed with error");
- IdMap[info->requestId] = info.get();
-
- info.release();
+ IdMap[info->requestId] = info.release();
return result;
}
diff --git a/src/filesystem/filesystem_manager.cc b/src/filesystem/filesystem_manager.cc
index e6b373d..5050a0a 100644
--- a/src/filesystem/filesystem_manager.cc
+++ b/src/filesystem/filesystem_manager.cc
@@ -460,6 +460,7 @@ void FilesystemManager::GetCanonicalPath(const std::string& path,
LoggerE("Cannot get realpath of %s. Error: %s!", path.c_str(),
GetErrorString(tmpErrno).c_str());
error_cb(FilesystemError::Other);
+ return;
}
std::string canonicalPathStr(canonicalPath);
diff --git a/src/keymanager/keymanager_instance.cc b/src/keymanager/keymanager_instance.cc
index 0e05512..cc85aad 100644
--- a/src/keymanager/keymanager_instance.cc
+++ b/src/keymanager/keymanager_instance.cc
@@ -64,9 +64,13 @@ void GetGenericAliasList(AliasListFunction func, picojson::object* out) {
if (head->alias) {
char* saveptr = nullptr;
char* tokenized = strtok_r(head->alias, kSpace.c_str(), &saveptr);
- obj["packageId"] = picojson::value(tokenized);
+ if (nullptr != tokenized) {
+ obj["packageId"] = picojson::value(tokenized);
+ }
tokenized = strtok_r(nullptr, kSpace.c_str(), &saveptr);
- obj["name"] = picojson::value(tokenized);
+ if (nullptr != tokenized) {
+ obj["name"] = picojson::value(tokenized);
+ }
aliases.push_back(resultElem);
}
--
2.7.4
From d8332a3d7c8b9d6c64b3a016fd6aa9b331a28a7b Mon Sep 17 00:00:00 2001
From: Piotr Kosko
Date: Tue, 27 Mar 2018 14:59:02 +0200
Subject: [PATCH 15/16] [common] Coverity issues fix
[Feature] Fixed coverity issues with below ids:
110914, 110006, 108656, 107626, 107387,
107077, 106006, 108993, 108297, 106912
Additionally fixed potential crash in download API -
in case of native function failure, the "success" response
is not trying to be build.
[Verification] 100% passrate for modules:
application, bluetooth, download, exif, filesystem, messaging-*
Change-Id: I8d9482501a7375962408186feaa5ecd1f0826b1d
Signed-off-by: Piotr Kosko
---
src/application/application_manager.cc | 37 +++++++++++-----
src/bluetooth/bluetooth_gatt_service.cc | 2 +-
src/bluetooth/bluetooth_health_channel.cc | 2 +-
src/bluetooth/bluetooth_socket.cc | 2 +-
src/common/filesystem/filesystem_storage.h | 1 +
src/download/download_instance.cc | 27 +++++++++---
src/exif/exif_instance.cc | 1 +
src/exif/jpeg_file.cc | 4 +-
src/messaging/email_manager.cc | 67 ++++++++---------------------
src/messaging/message.cc | 12 ++++--
src/messaging/messaging_manager.cc | 3 +-
src/secureelement/secureelement_instance.cc | 2 +-
12 files changed, 84 insertions(+), 76 deletions(-)
diff --git a/src/application/application_manager.cc b/src/application/application_manager.cc
index 8744c0c..821f0fd 100644
--- a/src/application/application_manager.cc
+++ b/src/application/application_manager.cc
@@ -1385,20 +1385,37 @@ void ApplicationManager::StartAppInfoEventListener(picojson::object* out) {
return;
}
+#define CHECK_APPLICATION_EVENT_ERROR(result, function_name) \
+ if (PKGMGR_R_OK > result) { \
+ StopAppInfoEventListener(); \
+ LogAndReportError( \
+ PlatformResult(ErrorCode::UNKNOWN_ERR, "Failed to register listener."), out, \
+ ("Function %s failed: %s (%d)", function_name, get_error_message(result), result)); \
+ return; \
+ }
+
g_application_list_changed_broker.AddApplicationInstance(&instance_);
- pkgmgr_client_set_status_type(pkgmgr_client_handle_, PACKAGE_MANAGER_STATUS_TYPE_INSTALL |
- PACKAGE_MANAGER_STATUS_TYPE_UPGRADE);
- pkgmgr_client_set_status_type(pkgmgr_client_uninstall_handle_,
- PACKAGE_MANAGER_STATUS_TYPE_UNINSTALL);
+ int result = pkgmgr_client_set_status_type(
+ pkgmgr_client_handle_,
+ PACKAGE_MANAGER_STATUS_TYPE_INSTALL | PACKAGE_MANAGER_STATUS_TYPE_UPGRADE);
+ CHECK_APPLICATION_EVENT_ERROR(result, "pkgmgr_client_set_status_type")
+
+ result = pkgmgr_client_set_status_type(pkgmgr_client_uninstall_handle_,
+ PACKAGE_MANAGER_STATUS_TYPE_UNINSTALL);
+ CHECK_APPLICATION_EVENT_ERROR(result, "pkgmgr_client_set_status_type")
+
+ result = pkgmgr_client_listen_status(pkgmgr_client_handle_,
+ ApplicationListChangedBroker::ClientStatusListener,
+ &g_application_list_changed_broker);
+ CHECK_APPLICATION_EVENT_ERROR(result, "pkgmgr_client_listen_status")
- pkgmgr_client_listen_status(pkgmgr_client_handle_,
- ApplicationListChangedBroker::ClientStatusListener,
- &g_application_list_changed_broker);
- pkgmgr_client_listen_status(pkgmgr_client_uninstall_handle_,
- ApplicationListChangedBroker::AppUninstallListener,
- &g_application_list_changed_broker);
+ result = pkgmgr_client_listen_status(pkgmgr_client_uninstall_handle_,
+ ApplicationListChangedBroker::AppUninstallListener,
+ &g_application_list_changed_broker);
+ CHECK_APPLICATION_EVENT_ERROR(result, "pkgmgr_client_listen_status")
+#undef CHECK_APPLICATION_EVENT_ERROR
} else {
LoggerD("Broker callback is already registered.");
}
diff --git a/src/bluetooth/bluetooth_gatt_service.cc b/src/bluetooth/bluetooth_gatt_service.cc
index f6798a8..1200a7b 100644
--- a/src/bluetooth/bluetooth_gatt_service.cc
+++ b/src/bluetooth/bluetooth_gatt_service.cc
@@ -424,7 +424,7 @@ void BluetoothGATTService::WriteValue(const picojson::value& args, picojson::obj
int value_size = value_array.size();
std::unique_ptr value_data(new char[value_size]);
for (int i = 0; i < value_size; ++i) {
- value_data[i] = (int) value_array[i].get();
+ value_data[i] = (int)value_array[i].get();
}
struct Data {
diff --git a/src/bluetooth/bluetooth_health_channel.cc b/src/bluetooth/bluetooth_health_channel.cc
index e119693..90d805d 100644
--- a/src/bluetooth/bluetooth_health_channel.cc
+++ b/src/bluetooth/bluetooth_health_channel.cc
@@ -77,7 +77,7 @@ void BluetoothHealthChannel::SendData(const picojson::value& data, picojson::obj
std::unique_ptr data_ptr{new char[data_size]};
for (std::size_t i = 0; i < data_size; ++i) {
- data_ptr[i] = (int) binary_data[i].get();
+ data_ptr[i] = (int)binary_data[i].get();
}
int ntv_ret = bt_hdp_send_data(channel, data_ptr.get(), data_size);
diff --git a/src/bluetooth/bluetooth_socket.cc b/src/bluetooth/bluetooth_socket.cc
index fea9ed1..a044a37 100644
--- a/src/bluetooth/bluetooth_socket.cc
+++ b/src/bluetooth/bluetooth_socket.cc
@@ -63,7 +63,7 @@ void BluetoothSocket::WriteData(const picojson::value& data, picojson::object& o
std::unique_ptr data_ptr{new char[data_size]};
for (std::size_t i = 0; i < data_size; ++i) {
- data_ptr[i] = (int) binary_data[i].get();
+ data_ptr[i] = (int)binary_data[i].get();
}
if (kBluetoothError == bt_socket_send_data(socket, data_ptr.get(), data_size)) {
diff --git a/src/common/filesystem/filesystem_storage.h b/src/common/filesystem/filesystem_storage.h
index 8ff7828..fd5dc17 100644
--- a/src/common/filesystem/filesystem_storage.h
+++ b/src/common/filesystem/filesystem_storage.h
@@ -79,6 +79,7 @@ class Storage : public VirtualRoot {
int id() const {
return id_;
}
+
private:
int id_;
};
diff --git a/src/download/download_instance.cc b/src/download/download_instance.cc
index fda4c57..4e1fa39 100644
--- a/src/download/download_instance.cc
+++ b/src/download/download_instance.cc
@@ -314,12 +314,11 @@ gboolean DownloadInstance::OnFinished(void* user_data) {
LoggerW("%s", get_error_message(ret));
}
out["status"] = picojson::value("completed");
+ out["fullPath"] =
+ picojson::value(common::FilesystemProvider::Create().GetVirtualPath(fullPath));
}
-
out["callbackId"] = picojson::value(static_cast(callback_id));
- out["fullPath"] = picojson::value(common::FilesystemProvider::Create().GetVirtualPath(fullPath));
-
Instance::PostMessage(downCbPtr->instance, picojson::value(out).serialize().c_str());
// downCbPtr is freed in destructor, it prevent from crash if OnFinished state
// was called after OnCanceled or OnFailed
@@ -504,8 +503,17 @@ void DownloadInstance::DownloadManagerStart(const picojson::value& args, picojso
system_info_get_platform_bool("http://tizen.org/feature/network.telephony", &cell_support);
system_info_get_platform_bool("http://tizen.org/feature/network.wifi", &wifi_support);
+#define CHECK_CONNECTION_ERROR(ret) \
+ if (CONNECTION_ERROR_NONE != ret) { \
+ LogAndReportError( \
+ common::PlatformResult(common::ErrorCode::UNKNOWN_ERR, "Connection problem occured"), \
+ &out, ("Connection type is disconnected")); \
+ return; \
+ }
+
connection_h connection = nullptr;
- connection_create(&connection);
+ ret = connection_create(&connection);
+ CHECK_CONNECTION_ERROR(ret)
SCOPE_EXIT {
connection_destroy(connection);
};
@@ -513,11 +521,16 @@ void DownloadInstance::DownloadManagerStart(const picojson::value& args, picojso
connection_cellular_state_e cell_state = CONNECTION_CELLULAR_STATE_OUT_OF_SERVICE;
connection_wifi_state_e wifi_state = CONNECTION_WIFI_STATE_DEACTIVATED;
- connection_get_cellular_state(connection, &cell_state);
- connection_get_wifi_state(connection, &wifi_state);
+ ret = connection_get_cellular_state(connection, &cell_state);
+ CHECK_CONNECTION_ERROR(ret)
+ ret = connection_get_wifi_state(connection, &wifi_state);
+ CHECK_CONNECTION_ERROR(ret)
connection_type_e connection_type = CONNECTION_TYPE_DISCONNECTED;
- connection_get_type(connection, &connection_type);
+ ret = connection_get_type(connection, &connection_type);
+ CHECK_CONNECTION_ERROR(ret)
+
+#undef CHECK_CONNECTION_ERROR
if (CONNECTION_TYPE_DISCONNECTED == connection_type) {
LogAndReportError(
diff --git a/src/exif/exif_instance.cc b/src/exif/exif_instance.cc
index 121390c..0687d70 100644
--- a/src/exif/exif_instance.cc
+++ b/src/exif/exif_instance.cc
@@ -184,6 +184,7 @@ void ExifInstance::ExifManagerGetThumbnail(const picojson::value& args, picojson
gchar* ch_uri = g_base64_encode(exif_data->data, exif_data->size);
exif_data_unref(exif_data);
std::string base64 = "data:image/" + ext + ";base64," + ch_uri;
+ g_free(ch_uri);
std::pair pair;
pair = std::make_pair("src", picojson::value(base64));
diff --git a/src/exif/jpeg_file.cc b/src/exif/jpeg_file.cc
index e0640e1..aefd179 100644
--- a/src/exif/jpeg_file.cc
+++ b/src/exif/jpeg_file.cc
@@ -584,9 +584,9 @@ PlatformResult JpegFile::saveToFilePriv(const std::string& out_path) {
std::unique_ptr exif_output_data;
unsigned int exif_output_size = 0;
- if (cur_marker != JPEG_MARKER_SOI && cur_marker != JPEG_MARKER_EOI) {
+ if (JPEG_MARKER_SOI != cur_marker && JPEG_MARKER_EOI != cur_marker) {
unsigned short section_size = 2;
- if (JPEG_MARKER_APP1 && cur->exif_data) {
+ if (JPEG_MARKER_APP1 == cur_marker && cur->exif_data) {
unsigned char* tmp = NULL;
exif_data_save_data(cur->exif_data, &tmp, &exif_output_size);
if (!tmp || 0 == exif_output_size) {
diff --git a/src/messaging/email_manager.cc b/src/messaging/email_manager.cc
index 9a80c0d..256fbb3 100644
--- a/src/messaging/email_manager.cc
+++ b/src/messaging/email_manager.cc
@@ -175,6 +175,24 @@ PlatformResult EmailManager::addMessagePlatform(int account_id, std::shared_ptr<
ScopeLogger();
email_mail_data_t* mail_data = NULL;
email_mail_data_t* mail_data_final = NULL;
+ email_mailbox_t* mailbox_data = NULL;
+ email_account_t* account = NULL;
+
+ SCOPE_EXIT {
+ if (mail_data_final) {
+ email_free_mail_data(&mail_data_final, 1);
+ }
+ if (mail_data) {
+ email_free_mail_data(&mail_data, 1);
+ }
+ if (mailbox_data) {
+ email_free_mailbox(&mailbox_data, 1);
+ }
+ if (account) {
+ email_free_account(&account, 1);
+ }
+ };
+
int err = EMAIL_ERROR_NONE;
PlatformResult ret = Message::convertPlatformEmail(message, &mail_data);
@@ -183,13 +201,8 @@ PlatformResult EmailManager::addMessagePlatform(int account_id, std::shared_ptr<
mail_data->account_id = account_id;
// Adding "from" email address
- email_account_t* account = NULL;
err = email_get_account(account_id, GET_FULL_DATA_WITHOUT_PASSWORD, &account);
if (EMAIL_ERROR_NONE != err) {
- int ntv_ret = email_free_mail_data(&mail_data, 1);
- if (EMAIL_ERROR_NONE != ntv_ret) {
- LoggerE("Failed to free mail data memory %d (%s)", ntv_ret, get_error_message(ntv_ret));
- }
return LogAndCreateResult(ErrorCode::UNKNOWN_ERR, "Cannot retrieve email account information",
("email_get_account error: %d (%s)", err, get_error_message(err)));
}
@@ -200,18 +213,10 @@ PlatformResult EmailManager::addMessagePlatform(int account_id, std::shared_ptr<
ss >> address_from;
mail_data->full_address_from = strdup(address_from.c_str());
LoggerE("FROM %s", mail_data->full_address_from);
- err = email_free_account(&account, 1);
- if (EMAIL_ERROR_NONE != err) {
- LoggerE("Failed to free account data memory");
- }
+
// Setting mailbox id
- email_mailbox_t* mailbox_data = NULL;
err = email_get_mailbox_by_mailbox_type(account_id, mailbox_type, &mailbox_data);
if (EMAIL_ERROR_NONE != err) {
- int ntv_ret = email_free_mail_data(&mail_data, 1);
- if (EMAIL_ERROR_NONE != ntv_ret) {
- LoggerE("Failed to free mail data memory: %d (%s)", ntv_ret, get_error_message(ntv_ret));
- }
return LogAndCreateResult(
ErrorCode::UNKNOWN_ERR, "Cannot retrieve draft mailbox",
("email_get_mailbox_by_mailbox_type error: %d (%s)", err, get_error_message(err)));
@@ -228,14 +233,6 @@ PlatformResult EmailManager::addMessagePlatform(int account_id, std::shared_ptr<
// adding email without attachments
err = email_add_mail(mail_data, NULL, 0, NULL, 0);
if (EMAIL_ERROR_NONE != err) {
- int ntv_ret = email_free_mail_data(&mail_data, 1);
- if (EMAIL_ERROR_NONE != ntv_ret) {
- LoggerE("Failed to free mail data memory: %d (%s)", ntv_ret, get_error_message(ntv_ret));
- }
- ntv_ret = email_free_mailbox(&mailbox_data, 1);
- if (EMAIL_ERROR_NONE != ntv_ret) {
- LoggerE("Failed to destroy mailbox: %d (%s)", ntv_ret, get_error_message(ntv_ret));
- }
return LogAndCreateResult(ErrorCode::UNKNOWN_ERR, "Couldn't add message to draft mailbox",
("email_add_mail error: %d (%s)", err, get_error_message(err)));
} else {
@@ -250,46 +247,20 @@ PlatformResult EmailManager::addMessagePlatform(int account_id, std::shared_ptr<
if (message->getHasAttachment()) {
ret = Message::addEmailAttachments(message);
if (ret.IsError()) {
- int ntv_ret = email_free_mail_data(&mail_data, 1);
- if (EMAIL_ERROR_NONE != ntv_ret) {
- LoggerE("Failed to free mail data memory: %d (%s)", ntv_ret, get_error_message(ntv_ret));
- }
return ret;
}
}
err = email_get_mail_data(message->getId(), &mail_data_final);
if (EMAIL_ERROR_NONE != err) {
- int ntv_ret = email_free_mail_data(&mail_data, 1);
- if (EMAIL_ERROR_NONE != ntv_ret) {
- LoggerE("Failed to free mail data memory: %d (%s)", ntv_ret, get_error_message(ntv_ret));
- }
return LogAndCreateResult(ErrorCode::UNKNOWN_ERR, "Couldn't retrieve added mail data",
("email_get_mail_data error: %d (%s)", err, get_error_message(err)));
}
ret = message->updateEmailMessage(*mail_data_final);
if (ret.IsError()) {
- int ntv_ret = email_free_mail_data(&mail_data, 1);
- if (EMAIL_ERROR_NONE != ntv_ret) {
- LoggerE("Failed to free mail data memory: %d (%s)", ntv_ret, get_error_message(ntv_ret));
- }
return ret;
}
- err = email_free_mail_data(&mail_data_final, 1);
- if (EMAIL_ERROR_NONE != err) {
- LoggerE("Failed to free mail data final memory: %d (%s)", err, get_error_message(err));
- }
-
- err = email_free_mail_data(&mail_data, 1);
- if (EMAIL_ERROR_NONE != err) {
- LoggerE("Failed to free mail data memory: %d (%s)", err, get_error_message(err));
- }
-
- err = email_free_mailbox(&mailbox_data, 1);
- if (EMAIL_ERROR_NONE != err) {
- LoggerE("Failed to destroy mailbox: %d (%s)", err, get_error_message(err));
- }
return PlatformResult(ErrorCode::NO_ERROR);
}
diff --git a/src/messaging/message.cc b/src/messaging/message.cc
index d439357..ba6aaa6 100644
--- a/src/messaging/message.cc
+++ b/src/messaging/message.cc
@@ -338,15 +338,19 @@ std::string Message::convertEmailRecipients(const std::vector& reci
PlatformResult saveToTempFile(const std::string& data, std::string* file_name) {
ScopeLogger();
- char buf[] = "XXXXXX";
+ char buf[] = "/tmp/XXXXXX";
mode_t mask = umask(S_IWGRP | S_IWOTH);
- mkstemp(buf); // Just generate unique name
+ int file_descriptor = mkstemp(buf);
+ // Generate unique name and open the file descriptor
+ if (-1 == file_descriptor) {
+ return LogAndCreateResult(ErrorCode::UNKNOWN_ERR, "Temp file creation failed");
+ }
- std::string tmp_name = std::string("/tmp/") + buf;
+ std::string tmp_name = buf;
mode_t old_mask = umask(mask);
- FILE* file = fopen(tmp_name.c_str(), "w");
+ FILE* file = fdopen(file_descriptor, "w+");
umask(old_mask);
if (NULL == file) {
diff --git a/src/messaging/messaging_manager.cc b/src/messaging/messaging_manager.cc
index dbb4f4c..566f198 100644
--- a/src/messaging/messaging_manager.cc
+++ b/src/messaging/messaging_manager.cc
@@ -55,7 +55,8 @@ MsgManagerCallbackData::MsgManagerCallbackData(MessagingInstance& instance)
ScopeLogger();
}
-MessagingManager::MessagingManager(MessagingInstance& instance) : instance_(instance) {
+MessagingManager::MessagingManager(MessagingInstance& instance)
+ : m_msg_handle(nullptr), instance_(instance) {
ScopeLogger();
int ret = msg_open_msg_handle(&m_msg_handle);
if (ret != MSG_SUCCESS) {
diff --git a/src/secureelement/secureelement_instance.cc b/src/secureelement/secureelement_instance.cc
index 7313d70..eccb692 100644
--- a/src/secureelement/secureelement_instance.cc
+++ b/src/secureelement/secureelement_instance.cc
@@ -554,7 +554,7 @@ TizenResult SecureElementInstance::Transmit(picojson::object const& args,
};
for (size_t i = 0; i < v_cmd_size; i++) {
- cmd[i] = (int) v_cmd[i].get();
+ cmd[i] = (int)v_cmd[i].get();
}
int length = 0;
--
2.7.4
From ab4ea8ab2d511fa0e90634c4cd2947ac9b80af90 Mon Sep 17 00:00:00 2001
From: Piotr Kosko
Date: Wed, 28 Mar 2018 13:06:10 +0200
Subject: [PATCH 16/16] [version] 2.19
Change-Id: Ic8848b54eda46b98bd609e0d4254548a8c5beb04
Signed-off-by: Piotr Kosko
---
packaging/webapi-plugins.spec | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packaging/webapi-plugins.spec b/packaging/webapi-plugins.spec
index 1f08c55..2e5500f 100644
--- a/packaging/webapi-plugins.spec
+++ b/packaging/webapi-plugins.spec
@@ -10,7 +10,7 @@
%define crosswalk_extensions_path %{_libdir}/%{crosswalk_extensions}
Name: webapi-plugins
-Version: 2.18
+Version: 2.19
Release: 0
License: Apache-2.0 and BSD-3-Clause and MIT
Group: Development/Libraries
--
2.7.4