Fix the problem of not removing the device added to the default user or service
authorsaerome.kim <saerome.kim@samsung.com>
Fri, 8 Nov 2019 06:19:09 +0000 (15:19 +0900)
committersaerome.kim <saerome.kim@samsung.com>
Fri, 8 Nov 2019 10:55:12 +0000 (19:55 +0900)
- Problem: can't remove a device from default-user.
- Cause: A device can be added to a default user or a default service,
  but can not be deleted.
- Solution: Deleting the default user checker.

Change-Id: I7bcce4fd4ac45e411e1be19fb793cf1532d366f7
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
packaging/ua-manager.spec
ua-daemon/src/ua-manager-core.c

index 5031036..d08bf11 100644 (file)
@@ -1,6 +1,6 @@
 Name:       ua-manager
 Summary:    User awareness manager
-Version:    0.12.11
+Version:    0.12.12
 Release:    1
 License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
index 798d343..6eb75b7 100644 (file)
@@ -967,8 +967,6 @@ static int __uam_remove_device(int user_id, uam_db_device_info_t *device,
                                dev_info->device_id, dev_info->type);
                if (UAM_ERROR_NONE != ret) {
                        UAM_ERR("_uam_device_db_delete_device_info failed");
-                       __uam_db_end_transaction(0);
-                       return ret;
                }
        }
        __uam_db_end_transaction(1);
@@ -1489,7 +1487,6 @@ int _uam_core_service_add_user(const char *svc_name, const char *account)
 
        retv_if(NULL == account, UAM_ERROR_INVALID_PARAMETER);
        retv_if(NULL == svc_name, UAM_ERROR_INVALID_PARAMETER);
-       retv_if(0 == g_strcmp0(svc_name, UAM_SERVICE_DEFAULT), UAM_ERROR_PERMISSION_DENIED);
 
        /* Retrieve user from list */
        l = g_slist_find_custom(users, account, __compare_user_account);
@@ -1559,7 +1556,6 @@ int _uam_core_service_remove_user(const char *svc_name, const char *account)
 
        retv_if(NULL == account, UAM_ERROR_INVALID_PARAMETER);
        retv_if(NULL == svc_name, UAM_ERROR_INVALID_PARAMETER);
-       retv_if(0 == g_strcmp0(svc_name, UAM_SERVICE_DEFAULT), UAM_ERROR_PERMISSION_DENIED);
 
        /* Retrieve user from list */
        l = g_slist_find_custom(users, account, __compare_user_account);
@@ -1663,7 +1659,6 @@ int _uam_core_service_add_device(const char *svc_name, const char *device_id, in
        uam_db_service_info_t *service;
 
        retv_if(NULL == svc_name, UAM_ERROR_INVALID_PARAMETER);
-       retv_if(0 == g_strcmp0(svc_name, UAM_SERVICE_DEFAULT), UAM_ERROR_PERMISSION_DENIED);
        retv_if(NULL == device_id, UAM_ERROR_INVALID_PARAMETER);
        retv_if(UAM_TECH_TYPE_NONE >= tech_type, UAM_ERROR_INVALID_PARAMETER);
        retv_if(UAM_TECH_TYPE_MAX <= tech_type, UAM_ERROR_INVALID_PARAMETER);
@@ -1712,7 +1707,6 @@ int _uam_core_service_remove_device(const char *svc_name, const char *device_id,
        retv_if(NULL == device_id, UAM_ERROR_INVALID_PARAMETER);
        retv_if(UAM_TECH_TYPE_NONE >= tech_type, UAM_ERROR_INVALID_PARAMETER);
        retv_if(UAM_TECH_TYPE_MAX <= tech_type, UAM_ERROR_INVALID_PARAMETER);
-       retv_if(0 == g_strcmp0(svc_name, UAM_SERVICE_DEFAULT), UAM_ERROR_PERMISSION_DENIED);
 
        /* Retrieve service from list */
        l = g_slist_find_custom(services, svc_name, __compare_svc_name);