delete callback;
callback = NULL;
} else if (ErrorCode::NO_ERROR != result.error_code()) {
- LoggerE("taskManagerThread fails, %d: %s", static_cast<int>(result.error_code()), result.message().c_str());
+ LoggerE("taskManagerThread fails, %d: %s", static_cast<int>(result.error_code()),
+ result.message().c_str());
callback->setError(result.error_code(), result.message().c_str());
if (!g_idle_add(callErrorCallback, static_cast<void*>(callback))) {
LoggerE("g_idle_add fails");
void ArchiveInstance::PostError(const PlatformResult& e, double callback_id) {
ScopeLogger();
- LoggerE("Posting an error: %d, message: %s", static_cast<int>(e.error_code()), e.message().c_str());
+ LoggerE("Posting an error: %d, message: %s", static_cast<int>(e.error_code()),
+ e.message().c_str());
picojson::value val = picojson::value(picojson::object());
picojson::object& obj = val.get<picojson::object>();
("ret: %d", err));
}
- LoggerD("file: %s | unc size: %lu | comp size: %lu", filename_inzip, file_info.uncompressed_size,
- file_info.compressed_size);
+ LoggerD("file: %s | unc size: %lu | comp size: %lu", filename_inzip,
+ file_info.uncompressed_size, file_info.compressed_size);
ArchiveFileEntryPtr entry = ArchiveFileEntryPtr(new ArchiveFileEntry());
entry->setName(filename_inzip);
}
void ReportError(const PlatformResult& error, picojson::object* out) {
- LoggerE("PlatformResult: %d, message: %s", static_cast<int>(error.error_code()), error.message().c_str());
+ LoggerE("PlatformResult: %d, message: %s", static_cast<int>(error.error_code()),
+ error.message().c_str());
out->insert(std::make_pair("status", picojson::value("error")));
out->insert(std::make_pair("error", error.ToJSON()));
}
#include <algorithm>
#include <functional>
+#include <limits>
#include <map>
#include <string>
#include <vector>
-#include <limits>
#include "common/logger.h"
#include "common/picojson.h"
}
if (section_offset + 2 + total_section_len > m_in_data_size) {
- return LogAndCreateResult(ErrorCode::UNKNOWN_ERR, "JPEG file is invalid",
- ("offset:%u tag:0x%x | Error: current section offset:%u"
- " + 2 + total_section_len:%ld = %lu is greater then file size:%u",
- offset, cur_marker, section_offset, total_section_len,
- section_offset + total_section_len, m_in_data_size));
+ return LogAndCreateResult(
+ ErrorCode::UNKNOWN_ERR, "JPEG file is invalid",
+ ("offset:%u tag:0x%x | Error: current section offset:%u"
+ " + 2 + total_section_len:%ld = %lu is greater then file size:%u",
+ offset, cur_marker, section_offset, total_section_len,
+ section_offset + total_section_len, m_in_data_size));
}
if (JPEG_MARKER_APP1 == cur_marker) {
} else {
LoggerW(
"Warning: found %d APP1/Exif sections -"
- " only first is currently supported!", num_exif_sections);
+ " only first is currently supported!",
+ num_exif_sections);
}
}
}
auto result = ConvertIotconError(iotcon_query_foreach(
query,
[](const char* key, const char* value, void* user_data) -> bool {
-
ScopeLogger("Entered into asynchronous function, iotcon_query_foreach's argument");
if (key && value) {
auto obj = static_cast<picojson::object*>(user_data);
auto set_permissions = [data_name, id,
permissions](const std::shared_ptr<picojson::value>& response) -> void {
-
ScopeLogger("Entered into asynchronous function, set_permissions");
int ret = ckmc_set_permission(data_name.c_str(), id.c_str(), permissions);
typedef std::map<int, notification_text_type_e> InformationEnumMap;
typedef std::map<int, notification_image_type_e> ImageEnumMap;
-typedef std::function<common::PlatformResult(const picojson::value& noti_val,
- bool is_update, notification_h* noti_handle)>
+typedef std::function<common::PlatformResult(const picojson::value& noti_val, bool is_update,
+ notification_h* noti_handle)>
GetHandleFromJsonFun;
class CommonNotification {
auto start = [this, type_enum, type_str,
start_result](const std::shared_ptr<picojson::value>& result) {
-
ScopeLogger("Entered into asynchronous function, start");
auto sensor_data = GetSensor(type_enum);
if (!sensor_data) {
sensord_register_event(GetSensorHandle(), AUTO_ROTATION_EVENT_CHANGE_STATE,
BASE_GATHERING_INTERVAL, 0, OnDeviceOrientationChangedCb, this);
if (!sensor_ret) {
- SysteminfoUtils::UnregisterVconfCallback(
- VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL, OnDeviceAutoRotationChangedCb);
- return LogAndCreateResult(
- ErrorCode::UNKNOWN_ERR, "Failed to register orientation change event listener",
- ("sensord_register_event returned false"));
+ SysteminfoUtils::UnregisterVconfCallback(VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL,
+ OnDeviceAutoRotationChangedCb);
+ return LogAndCreateResult(ErrorCode::UNKNOWN_ERR,
+ "Failed to register orientation change event listener",
+ ("sensord_register_event returned false"));
}
LoggerD("Added callback for DEVICE_ORIENTATION");
ScopeLogger();
bool sensor_ret = sensord_unregister_event(GetSensorHandle(), AUTO_ROTATION_EVENT_CHANGE_STATE);
if (!sensor_ret) {
- SysteminfoUtils::UnregisterVconfCallback(
- VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL, OnDeviceAutoRotationChangedCb);
- return LogAndCreateResult(
- ErrorCode::UNKNOWN_ERR, "Failed to unregister orientation change event listener",
- ("sensord_unregister_event returned false"));
+ SysteminfoUtils::UnregisterVconfCallback(VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL,
+ OnDeviceAutoRotationChangedCb);
+ return LogAndCreateResult(ErrorCode::UNKNOWN_ERR,
+ "Failed to unregister orientation change event listener",
+ ("sensord_unregister_event returned false"));
}
PlatformResult ret = PlatformResult(ErrorCode::NO_ERROR);
CHECK_LISTENER_ERROR(SysteminfoUtils::UnregisterVconfCallback(
// if there is no other ip-relateded listeners left, unregister
if (!IsListenerRegistered(kPropertyIdCellularNetwork)) {
- PlatformResult ret =
- SysteminfoUtils::UnregisterVconfCallback(VCONFKEY_TELEPHONY_FLIGHT_MODE,
- OnCellularNetworkValueChangedCb);
+ PlatformResult ret = SysteminfoUtils::UnregisterVconfCallback(VCONFKEY_TELEPHONY_FLIGHT_MODE,
+ OnCellularNetworkValueChangedCb);
if (ret.IsError()) {
tapi_manager_->UnregisterCallbacks();
if (IsIpChangeCallbackNotRegistered()) {