Commit 0a817747 authored by spiiroin's avatar spiiroin

[logging] Add enablers for exposing call stack

When debugging complex issues it can be helpful know also which thread is
emitting the diagnostic message and the code path that led to the situation.

This is meant to be used as a development time debugging feature and thus
requires enabling during build time - otherwise all related code is excluded
from usb-moded binary.
Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
parent 0facd5b1
......@@ -63,6 +63,8 @@ static int android_probed = -1;
static bool
android_write_file(const char *path, const char *text)
{
LOG_REGISTER_CONTEXT;
bool ack = false;
if( !path || !text )
......@@ -86,6 +88,8 @@ EXIT:
bool
android_in_use(void)
{
LOG_REGISTER_CONTEXT;
if( android_probed < 0 )
log_debug("android_in_use() called before android_probe()");
......@@ -95,6 +99,8 @@ android_in_use(void)
static bool
android_probe(void)
{
LOG_REGISTER_CONTEXT;
if( android_probed <= 0 ) {
android_probed = access(ANDROID0_ENABLE, F_OK) == 0;
log_warning("ANDROID0 %sdetected", android_probed ? "" : "not ");
......@@ -108,6 +114,8 @@ android_probe(void)
gchar *
android_get_serial(void)
{
LOG_REGISTER_CONTEXT;
static const char path[] = "/proc/cmdline";
static const char find[] = "androidboot.serialno=";
static const char pbrk[] = " \t\r\n,";
......@@ -157,6 +165,8 @@ EXIT:
bool
android_init_values(void)
{
LOG_REGISTER_CONTEXT;
gchar *text;
if( !android_probe() )
......@@ -217,6 +227,8 @@ EXIT:
bool
android_set_enabled(bool enable)
{
LOG_REGISTER_CONTEXT;
bool ack = false;
if( android_in_use() ) {
const char *val = enable ? "1" : "0";
......@@ -233,6 +245,8 @@ android_set_enabled(bool enable)
bool
android_set_charging_mode(void)
{
LOG_REGISTER_CONTEXT;
bool ack = false;
if( !android_in_use() )
......@@ -262,6 +276,8 @@ EXIT:
bool
android_set_function(const char *function)
{
LOG_REGISTER_CONTEXT;
bool ack = false;
if( !function )
......@@ -293,6 +309,8 @@ EXIT:
bool
android_set_productid(const char *id)
{
LOG_REGISTER_CONTEXT;
bool ack = false;
if( id && android_in_use() ) {
......@@ -316,6 +334,8 @@ android_set_productid(const char *id)
bool
android_set_vendorid(const char *id)
{
LOG_REGISTER_CONTEXT;
bool ack = false;
if( id && android_in_use() ) {
char str[16];
......@@ -338,6 +358,8 @@ android_set_vendorid(const char *id)
bool
android_set_attr(const char *function, const char *attr, const char *value)
{
LOG_REGISTER_CONTEXT;
bool ack = false;
if( function && attr && value && android_in_use() ) {
......
......@@ -64,6 +64,8 @@ static gboolean dbus_connection_disc = FALSE; // got disconnected
static void dbusappsync_release_name(void)
{
LOG_REGISTER_CONTEXT;
/* Drop the service name - if we have it */
if( dbus_connection_ses && dbus_connection_name )
{
......@@ -96,6 +98,8 @@ static void dbusappsync_release_name(void)
static gboolean dbusappsync_obtain_name(void)
{
LOG_REGISTER_CONTEXT;
DBusError error = DBUS_ERROR_INIT;
int ret;
......@@ -150,6 +154,8 @@ EXIT:
static DBusHandlerResult dbusappsync_msg_handler(DBusConnection *const connection, DBusMessage *const msg, gpointer const user_data)
{
LOG_REGISTER_CONTEXT;
DBusHandlerResult status = DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
int type = dbus_message_get_type(msg);
const char *interface = dbus_message_get_interface(msg);
......@@ -221,6 +227,8 @@ IGNORE:
*/
static DBusHandlerResult dbusappsync_handle_disconnect(DBusConnection *conn, DBusMessage *msg, void *user_data)
{
LOG_REGISTER_CONTEXT;
if( dbus_message_is_signal(msg, DBUS_INTERFACE_LOCAL, "Disconnected") )
{
log_warning("disconnected from session bus - expecting restart/stop soon\n");
......@@ -235,6 +243,8 @@ static DBusHandlerResult dbusappsync_handle_disconnect(DBusConnection *conn, DBu
*/
static void dbusappsync_cleanup_connection(void)
{
LOG_REGISTER_CONTEXT;
if( dbus_connection_ses != 0 )
{
/* Remove message filters */
......@@ -259,6 +269,8 @@ static void dbusappsync_cleanup_connection(void)
*/
gboolean dbusappsync_init_connection(void)
{
LOG_REGISTER_CONTEXT;
gboolean result = FALSE;
DBusError error = DBUS_ERROR_INIT;
......@@ -316,6 +328,8 @@ EXIT:
*/
gboolean dbusappsync_init(void)
{
LOG_REGISTER_CONTEXT;
gboolean status = FALSE;
if( !dbusappsync_init_connection() )
......@@ -336,6 +350,8 @@ EXIT:
*/
void dbusappsync_cleanup(void)
{
LOG_REGISTER_CONTEXT;
dbusappsync_cleanup_connection();
// NOP
}
......@@ -345,6 +361,8 @@ void dbusappsync_cleanup(void)
*/
int dbusappsync_launch_app(char *launch)
{
LOG_REGISTER_CONTEXT;
int ret = -1; // assume failure
if( dbus_connection_ses == 0 )
......
......@@ -82,6 +82,8 @@ static int appsync_no_dbus = 1; // always disabled
static void appsync_free_elem(list_elem_t *elem)
{
LOG_REGISTER_CONTEXT;
g_free(elem->name);
g_free(elem->launch);
g_free(elem->mode);
......@@ -90,12 +92,16 @@ static void appsync_free_elem(list_elem_t *elem)
static void appsync_free_elem_cb(gpointer elem, gpointer user_data)
{
LOG_REGISTER_CONTEXT;
(void)user_data;
appsync_free_elem(elem);
}
void appsync_free_appsync_list(void)
{
LOG_REGISTER_CONTEXT;
if( appsync_sync_list != 0 )
{
/*g_list_free_full(appsync_sync_list, appsync_free_elem); */
......@@ -108,11 +114,15 @@ void appsync_free_appsync_list(void)
static gint appsync_list_sort_func(gconstpointer a, gconstpointer b)
{
LOG_REGISTER_CONTEXT;
return strcasecmp( (char*)a, (char*)b );
}
void appsync_read_list(int diag)
{
LOG_REGISTER_CONTEXT;
GDir *confdir = 0;
const gchar *dirname;
......@@ -160,6 +170,8 @@ cleanup:
static list_elem_t *appsync_read_file(const gchar *filename, int diag)
{
LOG_REGISTER_CONTEXT;
gchar *full_filename = NULL;
GKeyFile *settingsfile = NULL;
list_elem_t *list_item = NULL;
......@@ -215,6 +227,8 @@ cleanup:
/* @return 0 on succes, 1 if there is a failure */
int appsync_activate_sync(const char *mode)
{
LOG_REGISTER_CONTEXT;
GList *iter;
int count = 0;
......@@ -316,6 +330,8 @@ error:
int appsync_activate_sync_post(const char *mode)
{
LOG_REGISTER_CONTEXT;
GList *iter;
log_debug("activate post sync");
......@@ -374,6 +390,8 @@ error:
int appsync_mark_active(const gchar *name, int post)
{
LOG_REGISTER_CONTEXT;
int ret = -1; // assume name not found
int missing = 0;
......@@ -417,6 +435,8 @@ int appsync_mark_active(const gchar *name, int post)
#ifdef APP_SYNC_DBUS
static gboolean appsync_enumerate_usb_cb(gpointer data)
{
LOG_REGISTER_CONTEXT;
(void)data;
appsync_enumerate_usb_id = 0;
log_debug("handling enumeration timeout");
......@@ -427,6 +447,8 @@ static gboolean appsync_enumerate_usb_cb(gpointer data)
static void appsync_start_enumerate_usb_timer(void)
{
LOG_REGISTER_CONTEXT;
log_debug("scheduling enumeration timeout");
if( appsync_enumerate_usb_id )
g_source_remove(appsync_enumerate_usb_id), appsync_enumerate_usb_id = 0;
......@@ -441,6 +463,8 @@ static void appsync_start_enumerate_usb_timer(void)
static void appsync_cancel_enumerate_usb_timer(void)
{
LOG_REGISTER_CONTEXT;
if( appsync_enumerate_usb_id )
{
log_debug("canceling enumeration timeout");
......@@ -450,6 +474,8 @@ static void appsync_cancel_enumerate_usb_timer(void)
static void appsync_enumerate_usb(void)
{
LOG_REGISTER_CONTEXT;
struct timeval tv;
log_debug("Enumerating");
......@@ -469,6 +495,8 @@ static void appsync_enumerate_usb(void)
void appsync_stop_apps(int post)
{
LOG_REGISTER_CONTEXT;
GList *iter = 0;
for( iter = appsync_sync_list; iter; iter = g_list_next(iter) )
......@@ -487,6 +515,8 @@ void appsync_stop_apps(int post)
int appsync_stop(gboolean force)
{
LOG_REGISTER_CONTEXT;
/* If force arg is used, stop all applications that
* could have been started by usb-moded */
if(force)
......
......@@ -68,6 +68,8 @@ gchar *common_get_mode_list (mode_list_type_t type);
const char *cable_state_repr(cable_state_t state)
{
LOG_REGISTER_CONTEXT;
static const char * const lut[CABLE_STATE_NUMOF] = {
[CABLE_STATE_UNKNOWN] = "unknown",
[CABLE_STATE_DISCONNECTED] = "disconnected",
......@@ -159,6 +161,8 @@ static const modemapping_t common_modemapping[] =
const char *
common_map_mode_to_hardware(const char *internal_mode)
{
LOG_REGISTER_CONTEXT;
const char *hardware_mode = 0;
for( size_t i = 0; common_modemapping[i].internal_mode; ++i ) {
......@@ -173,6 +177,8 @@ common_map_mode_to_hardware(const char *internal_mode)
const char *
common_map_mode_to_external(const char *internal_mode)
{
LOG_REGISTER_CONTEXT;
const char *external_mode = 0;
for( size_t i = 0; common_modemapping[i].internal_mode; ++i ) {
......@@ -192,6 +198,8 @@ common_map_mode_to_external(const char *internal_mode)
*/
void common_send_supported_modes_signal(void)
{
LOG_REGISTER_CONTEXT;
gchar *mode_list = common_get_mode_list(SUPPORTED_MODES_LIST);
umdbus_send_supported_modes_signal(mode_list);
g_free(mode_list);
......@@ -201,6 +209,8 @@ void common_send_supported_modes_signal(void)
*/
void common_send_available_modes_signal(void)
{
LOG_REGISTER_CONTEXT;
gchar *mode_list = common_get_mode_list(AVAILABLE_MODES_LIST);
umdbus_send_available_modes_signal(mode_list);
g_free(mode_list);
......@@ -210,6 +220,8 @@ void common_send_available_modes_signal(void)
*/
void common_send_hidden_modes_signal(void)
{
LOG_REGISTER_CONTEXT;
gchar *mode_list = config_get_hidden_modes();
umdbus_send_hidden_modes_signal(mode_list);
g_free(mode_list);
......@@ -219,6 +231,8 @@ void common_send_hidden_modes_signal(void)
*/
void common_send_whitelisted_modes_signal(void)
{
LOG_REGISTER_CONTEXT;
gchar *mode_list = config_get_mode_whitelist();
umdbus_send_whitelisted_modes_signal(mode_list);
g_free(mode_list);
......@@ -237,6 +251,8 @@ void common_send_whitelisted_modes_signal(void)
*/
static void common_write_to_sysfs_file(const char *path, const char *text)
{
LOG_REGISTER_CONTEXT;
int fd = -1;
if (!path || !text)
......@@ -276,6 +292,8 @@ EXIT:
*/
void common_acquire_wakelock(const char *wakelock_name)
{
LOG_REGISTER_CONTEXT;
char buff[256];
snprintf(buff, sizeof buff, "%s %lld",
wakelock_name,
......@@ -293,6 +311,8 @@ void common_acquire_wakelock(const char *wakelock_name)
*/
void common_release_wakelock(const char *wakelock_name)
{
LOG_REGISTER_CONTEXT;
#if VERBOSE_WAKELOCKING
log_debug("common_release_wakelock %s", wakelock_name);
#endif
......@@ -310,6 +330,8 @@ int
common_system_(const char *file, int line, const char *func,
const char *command)
{
LOG_REGISTER_CONTEXT;
log_debug("EXEC %s; from %s:%d: %s()",
command, file, line, func);
......@@ -327,6 +349,8 @@ FILE *
common_popen_(const char *file, int line, const char *func,
const char *command, const char *type)
{
LOG_REGISTER_CONTEXT;
log_debug("EXEC %s; from %s:%d: %s()",
command, file, line, func);
......@@ -336,6 +360,8 @@ common_popen_(const char *file, int line, const char *func,
waitres_t
common_wait(unsigned tot_ms, bool (*ready_cb)(void *aptr), void *aptr)
{
LOG_REGISTER_CONTEXT;
struct timespec ts;
waitres_t res = WAIT_FAILED;
......@@ -384,6 +410,8 @@ EXIT:
bool
common_msleep_(const char *file, int line, const char *func, unsigned msec)
{
LOG_REGISTER_CONTEXT;
log_debug("SLEEP %u.%03u seconds; from %s:%d: %s()",
msec / 1000u, msec % 1000u,file, line, func);
return common_wait(msec, 0, 0) == WAIT_TIMEOUT;
......@@ -396,6 +424,8 @@ common_msleep_(const char *file, int line, const char *func, unsigned msec)
/* check if a mode is in a list */
static bool common_mode_in_list(const char *mode, char * const *modes)
{
LOG_REGISTER_CONTEXT;
int i;
if (!modes)
......@@ -417,6 +447,8 @@ static bool common_mode_in_list(const char *mode, char * const *modes)
*/
int common_valid_mode(const char *mode)
{
LOG_REGISTER_CONTEXT;
int valid = 1;
/* MODE_ASK, MODE_CHARGER and MODE_CHARGING_FALLBACK are not modes that are settable seen their special 'internal' status
* so we only check the modes that are announed outside. Only exception is the built in MODE_CHARGING */
......@@ -455,6 +487,8 @@ int common_valid_mode(const char *mode)
*/
gchar *common_get_mode_list(mode_list_type_t type)
{
LOG_REGISTER_CONTEXT;
GString *mode_list_str = g_string_new(NULL);
gchar *hidden_modes_value = 0;
......
......@@ -109,6 +109,8 @@ int config_is_roaming_not_allowed (void);
static int config_validate_ip(const char *ipadd)
{
LOG_REGISTER_CONTEXT;
unsigned int b1, b2, b3, b4;
unsigned char c;
......@@ -125,6 +127,8 @@ static int config_validate_ip(const char *ipadd)
char *config_find_mounts(void)
{
LOG_REGISTER_CONTEXT;
char *ret = NULL;
......@@ -139,52 +143,72 @@ char *config_find_mounts(void)
int config_find_sync(void)
{
LOG_REGISTER_CONTEXT;
return config_get_conf_int(FS_SYNC_ENTRY, FS_SYNC_KEY);
}
char * config_find_alt_mount(void)
{
LOG_REGISTER_CONTEXT;
return config_get_conf_string(ALT_MOUNT_ENTRY, ALT_MOUNT_KEY);
}
char * config_find_udev_path(void)
{
LOG_REGISTER_CONTEXT;
return config_get_conf_string(UDEV_PATH_ENTRY, UDEV_PATH_KEY);
}
char * config_find_udev_subsystem(void)
{
LOG_REGISTER_CONTEXT;
return config_get_conf_string(UDEV_PATH_ENTRY, UDEV_SUBSYSTEM_KEY);
}
char * config_check_trigger(void)
{
LOG_REGISTER_CONTEXT;
return config_get_conf_string(TRIGGER_ENTRY, TRIGGER_PATH_KEY);
}
char * config_get_trigger_subsystem(void)
{
LOG_REGISTER_CONTEXT;
return config_get_conf_string(TRIGGER_ENTRY, TRIGGER_UDEV_SUBSYSTEM);
}
char * config_get_trigger_mode(void)
{
LOG_REGISTER_CONTEXT;
return config_get_conf_string(TRIGGER_ENTRY, TRIGGER_MODE_KEY);
}
char * config_get_trigger_property(void)
{
LOG_REGISTER_CONTEXT;
return config_get_conf_string(TRIGGER_ENTRY, TRIGGER_PROPERTY_KEY);
}
char * config_get_trigger_value(void)
{
LOG_REGISTER_CONTEXT;
return config_get_conf_string(TRIGGER_ENTRY, TRIGGER_PROPERTY_VALUE_KEY);
}
static char * config_get_network_ip(void)
{
LOG_REGISTER_CONTEXT;
char * ip = config_get_kcmdline_string(NETWORK_IP_KEY);
if (ip != NULL)
if(!config_validate_ip(ip))
......@@ -195,11 +219,15 @@ static char * config_get_network_ip(void)
static char * config_get_network_interface(void)
{
LOG_REGISTER_CONTEXT;
return config_get_conf_string(NETWORK_ENTRY, NETWORK_INTERFACE_KEY);
}
static char * config_get_network_gateway(void)
{
LOG_REGISTER_CONTEXT;
char * gw = config_get_kcmdline_string(NETWORK_GATEWAY_KEY);
if (gw != NULL)
return gw;
......@@ -209,6 +237,8 @@ static char * config_get_network_gateway(void)
static char * config_get_network_netmask(void)
{
LOG_REGISTER_CONTEXT;
char * netmask = config_get_kcmdline_string(NETWORK_NETMASK_KEY);
if (netmask != NULL)
return netmask;
......@@ -218,12 +248,16 @@ static char * config_get_network_netmask(void)
static char * config_get_network_nat_interface(void)
{
LOG_REGISTER_CONTEXT;
return config_get_conf_string(NETWORK_ENTRY, NETWORK_NAT_INTERFACE_KEY);
}
/* create basic conffile with sensible defaults */
static void config_create_conf_file(void)
{
LOG_REGISTER_CONTEXT;
GKeyFile *settingsfile;
gchar *keyfile;
int dir = 1;
......@@ -254,6 +288,8 @@ static void config_create_conf_file(void)
static int config_get_conf_int(const gchar *entry, const gchar *key)
{
LOG_REGISTER_CONTEXT;
GKeyFile *settingsfile;
gboolean test = FALSE;
gchar **keys, **origkeys;
......@@ -287,6 +323,8 @@ static int config_get_conf_int(const gchar *entry, const gchar *key)
static char * config_get_conf_string(const gchar *entry, const gchar *key)
{
LOG_REGISTER_CONTEXT;
GKeyFile *settingsfile;
gboolean test = FALSE;
gchar **keys, **origkeys, *tmp_char = NULL;
......@@ -324,6 +362,8 @@ end:
static char * config_get_kcmdline_string(const char *entry)
{
LOG_REGISTER_CONTEXT;
int fd;
char cmdLine[1024];
char *ret = NULL;
......@@ -400,6 +440,8 @@ static char * config_get_kcmdline_string(const char *entry)
char * config_get_mode_setting(void)
{
LOG_REGISTER_CONTEXT;
char *mode = 0;
/* Kernel command line can be used to override settings */
......@@ -425,6 +467,8 @@ EXIT:
*/
int config_value_changed(GKeyFile *settingsfile, const char *entry, const char *key, const char *new_value)
{
LOG_REGISTER_CONTEXT;
char *old_value = g_key_file_get_string(settingsfile, entry, key, NULL);
int changed = (g_strcmp0(old_value, new_value) != 0);
g_free(old_value);
......@@ -433,6 +477,8 @@ int config_value_changed(GKeyFile *settingsfile, const char *entry, const char *
set_config_result_t config_set_config_setting(const char *entry, const char *key, const char *value)
{
LOG_REGISTER_CONTEXT;
GKeyFile *settingsfile;
gboolean test = FALSE;
set_config_result_t ret = SET_CONFIG_ERROR;
......@@ -469,6 +515,8 @@ set_config_result_t config_set_config_setting(const char *entry, const char *key
set_config_result_t config_set_mode_setting(const char *mode)
{
LOG_REGISTER_CONTEXT;
if (strcmp(mode, MODE_ASK) && common_valid_mode(mode))
return SET_CONFIG_ERROR;
return config_set_config_setting(MODE_SETTING_ENTRY, MODE_SETTING_KEY, mode);
......@@ -478,6 +526,8 @@ set_config_result_t config_set_mode_setting(const char *mode)
* new string of hidden modes when adding one, otherwise it will remove one */
static char * config_make_modes_string(const char *key, const char *mode_name, int include)
{
LOG_REGISTER_CONTEXT;
char *modes_new = 0;
char *modes_old = 0;
gchar **modes_arr = 0;
......@@ -537,6 +587,8 @@ static char * config_make_modes_string(const char *key, const char *mode_name, i
set_config_result_t config_set_hide_mode_setting(const char *mode)
{
LOG_REGISTER_CONTEXT;
set_config_result_t ret = SET_CONFIG_UNCHANGED;
char *hidden_modes = config_make_modes_string(MODE_HIDE_KEY, mode, 1);
......@@ -558,6 +610,8 @@ set_config_result_t config_set_hide_mode_setting(const char *mode)
set_config_result_t config_set_unhide_mode_setting(const char *mode)
{
LOG_REGISTER_CONTEXT;
set_config_result_t ret = SET_CONFIG_UNCHANGED;
char *hidden_modes = config_make_modes_string(MODE_HIDE_KEY, mode, 0);
......@@ -579,6 +633,8 @@ set_config_result_t config_set_unhide_mode_setting(const char *mode)
set_config_result_t config_set_mode_whitelist(const char *whitelist)
{
LOG_REGISTER_CONTEXT;
set_config_result_t ret = config_set_config_setting(MODE_SETTING_ENTRY, MODE_WHITELIST_KEY, whitelist);
if(ret == SET_CONFIG_UPDATED) {
......@@ -609,6 +665,8 @@ set_config_result_t config_set_mode_whitelist(const char *whitelist)
set_config_result_t config_set_mode_in_whitelist(const char *mode, int allowed)
{
LOG_REGISTER_CONTEXT;
set_config_result_t ret = SET_CONFIG_UNCHANGED;
char *whitelist = config_make_modes_string(MODE_WHITELIST_KEY, mode, allowed);
......@@ -628,6 +686,8 @@ set_config_result_t config_set_mode_in_whitelist(const char *mode, int allowed)
*/
set_config_result_t config_set_network_setting(const char *config, const char *setting)
{
LOG_REGISTER_CONTEXT;
GKeyFile *settingsfile;
gboolean test = FALSE;
gchar *keyfile;
......@@ -676,6 +736,8 @@ set_config_result_t config_set_network_setting(const char *config, const char *s
char * config_get_network_setting(const char *config)
{
LOG_REGISTER_CONTEXT;
char * ret = 0;
mode_list_elem_t *data;
......@@ -737,6 +799,8 @@ end:
static void config_merge_key(GKeyFile *dest, GKeyFile *srce,
const char *grp, const char *key)
{
LOG_REGISTER_CONTEXT;
gchar *val = g_key_file_get_value(srce, grp, key, 0);
if( val ) {
log_debug("[%s] %s = %s", grp, key, val);
......@@ -755,6 +819,8 @@ static void config_merge_key(GKeyFile *dest, GKeyFile *srce,
static void config_merge_group(GKeyFile *dest, GKeyFile *srce,
const char *grp)
{
LOG_REGISTER_CONTEXT;
gchar **key = g_key_file_get_keys(srce, grp, 0, 0);
if( key ) {
for( size_t i = 0; key[i]; ++i )
......@@ -771,6 +837,8 @@ static void config_merge_group(GKeyFile *dest, GKeyFile *srce,
*/
static void config_merge_file(GKeyFile *dest, GKeyFile *srce)
{
LOG_REGISTER_CONTEXT;
gchar **grp = g_key_file_get_groups(srce, 0);
if( grp ) {
......@@ -790,6 +858,8 @@ static void config_merge_file(GKeyFile *dest, GKeyFile *srce)
*/
static int config_glob_error_cb(const char *path, int err)
{
LOG_REGISTER_CONTEXT;
log_debug("%s: glob: %s", path, g_strerror(err));
return 0;
}
......@@ -801,6 +871,8 @@ static int config_glob_error_cb(const char *path, int err)
*/
static GKeyFile *config_read_ini_files(void)
{
LOG_REGISTER_CONTEXT;
static const char pattern[] = CONFIG_FILE_DIR"/*.ini";
GKeyFile *ini = g_key_file_new();
......@@ -842,6 +914,8 @@ exit:
*/
int config_merge_conf_file(void)
{
LOG_REGISTER_CONTEXT;
GString *keyfile_string = NULL;
GKeyFile *settingsfile,*tempfile;
int ret = 0;
......@@ -881,6 +955,8 @@ out:
char * config_get_android_manufacturer(void)
{
LOG_REGISTER_CONTEXT;
#ifdef USE_MER_SSU
/* If SSU can provide manufacturer name, use it. Otherwise fall
* back to using the name specified in configuration files. */
......@@ -896,11 +972,15 @@ char * config_get_android_manufacturer(void)
char * config_get_android_vendor_id(void)
{
LOG_REGISTER_CONTEXT;
return config_get_conf_string(ANDROID_ENTRY, ANDROID_VENDOR_ID_KEY);
}
char * config_get_android_product(void)
{
LOG_REGISTER_CONTEXT;
#ifdef USE_MER_SSU
/* If SSU can provide device model name, use it. Otherwise fall
* back to using the name specified in configuration files. */
......@@ -916,19 +996,27 @@ char * config_get_android_product(void)
char * config_get_android_product_id(void)
{