GVariant* parameters) {
LOGI("%s, %s", sender_name.c_str(), signal_name.c_str());
SenderInfo* si = GetSenderInfo(sender_name, connection, parameters);
- if (si == NULL)
+ if (si == nullptr)
return;
if (si->GetPrivilegeResult() == COMPLICATION_CYNARA_DENIED) {
editor_appid,
editor_appid, -1,
util::GetCmdStr(util::CmdType::SetupReply),
- g_variant_new("(is)", editable_id, raw == NULL ? "" : raw));
+ g_variant_new("(is)", editable_id, raw == nullptr ? "" : raw));
} catch (Exception &ex) {
LOGE("%s %d", ex.what(), ex.GetErrorCode());
}
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (provider_id == NULL || cb == NULL)
+ if (provider_id == nullptr || cb == nullptr)
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
std::string appid = DBManager::GetProviderAppId(provider_id);
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (provider_id == NULL || cb == NULL)
+ if (provider_id == nullptr || cb == nullptr)
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
auto cp = __providers.find(provider_id);
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (updated_provider_id == NULL)
+ if (updated_provider_id == nullptr)
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
auto cp = __providers.find(updated_provider_id);
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- char* editor_appid = NULL;
- char* editable_id = NULL;
+ char* editor_appid = nullptr;
+ char* editable_id = nullptr;
int ret;
int str_len = 0;
- bundle_raw* raw_data = NULL;
+ bundle_raw* raw_data = nullptr;
bool emit_signal_ret = false;
ret = app_control_get_extra_data(handle, SETUP_EDITOR_APPID_KEY,
extern "C" EXPORT_API int watchface_complication_provider_setup_is_editing(
app_control_h handle, bool* is_editing) {
- char* value = NULL;
+ char* value = nullptr;
int ret;
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL || is_editing == NULL) {
+ if (handle == nullptr || is_editing == nullptr) {
LOGE("Null parameter");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
extern "C" EXPORT_API int watchface_complication_provider_setup_get_context(
app_control_h handle, bundle** context) {
- char* value = NULL;
- bundle* data = NULL;
+ char* value = nullptr;
+ bundle* data = nullptr;
int ret;
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL || context == NULL) {
+ if (handle == nullptr || context == nullptr) {
LOGE("Null parameter");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
bundle* shared_data, watchface_complication_type_e type) {
char num_str[32] = {0, };
- if (shared_data == NULL ||
+ if (shared_data == nullptr ||
!util::CheckComplicationType(static_cast<int>(type))) {
LOGE("Invalid param");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (shared_data == NULL || title == NULL) {
+ if (shared_data == nullptr || title == nullptr) {
LOGE("Invalid param");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (shared_data == NULL || text == NULL) {
+ if (shared_data == nullptr || text == nullptr) {
LOGE("Invalid param");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (shared_data == NULL || text == NULL) {
+ if (shared_data == nullptr || text == nullptr) {
LOGE("Invalid param");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (shared_data == NULL) {
+ if (shared_data == nullptr) {
LOGE("Invalid param");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (shared_data == NULL || image_path == NULL) {
+ if (shared_data == nullptr || image_path == nullptr) {
LOGE("Invalid param");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (shared_data == NULL || min_value > max_value || current_value < min_value
+ if (shared_data == nullptr || min_value > max_value || current_value < min_value
|| current_value > max_value) {
LOGE("Invalid param");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (shared_data == NULL || icon_path == NULL) {
+ if (shared_data == nullptr || icon_path == nullptr) {
LOGE("Invalid param");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (shared_data == NULL || extra_data == NULL) {
+ if (shared_data == nullptr || extra_data == nullptr) {
LOGE("Invalid param");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (shared_data == NULL || screen_reader_text == NULL) {
+ if (shared_data == nullptr || screen_reader_text == nullptr) {
LOGE("Invalid param");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (shared_data == NULL || is_valid == NULL) {
+ if (shared_data == nullptr || is_valid == nullptr) {
LOGE("Invalid param");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
static int _get_value_from_touch_launch_data(app_control_h handle,
const char* key, char** value) {
- bundle* data = NULL;
- char* bundle_str = NULL;
- char* bundle_val = NULL;
+ bundle* data = nullptr;
+ char* bundle_str = nullptr;
+ char* bundle_val = nullptr;
int ret;
ret = app_control_get_extra_data(handle, TOUCH_LAUNCH_DATA_KEY, &bundle_str);
}
*value = strdup(bundle_val);
- if (*value == NULL) {
+ if (*value == nullptr) {
LOGE("Out of memory");
bundle_free(data);
return WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY;
extern "C" EXPORT_API int watchface_complication_provider_event_get_type(
app_control_h handle, watchface_complication_event_type_e* event_type) {
int ret;
- char* value = NULL;
+ char* value = nullptr;
bundle* data;
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL || event_type == NULL) {
+ if (handle == nullptr || event_type == nullptr) {
LOGE("Invalid param");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
}
*event_type = static_cast<watchface_complication_event_type_e>(
- strtol(value, NULL, 10));
+ strtol(value, nullptr, 10));
free(value);
return WATCHFACE_COMPLICATION_ERROR_NONE;
int watchface_complication_provider_event_get_provider_id(
app_control_h handle, char** provider_id) {
int ret;
- char* value = NULL;
+ char* value = nullptr;
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL || provider_id == NULL) {
+ if (handle == nullptr || provider_id == nullptr) {
LOGE("Invalid param");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
int watchface_complication_provider_event_get_complication_type(
app_control_h handle, watchface_complication_type_e* type) {
int ret;
- char* value = NULL;
+ char* value = nullptr;
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL || type == NULL) {
+ if (handle == nullptr || type == nullptr) {
LOGE("Invalid param");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
if (ret != WATCHFACE_COMPLICATION_ERROR_NONE)
return ret;
- int comp_type = strtol(value, NULL, 10);
+ int comp_type = strtol(value, nullptr, 10);
if (!util::CheckComplicationType(comp_type)) {
LOGE("Invalid param");
free(value);
int watchface_complication_provider_event_get_context(
app_control_h handle, bundle** context) {
int ret;
- char* value = NULL;
- bundle* ctx_data = NULL;
+ char* value = nullptr;
+ bundle* ctx_data = nullptr;
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL || context == NULL) {
+ if (handle == nullptr || context == nullptr) {
LOGE("Invalid param");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
ctx_data = bundle_decode(reinterpret_cast<const bundle_raw*>(value),
strlen(value));
free(value);
- if (ctx_data == NULL) {
+ if (ctx_data == nullptr) {
LOGE("Cannot convert value to bundle !!");
return WATCHFACE_COMPLICATION_ERROR_IO_ERROR;
}
Impl();
static int PackageAppinfoCallback(const pkgmgrinfo_appinfo_h handle,
void* user_data) {
- char* appid = NULL;
+ char* appid = nullptr;
int ret = pkgmgrinfo_appinfo_get_appid(handle, &appid);
if (ret < 0) {
LOGE("Failed to get appid");
return WATCHFACE_COMPLICATION_ERROR_IO_ERROR;
}
ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle,
- PackageAppinfoCallback, NULL);
+ PackageAppinfoCallback, nullptr);
if (ret != PMINFO_R_OK) {
LOGE("foreach failed [%d]", ret);
pkgmgrinfo_appinfo_filter_destroy(handle);
}
private:
- GDBusConnection* conn_ = NULL;
- pkgmgr_client* pkgmgr_client_ = NULL;
+ GDBusConnection* conn_ = nullptr;
+ pkgmgr_client* pkgmgr_client_ = nullptr;
std::string appid_;
private:
}
int Complication::UpdateLastContext() {
- if (impl_->context_data_.get() == NULL) {
+ if (impl_->context_data_.get() == nullptr) {
LOGI("Empty context");
return WATCHFACE_COMPLICATION_ERROR_NONE;
}
sqlite3* DBManager::OpenDB() {
int ret;
const char* path;
- sqlite3* db = NULL;
+ sqlite3* db = nullptr;
path = GetParserDataPath();
- if (path == NULL)
- return NULL;
+ if (path == nullptr)
+ return nullptr;
- ret = sqlite3_open_v2(path, &db, SQLITE_OPEN_READONLY, NULL);
+ ret = sqlite3_open_v2(path, &db, SQLITE_OPEN_READONLY, nullptr);
if (ret != SQLITE_OK) {
LOGE("open db(%s) error: %d", path, ret);
- return NULL;
+ return nullptr;
}
return db;
"WHERE provider_id=? AND support_type=?";
db = OpenDB();
- if (db == NULL) {
+ if (db == nullptr) {
LOGE("parser db not exist");
return nullptr;
}
- if (sqlite3_prepare_v2(db, query, strlen(query), &stmt, NULL) != SQLITE_OK) {
+ if (sqlite3_prepare_v2(db, query, strlen(query), &stmt, nullptr) != SQLITE_OK) {
LOGE("prepare error: %s", sqlite3_errmsg(db));
CloseDB(db);
return nullptr;
}
int DBManager::GetProviderPeriod(std::string& provider_id, int* period) {
- sqlite3_stmt* stmt = NULL;
+ sqlite3_stmt* stmt = nullptr;
sqlite3* db;
int ret;
"SELECT period FROM complication_provider WHERE provider_id=?";
db = OpenDB();
- if (db == NULL) {
+ if (db == nullptr) {
LOGE("parser db not exist");
return WATCHFACE_COMPLICATION_ERROR_DB;
}
- if (sqlite3_prepare_v2(db, query, strlen(query), &stmt, NULL) != SQLITE_OK) {
+ if (sqlite3_prepare_v2(db, query, strlen(query), &stmt, nullptr) != SQLITE_OK) {
LOGE("prepare error: %s", sqlite3_errmsg(db));
CloseDB(db);
return WATCHFACE_COMPLICATION_ERROR_DB;
}
bool DBManager::IsProviderExist(std::string& provider_id, int support_type) {
- sqlite3_stmt* stmt = NULL;
+ sqlite3_stmt* stmt = nullptr;
sqlite3* db;
bool is_exist = false;
int trusted;
"WHERE provider_id=? AND support_type=?";
db = OpenDB();
- if (db == NULL) {
+ if (db == nullptr) {
LOGE("parser db not exist");
return false;
}
- if (sqlite3_prepare_v2(db, query, strlen(query), &stmt, NULL) != SQLITE_OK) {
+ if (sqlite3_prepare_v2(db, query, strlen(query), &stmt, nullptr) != SQLITE_OK) {
LOGE("prepare error: %s", sqlite3_errmsg(db));
CloseDB(db);
return false;
}
std::string DBManager::GetProviderAppId(const char* provider_id) {
- sqlite3_stmt* stmt = NULL;
+ sqlite3_stmt* stmt = nullptr;
sqlite3* db;
int trusted;
std::string provider_app_id;
"SELECT trusted, appid FROM complication_provider WHERE provider_id=?";
db = OpenDB();
- if (db == NULL) {
+ if (db == nullptr) {
LOGE("parser db not exist");
return std::string();
}
- if (sqlite3_prepare_v2(db, query, strlen(query), &stmt, NULL) != SQLITE_OK) {
+ if (sqlite3_prepare_v2(db, query, strlen(query), &stmt, nullptr) != SQLITE_OK) {
LOGE("prepare error: %s", sqlite3_errmsg(db));
CloseDB(db);
return std::string();
const char* provider_id;
int type = 0;
sqlite3_stmt* stmt;
- sqlite3* db = NULL;
+ sqlite3* db = nullptr;
std::list<std::unique_ptr<DBManager::ProviderInfo>> provider_list;
int trusted;
std::string provider_app_id;
"WHERE (support_type & ?) > 0";
db = OpenDB();
- if (db == NULL) {
+ if (db == nullptr) {
LOGE("parser db not exist");
return provider_list;
}
- if (sqlite3_prepare_v2(db, query, strlen(query), &stmt, NULL) != SQLITE_OK) {
+ if (sqlite3_prepare_v2(db, query, strlen(query), &stmt, nullptr) != SQLITE_OK) {
LOGE("prepare error: %s", sqlite3_errmsg(db));
CloseDB(db);
return provider_list;
"SELECT DISTINCT provider_id FROM complication_provider WHERE appid=?";
db = OpenDB();
- if (db == NULL) {
+ if (db == nullptr) {
LOGE("parser db not exist");
return provider_list;
}
- if (sqlite3_prepare_v2(db, query, strlen(query), &stmt, NULL) != SQLITE_OK) {
+ if (sqlite3_prepare_v2(db, query, strlen(query), &stmt, nullptr) != SQLITE_OK) {
LOGE("prepare error: %s", sqlite3_errmsg(db));
CloseDB(db);
return provider_list;
"WHERE provider_id = ?";
db = OpenDB();
- if (db == NULL) {
+ if (db == nullptr) {
LOGE("parser db not exist");
return WATCHFACE_COMPLICATION_ERROR_DB;
}
- if (sqlite3_prepare_v2(db, query, strlen(query), &stmt, NULL) != SQLITE_OK) {
+ if (sqlite3_prepare_v2(db, query, strlen(query), &stmt, nullptr) != SQLITE_OK) {
LOGE("prepare error: %s", sqlite3_errmsg(db));
CloseDB(db);
return WATCHFACE_COMPLICATION_ERROR_DB;
"SELECT DISTINCT privilege FROM provider_privilege WHERE provider_id=?";
db = OpenDB();
- if (db == NULL) {
+ if (db == nullptr) {
LOGE("parser db not exist");
return privlege_list;
}
- if (sqlite3_prepare_v2(db, query, strlen(query), &stmt, NULL) != SQLITE_OK) {
+ if (sqlite3_prepare_v2(db, query, strlen(query), &stmt, nullptr) != SQLITE_OK) {
LOGE("prepare error: %s", sqlite3_errmsg(db));
CloseDB(db);
return privlege_list;
"SELECT support_events FROM provider_support_events WHERE provider_id=?";
db = OpenDB();
- if (db == NULL) {
+ if (db == nullptr) {
LOGE("parser db not exist");
return -1;
}
- if (sqlite3_prepare_v2(db, query, strlen(query), &stmt, NULL) != SQLITE_OK) {
+ if (sqlite3_prepare_v2(db, query, strlen(query), &stmt, nullptr) != SQLITE_OK) {
LOGE("prepare error: %s", sqlite3_errmsg(db));
CloseDB(db);
return -1;
char* tmp;
lang = vconf_get_str(VCONFKEY_LANGSET);
- if (lang == NULL) {
+ if (lang == nullptr) {
locale = strdup(DEFAULT_LOCALE);
- if (locale == NULL) {
+ if (locale == nullptr) {
LOGE("out of memory");
- return NULL;
+ return nullptr;
}
return locale;
}
tmp = strtok_r(lang, ".", &ptr);
- if (tmp == NULL) {
+ if (tmp == nullptr) {
LOGE("failed to get language");
free(lang);
- return NULL;
+ return nullptr;
}
locale = strdup(tmp);
- if (locale == NULL) {
+ if (locale == nullptr) {
LOGE("out of memory");
free(lang);
- return NULL;
+ return nullptr;
}
for (int i = 0; i < static_cast<int>(strlen(locale)); i++) {
sqlite3_stmt *stmt;
sqlite3* db;
const char* lb;
- char* locale = NULL;
+ char* locale = nullptr;
int ret;
static const char query[] =
"WHERE provider_id=? AND locale=?";
db = OpenDB();
- if (db == NULL) {
+ if (db == nullptr) {
LOGE("parser db not exist");
return std::string();
}
- if (sqlite3_prepare_v2(db, query, strlen(query), &stmt, NULL) != SQLITE_OK) {
+ if (sqlite3_prepare_v2(db, query, strlen(query), &stmt, nullptr) != SQLITE_OK) {
LOGE("prepare error: %s", sqlite3_errmsg(db));
CloseDB(db);
return std::string();
}
locale = GetSystemLocale();
- if (locale == NULL) {
+ if (locale == nullptr) {
sqlite3_finalize(stmt);
CloseDB(db);
return std::string();
"SELECT DISTINCT setup_appid FROM provider_setup_appid WHERE provider_id=?";
db = OpenDB();
- if (db == NULL) {
+ if (db == nullptr) {
LOGE("parser db not exist");
return std::string();
}
- if (sqlite3_prepare_v2(db, query, strlen(query), &stmt, NULL) != SQLITE_OK) {
+ if (sqlite3_prepare_v2(db, query, strlen(query), &stmt, nullptr) != SQLITE_OK) {
LOGE("prepare error: %s", sqlite3_errmsg(db));
CloseDB(db);
return std::string();
"SELECT trusted FROM complication_provider WHERE provider_id = ?";
db = OpenDB();
- if (db == NULL) {
+ if (db == nullptr) {
LOGE("parser db not exist");
return WATCHFACE_COMPLICATION_ERROR_DB;
}
ret = sqlite3_prepare_v2(db, query, strlen(query),
- &stmt, NULL);
+ &stmt, nullptr);
if (ret != SQLITE_OK) {
LOGE("prepare error: %s", sqlite3_errmsg(db));
CloseDB(db);
const std::string& interface_name,
const std::string& signal_name,
GVariant* parameters) {
- char* editor_id = NULL;
+ char* editor_id = nullptr;
std::shared_ptr<const Bundle> updated_data;
LOGI("signal_name: %s ,%s", signal_name.c_str(), sender_name.c_str());
if (i.get()->GetState() != IEditable::Complete) {
i.get()->SetState(IEditable::Cancel);
i.get()->SetCurDataIdx(i.get()->GetLastDataIdx());
- if (i.get()->GetLastContext().get() != NULL) {
+ if (i.get()->GetLastContext().get() != nullptr) {
i.get()->SetContext(std::unique_ptr<Bundle>(
new Bundle(i.get()->GetLastContext().get()->GetHandle())));
} else {
LOGI("db path : %s", db_path.c_str());
ret = sqlite3_open_v2(db_path.c_str(), &tmp_impl->setting_db_, open_flags,
- NULL);
+ nullptr);
if (ret != SQLITE_OK) {
LOGE("database creation failed with error: %d", ret);
return WATCHFACE_COMPLICATION_ERROR_DB;
}
ret = sqlite3_exec(tmp_impl->setting_db_, setting_table_command.c_str(),
- NULL, NULL, NULL);
+ nullptr, nullptr, nullptr);
if (ret != SQLITE_OK) {
sqlite3_close_v2(tmp_impl->setting_db_);
LOGE("database setting table creation failed: %d", ret);
}
ret = sqlite3_open_v2(db_path.c_str(), &tmp_impl->context_db_, open_flags,
- NULL);
+ nullptr);
if (ret != SQLITE_OK) {
sqlite3_close_v2(tmp_impl->setting_db_);
LOGE("database creation failed with error: %d", ret);
return WATCHFACE_COMPLICATION_ERROR_DB;
}
ret = sqlite3_exec(tmp_impl->context_db_, context_table_command.c_str(),
- NULL, NULL, NULL);
+ nullptr, nullptr, nullptr);
if (ret != SQLITE_OK) {
sqlite3_close_v2(tmp_impl->setting_db_);
sqlite3_close_v2(tmp_impl->context_db_);
int EditablesManager::StoreSetting(int editable_id, bundle_raw* raw_data) {
char query[QUERY_MAXLEN] = {0, };
- char* error = NULL;
+ char* error = nullptr;
- if (impl_->setting_db_ == NULL) {
+ if (impl_->setting_db_ == nullptr) {
LOGE("DB is not initialized.");
return -1;
}
sqlite3_snprintf(QUERY_MAXLEN, query,
"INSERT OR REPLACE INTO editable_setting(editable_id, setting_data) " \
"VALUES (%d, %Q)", editable_id, raw_data);
- if (sqlite3_exec(impl_->setting_db_, query, NULL, NULL, &error) != SQLITE_OK) {
+ if (sqlite3_exec(impl_->setting_db_, query, nullptr, nullptr, &error) != SQLITE_OK) {
LOGE("sqlite3_exec error(editable_id %d, error = %s)", editable_id, error);
sqlite3_free(error);
return WATCHFACE_COMPLICATION_ERROR_DB;
sqlite3_stmt* stmt;
int ret;
- if (impl_->setting_db_ == NULL) {
+ if (impl_->setting_db_ == nullptr) {
return nullptr;
}
"SELECT setting_data FROM editable_setting WHERE " \
"editable_id = %d ", editable_id);
ret = sqlite3_prepare_v2(impl_->setting_db_,
- query, strlen(query), &stmt, NULL);
+ query, strlen(query), &stmt, nullptr);
if (ret != SQLITE_OK) {
LOGE("sqlite3_prepare_v2 failed (editable_id : %d, error = %s)",
editable_id, sqlite3_errmsg(impl_->setting_db_));
const char* raw_data;
sqlite3_stmt* stmt;
- if (impl_->context_db_ == NULL) {
+ if (impl_->context_db_ == nullptr) {
return nullptr;
}
"SELECT context_data FROM editable_context WHERE " \
"editable_id = %d AND provider_id = %Q ", editable_id, provider_id);
LOGI("editable context select sql : %s", query);
- if (sqlite3_prepare_v2(impl_->context_db_, query, strlen(query), &stmt, NULL)
+ if (sqlite3_prepare_v2(impl_->context_db_, query, strlen(query), &stmt, nullptr)
!= SQLITE_OK) {
LOGE("sqlite3_prepare fail %s", sqlite3_errmsg(impl_->context_db_));
sqlite3_close_v2(impl_->context_db_);
sqlite3_stmt* stmt;
int ret;
- if (impl_->context_db_ == NULL)
+ if (impl_->context_db_ == nullptr)
return WATCHFACE_COMPLICATION_ERROR_DB;
sqlite3_snprintf(QUERY_MAXLEN, query,
"editable_id = %d AND provider_id = %Q ", editable_id, provider_id);
LOGI("editable context delete : (%d)(%s)", editable_id, provider_id);
ret = sqlite3_prepare_v2(impl_->context_db_, query, strlen(query), &stmt,
- NULL);
+ nullptr);
if (ret != SQLITE_OK) {
LOGE("sqlite3_prepare fail %s", sqlite3_errmsg(impl_->context_db_));
sqlite3_close_v2(impl_->context_db_);
ComplicationType type, const std::unique_ptr<Bundle>& data) {
cb_(complication_id,
provider_id.c_str(), static_cast<watchface_complication_type_e>(type),
- data.get() == NULL ? NULL : data.get()->GetHandle(), user_data_);
+ data.get() == nullptr ? nullptr : data.get()->GetHandle(), user_data_);
}
void InvokeErrorCallback(int complication_id,
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL || cb == NULL || error_cb == NULL)
+ if (handle == nullptr || cb == nullptr || error_cb == nullptr)
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
static cynara_result pcr = COMPLICATION_CYNARA_UNKNOWN;
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL || cb == NULL)
+ if (handle == nullptr || cb == nullptr)
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
auto sh = static_cast<SharedHandle<WatchComplicationStub>*>(handle);
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL)
+ if (handle == nullptr)
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
LOGI("update call!!");
}
if (default_type != WATCHFACE_COMPLICATION_TYPE_NO_DATA
- && default_provider_id == NULL) {
+ && default_provider_id == nullptr) {
LOGE("Invalid param");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
- if (created_handle == NULL)
+ if (created_handle == nullptr)
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
try {
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL)
+ if (handle == nullptr)
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
auto sh = static_cast<SharedHandle<WatchComplicationStub>*>(handle);
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL || cur_provider_id == NULL)
+ if (handle == nullptr || cur_provider_id == nullptr)
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
char* tmp;
LOGI("provider id : %s", ptr.get()->GetCurProviderId().c_str());
tmp = strdup(ptr.get()->GetCurProviderId().c_str());
- if (tmp == NULL)
+ if (tmp == nullptr)
return WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY;
*cur_provider_id = tmp;
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL || cur_type == NULL)
+ if (handle == nullptr || cur_type == nullptr)
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
auto sh = static_cast<SharedHandle<WatchComplicationStub>*>(handle);
extern "C" EXPORT_API int watchface_complication_data_get_type(
const bundle* data, watchface_complication_type_e* type) {
- char* type_str = NULL;
+ char* type_str = nullptr;
int ret;
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (data == NULL || type == NULL) {
+ if (data == nullptr || type == nullptr) {
LOGE("Invalid param !!");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
return WATCHFACE_COMPLICATION_ERROR_NO_DATA;
}
- int comp_type = strtol(type_str, NULL, 10);
+ int comp_type = strtol(type_str, nullptr, 10);
if (!util::CheckComplicationType(comp_type)) {
LOGE("Invalid param : type_str(%s)", type_str);
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
static int __get_complication_data(const bundle* data, const char* key,
char** text) {
- char* value = NULL;
+ char* value = nullptr;
int ret;
- if (key == NULL) {
+ if (key == nullptr) {
LOGE("Invalid param !!");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
}
*text = strdup(value);
- if (*text == NULL) {
+ if (*text == nullptr) {
LOGE("Out of memory");
return WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY;
}
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (data == NULL || short_text == NULL) {
+ if (data == nullptr || short_text == nullptr) {
LOGE("Invalid param !!");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (data == NULL || long_text == NULL) {
+ if (data == nullptr || long_text == nullptr) {
LOGE("Invalid param !!");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (data == NULL || title == NULL) {
+ if (data == nullptr || title == nullptr) {
LOGE("Invalid param !!");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
extern "C" EXPORT_API int watchface_complication_data_get_timestamp(
const bundle* data, long* timestamp) {
int ret;
- char* time_str = NULL;
+ char* time_str = nullptr;
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (data == NULL || timestamp == NULL) {
+ if (data == nullptr || timestamp == nullptr) {
LOGE("Invalid param !!");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
LOGE("failed to get time %d", ret);
return WATCHFACE_COMPLICATION_ERROR_NO_DATA;
}
- *timestamp = strtol(time_str, NULL, 10);
+ *timestamp = strtol(time_str, nullptr, 10);
return WATCHFACE_COMPLICATION_ERROR_NONE;
}
extern "C" EXPORT_API int watchface_complication_data_get_image_path(
const bundle* data, char** image_path) {
- if (data == NULL || image_path == NULL) {
+ if (data == nullptr || image_path == nullptr) {
LOGE("Invalid param !!");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
const bundle* data, double* current_value, double* min_value,
double* max_value) {
int ret;
- char* current_value_str = NULL;
- char* min_value_str = NULL;
- char* max_value_str = NULL;
+ char* current_value_str = nullptr;
+ char* min_value_str = nullptr;
+ char* max_value_str = nullptr;
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (data == NULL || current_value == NULL || min_value == NULL
- || max_value == NULL) {
+ if (data == nullptr || current_value == nullptr || min_value == nullptr
+ || max_value == nullptr) {
LOGE("Invalid param !!");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
return WATCHFACE_COMPLICATION_ERROR_NO_DATA;
}
- *current_value = strtod(current_value_str, NULL);
- *min_value = strtod(min_value_str, NULL);
- *max_value = strtod(max_value_str, NULL);
+ *current_value = strtod(current_value_str, nullptr);
+ *min_value = strtod(min_value_str, nullptr);
+ *max_value = strtod(max_value_str, nullptr);
return WATCHFACE_COMPLICATION_ERROR_NONE;
}
extern "C" EXPORT_API int watchface_complication_data_get_icon_path(
const bundle* data, char** icon_path) {
- if (data == NULL || icon_path == NULL) {
+ if (data == nullptr || icon_path == nullptr) {
LOGE("Invalid param !!");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (data == NULL || extra_data == NULL) {
+ if (data == nullptr || extra_data == nullptr) {
LOGE("Invalid param !!");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (data == NULL || screen_reader_text == NULL) {
+ if (data == nullptr || screen_reader_text == nullptr) {
LOGE("Invalid data !!");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL ||
+ if (handle == nullptr ||
!(event_type == WATCHFACE_COMPLICATION_EVENT_TAP
|| event_type == WATCHFACE_COMPLICATION_EVENT_DOUBLE_TAP))
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
extern "C" EXPORT_API int watchface_complication_allowed_list_create(
complication_allowed_list_h* handle) {
- complication_allowed_list_h h = NULL;
+ complication_allowed_list_h h = nullptr;
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL) {
+ if (handle == nullptr) {
LOGE("Invalid param");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
h = (complication_allowed_list_h)calloc(1,
sizeof(struct complication_allowed_list_));
- if (h == NULL) {
+ if (h == nullptr) {
LOGE("Out of memory");
return WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY;
}
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL) {
+ if (handle == nullptr) {
LOGE("Invalid param");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
static gint __provider_info_cmp(gconstpointer a, gconstpointer b) {
provider_info* data = (provider_info*)a;
const char* provider_id = (const char*)b;
- if (data == NULL || data->provider_id == NULL)
+ if (data == nullptr || data->provider_id == nullptr)
return -1;
return strcmp(data->provider_id, provider_id);
}
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL || provider_id == NULL) {
+ if (handle == nullptr || provider_id == nullptr) {
LOGE("Invalid param");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
provider_info* info = reinterpret_cast<provider_info*>(calloc(1,
sizeof(provider_info)));
- if (info == NULL) {
+ if (info == nullptr) {
LOGE("Out of memory");
return WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY;
}
info->provider_id = strdup(provider_id);
- if (info->provider_id == NULL) {
+ if (info->provider_id == nullptr) {
LOGE("Out of memory");
free(info);
return WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY;
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL || provider_id == NULL || handle->allowed_list == NULL) {
+ if (handle == nullptr || provider_id == nullptr || handle->allowed_list == nullptr) {
LOGE("Invalid param");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL || provider_id == NULL || types == NULL ||
- handle->allowed_list == NULL ||
+ if (handle == nullptr || provider_id == nullptr || types == nullptr ||
+ handle->allowed_list == nullptr ||
index >= static_cast<int>(g_list_length(handle->allowed_list)) ||
index < 0) {
LOGE("Invalid param");
provider_info* info =
reinterpret_cast<provider_info*>(g_list_nth_data(handle->allowed_list,
index));
- if (info == NULL || info->provider_id == NULL) {
+ if (info == nullptr || info->provider_id == nullptr) {
LOGE("fail to get provider id");
return WATCHFACE_COMPLICATION_ERROR_IO_ERROR;
}
char* id = strdup(info->provider_id);
- if (id == NULL) {
+ if (id == nullptr) {
LOGE("Out of memory");
return WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY;
}
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL || list_handle == NULL || list_handle->allowed_list == NULL
+ if (handle == nullptr || list_handle == nullptr || list_handle->allowed_list == nullptr
|| g_list_length(list_handle->allowed_list) == 0) {
LOGE("Invalid param");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
provider_info* info =
reinterpret_cast<provider_info*>(g_list_nth_data(
list_handle->allowed_list, i));
- if (info == NULL || info->provider_id == NULL)
+ if (info == nullptr || info->provider_id == nullptr)
continue;
try {
allowed_list.emplace_back(std::unique_ptr<Complication::ProviderInfo>(
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL) {
+ if (handle == nullptr) {
LOGE("Invalid param");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL || list_handle == NULL || editable_name == NULL ||
- list_handle->candidates_list == NULL)
+ if (handle == nullptr || list_handle == nullptr || editable_name == nullptr ||
+ list_handle->candidates_list == nullptr)
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
if (cur_data_idx < 0 &&
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL || comp == NULL)
+ if (handle == nullptr || comp == nullptr)
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
EditablesContainerStub* ec = static_cast<EditablesContainerStub*>(handle);
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL || cb == NULL)
+ if (handle == nullptr || cb == nullptr)
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
static cynara_result pcr = COMPLICATION_CYNARA_UNKNOWN;
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (cb == NULL || __container == NULL)
+ if (cb == nullptr || __container == nullptr)
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
return __container->RemoveReadyCallbackInfo(cb);
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL || idx == NULL)
+ if (handle == nullptr || idx == nullptr)
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
IEditable* ie = static_cast<IEditable*>(handle);
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL || cur_data == NULL)
+ if (handle == nullptr || cur_data == nullptr)
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
IEditable* ie = static_cast<IEditable*>(handle);
shared_ptr<Bundle> data = ie->GetCurData();
if (data.get() == nullptr)
return WATCHFACE_COMPLICATION_ERROR_NO_DATA;
- if (data->GetHandle() != NULL) {
+ if (data->GetHandle() != nullptr) {
*cur_data = bundle_dup(data->GetHandle());
- if (*cur_data == NULL)
+ if (*cur_data == nullptr)
return WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY;
} else {
return WATCHFACE_COMPLICATION_ERROR_NO_DATA;
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL || nth_data == NULL)
+ if (handle == nullptr || nth_data == nullptr)
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
IEditable* ie = static_cast<IEditable*>(handle);
shared_ptr<Bundle> data = ie->GetNthData(nth);
if (data.get() == nullptr)
return WATCHFACE_COMPLICATION_ERROR_NO_DATA;
- if (data->GetHandle() != NULL) {
+ if (data->GetHandle() != nullptr) {
*nth_data = bundle_dup(data->GetHandle());
- if (*nth_data == NULL)
+ if (*nth_data == nullptr)
return WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY;
} else {
return WATCHFACE_COMPLICATION_ERROR_NO_DATA;
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL || editable_id == NULL)
+ if (handle == nullptr || editable_id == nullptr)
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
IEditable* ie = static_cast<IEditable*>(handle);
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL || editable_name == NULL)
+ if (handle == nullptr || editable_name == nullptr)
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
IEditable* ie = static_cast<IEditable*>(handle);
if (!ie->GetLabel().empty()) {
*editable_name = strdup(ie->GetLabel().c_str());
- if (*editable_name == NULL) {
+ if (*editable_name == nullptr) {
LOGE("Out of memory");
return WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY;
}
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL || editable_name == NULL)
+ if (handle == nullptr || editable_name == nullptr)
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
IEditable* ie = static_cast<IEditable*>(handle);
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (selected_data == NULL)
+ if (selected_data == nullptr)
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
std::unique_ptr<Bundle> setting_data;
extern "C" EXPORT_API int watchface_editable_candidates_list_create(
complication_candidates_list_h* handle) {
- complication_candidates_list_h h = NULL;
+ complication_candidates_list_h h = nullptr;
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL) {
+ if (handle == nullptr) {
LOGE("Invalid param");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
h = (complication_candidates_list_h)calloc(1,
sizeof(struct complication_candidates_list_));
- if (h == NULL) {
+ if (h == nullptr) {
LOGE("Out of memory");
return WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY;
}
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL || candidate == NULL) {
+ if (handle == nullptr || candidate == nullptr) {
LOGE("Invalid param");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
bundle* dup_candidate = bundle_dup(candidate);
- if (dup_candidate == NULL) {
+ if (dup_candidate == nullptr) {
LOGE("Out of memory");
return WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY;
}
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL) {
+ if (handle == nullptr) {
LOGE("Invalid param");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (container == NULL) {
+ if (container == nullptr) {
LOGE("Invalid param");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
- if (__container == NULL) {
+ if (__container == nullptr) {
LOGE("Container is not ready yet");
return WATCHFACE_COMPLICATION_ERROR_IO_ERROR;
}
extern "C" EXPORT_API int watchface_editable_highlight_create(
watchface_editable_highlight_h* handle,
watchface_editable_shape_type_e shape) {
- watchface_editable_highlight_h h = NULL;
+ watchface_editable_highlight_h h = nullptr;
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL || shape < WATCHFACE_EDITABLE_SHAPE_TYPE_CIRCLE ||
+ if (handle == nullptr || shape < WATCHFACE_EDITABLE_SHAPE_TYPE_CIRCLE ||
WATCHFACE_EDITABLE_SHAPE_TYPE_RECT < shape) {
LOGE("Invalid param");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
h = (watchface_editable_highlight_h)calloc(1,
sizeof(struct editable_highlight_));
- if (h == NULL) {
+ if (h == nullptr) {
LOGE("Out of memory");
return WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY;
}
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL || x < 0 || y < 0 || w < 0 || h < 0) {
+ if (handle == nullptr || x < 0 || y < 0 || w < 0 || h < 0) {
LOGE("Invalid param");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL || x == NULL || y == NULL || w == NULL || h == NULL) {
+ if (handle == nullptr || x == nullptr || y == nullptr || w == nullptr || h == nullptr) {
LOGE("Invalid param");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL
+ if (handle == nullptr
|| shape < WATCHFACE_EDITABLE_SHAPE_TYPE_CIRCLE
|| shape > WATCHFACE_EDITABLE_SHAPE_TYPE_RECT) {
LOGE("Invalid param");
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL || shape == NULL) {
+ if (handle == nullptr || shape == nullptr) {
LOGE("Invalid param");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL) {
+ if (handle == nullptr) {
LOGE("Invalid param");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
if (!watchface_complication::util::CheckWatchFeatureEnabled())
return WATCHFACE_COMPLICATION_ERROR_NOT_SUPPORTED;
- if (handle == NULL || highlight == NULL) {
+ if (handle == nullptr || highlight == nullptr) {
LOGE("Invalid param");
return WATCHFACE_COMPLICATION_ERROR_INVALID_PARAMETER;
}
IEditable* ie = static_cast<IEditable*>(handle);
IEditable::Highlight* info = ie->GetHighlight();
- if (info == NULL) {
+ if (info == nullptr) {
LOGE("editor do not have highlight data");
return WATCHFACE_COMPLICATION_ERROR_NO_DATA;
}
watchface_editable_highlight_h hi = (watchface_editable_highlight_h)
calloc(1, sizeof(struct editable_highlight_));
- if (hi == NULL) {
+ if (hi == nullptr) {
LOGE("Out of Memory");
return WATCHFACE_COMPLICATION_ERROR_OUT_OF_MEMORY;
}