Assign the default app_id for no application process 82/225982/3
authorDoHyun Pyun <dh79.pyun@samsung.com>
Wed, 26 Feb 2020 04:34:00 +0000 (13:34 +0900)
committerKichan Kwon <k_c.kwon@samsung.com>
Mon, 9 Mar 2020 08:24:18 +0000 (17:24 +0900)
Change-Id: I3f93d810df4c30c101acfab23b2375db8746e887
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
plugin/bm-bt-plugin/src/bm_bt_plugin.c

index 79d5dda..7ca6761 100644 (file)
@@ -29,6 +29,8 @@
 #include "bm_bt_util.h"
 #include "bm_log.h"
 
+#define DEFAULT_APPID "Tizen"
+
 /*
  * To get AppID from PID - Needs to be handled by the respective framework owners:
  * The PID might become outdated by the time data is read, which will create problems in mapping the application.
@@ -48,10 +50,13 @@ static char* get_current_appid(int pid, uid_t uid)
 
        ret = aul_app_get_appid_bypid_for_uid(pid, appid, sizeof(appid), uid);
 
-       if (ret < 0)
-               _E("fail to get current appid ret=[%d], appid=%s\n", ret, appid);
+       if (ret < 0) {
+               _E("fail to get current appid ret=[%d]\n", ret);
+               appid_ret = strdup(DEFAULT_APPID);
+       } else {
+               appid_ret = strdup(appid);
+       }
 
-       appid_ret = strdup(appid);
        if (appid_ret == NULL)
                _E("Memory Allocation Failed");