/* flock for writable database */
if (strncmp(db_path, SYSTEM_INFO_DB_RW_PATH, strlen(db_path) + 1) == 0) {
- if (flock(fileno(fp), LOCK_SH) < 0)
- _E("Failed to acquire shared flock, %m");
+ if (flock(fileno(fp), LOCK_SH) < 0) // LCOV_EXCL_LINE
+ _E("Failed to acquire shared flock, %m"); // LCOV_EXCL_LINE
}
key_internal_len = strlen(key_internal);
buffer1 = (char *) calloc(len, sizeof(char));
buffer2 = (char *) calloc(len, sizeof(char));
if (!buffer1 || !buffer2) {
+ // LCOV_EXCL_START
free(buffer1);
free(buffer2);
pthread_mutex_unlock(&fmutex);
return SYSTEM_INFO_ERROR_OUT_OF_MEMORY;
+ // LCOV_EXCL_STOP
}
retval1 = db_search_value(SYSTEM_INFO_DB_RO_PATH, key_internal, buffer1, len);
ret = SYSTEM_INFO_ERROR_NONE;
strncpy(value, buffer1, len);
} else if (retval2 == SYSTEM_INFO_ERROR_NONE) {
- ret = SYSTEM_INFO_ERROR_NONE;
- strncpy(value, buffer2, len);
+ ret = SYSTEM_INFO_ERROR_NONE; // LCOV_EXCL_LINE Currently have no cases that only HAL fature exists
+ strncpy(value, buffer2, len); // LCOV_EXCL_LINE Currently have no cases that only HAL fature exists
} else {
ret = SYSTEM_INFO_ERROR_IO_ERROR;
}
{ SYSTEM_INFO_STRING, STR_TYPE },
};
+// LCOV_EXCL_START Not a public exported API
static int system_info_get_type(enum tag_type tag, const char *key,
system_info_type_e *type)
{
else
return SYSTEM_INFO_ERROR_INVALID_PARAMETER;
}
+// LCOV_EXCL_STOP
static int system_info_get_bool(enum tag_type tag, const char *key, bool *value)
{
return SYSTEM_INFO_ERROR_NONE;
}
}
- _D("Unknown RUNTIME_TYPE, return default value");
+ _D("Unknown RUNTIME_TYPE, return default value"); // LCOV_EXCL_LINE
}
*value = val[runtime[DEFAULT].lang] == 'T' ? true : false;
return SYSTEM_INFO_ERROR_NONE;
}
+ //LCOV_EXCL_START
if (tag == TAG_TYPE_CUSTOM) {
ret = external_get_value(TAG_TYPE_CUSTOM_STR, key, BOOL_TYPE, &valp);
if (ret == SYSTEM_INFO_ERROR_NONE) {
- snprintf(val, sizeof(val), "%s", valp); //LCOV_EXCL_LINE
- free(valp); //LCOV_EXCL_LINE
+ snprintf(val, sizeof(val), "%s", valp);
+ free(valp);
len = strlen(val) + 0;
if (!strncmp(val, "true", len) || !strncmp(val, "TRUE", len))
return SYSTEM_INFO_ERROR_NONE;
}
}
+ //LCOV_EXCL_STOP
_E("Invalid key (%s), type:bool", key);
if (ret == SYSTEM_INFO_ERROR_NONE)
goto out;
+ //LCOV_EXCL_START
if (tag == TAG_TYPE_CUSTOM) {
ret = external_get_value(TAG_TYPE_CUSTOM_STR, key, INT_TYPE, &valp);
if (ret == SYSTEM_INFO_ERROR_NONE) {
- snprintf(val, sizeof(val), "%s", valp); //LCOV_EXCL_LINE
- free(valp); //LCOV_EXCL_LINE
- goto out; //LCOV_EXCL_LINE
+ snprintf(val, sizeof(val), "%s", valp);
+ free(valp);
+ goto out;
}
}
+ //LCOV_EXCL_STOP
_E("Invalid key (%s), type:integer", key);
if (ret == SYSTEM_INFO_ERROR_NONE)
goto out;
+ //LCOV_EXCL_START
if (tag == TAG_TYPE_CUSTOM) {
ret = external_get_value(TAG_TYPE_CUSTOM_STR, key, DBL_TYPE, &valp);
if (ret == SYSTEM_INFO_ERROR_NONE) {
- snprintf(val, sizeof(val), "%s", valp); //LCOV_EXCL_LINE
- free(valp); //LCOV_EXCL_LINE
- goto out; //LCOV_EXCL_LINE
+ snprintf(val, sizeof(val), "%s", valp);
+ free(valp);
+ goto out;
}
}
+ //LCOV_EXCL_STOP
_E("Invalid key (%s), type:double", key);
goto out;
}
+ //LCOV_EXCL_START
if (tag == TAG_TYPE_CUSTOM) {
ret = external_get_value(TAG_TYPE_CUSTOM_STR, key, STR_TYPE, &valp);
if (ret == SYSTEM_INFO_ERROR_NONE) {
- snprintf(val, sizeof(val), "%s", valp); //LCOV_EXCL_LINE
- free(valp); //LCOV_EXCL_LINE
- goto out; //LCOV_EXCL_LINE
+ snprintf(val, sizeof(val), "%s", valp);
+ free(valp);
+ goto out;
}
}
+ //LCOV_EXCL_STOP
_E("Invalid key (%s) type:string", key);
return system_info_get_string(TAG_TYPE_PLATFORM, key, value);
}
+//LCOV_EXCL_START
API int system_info_get_custom_bool(const char *key, bool *value)
{
return system_info_get_bool(TAG_TYPE_CUSTOM, key, value);
{
return system_info_get_string(TAG_TYPE_CUSTOM, key, value);
}
+//LCOV_EXCL_STOP
+//LCOV_EXCL_START Not a pulbic exported API
API int system_info_get_platform_type(const char *key, system_info_type_e *type)
{
return system_info_get_type(TAG_TYPE_PLATFORM, key, type);
}
+//LCOV_EXCL_STOP
+//LCOV_EXCL_START Not a public exported API
API int system_info_get_custom_type(const char *key, system_info_type_e *type)
{
int ret;
return SYSTEM_INFO_ERROR_INVALID_PARAMETER;
}
- //LCOV_EXCL_START
len = strlen(val) + 1;
if (!strncmp(BOOL_TYPE, val, len))
*type = SYSTEM_INFO_BOOL;
free(val);
return SYSTEM_INFO_ERROR_NONE;
- //LCOV_EXCL_STOP
}
+//LCOV_EXCL_STOP