Fix certificate check step in datacontrol noti api 23/127023/1
authorJiwoong Im <jiwoong.im@samsung.com>
Wed, 26 Apr 2017 01:52:53 +0000 (10:52 +0900)
committerJiwoong Im <jiwoong.im@samsung.com>
Wed, 26 Apr 2017 01:52:53 +0000 (10:52 +0900)
Change-Id: If5e9670a469413f676709676fad1200868c1299b
Signed-off-by: Jiwoong Im <jiwoong.im@samsung.com>
src/data_control_noti.c

index f90c87b..860e9d9 100644 (file)
@@ -34,10 +34,8 @@ EXPORT_API int data_control_add_data_change_cb(
        retval = datacontrol_check_cert(provider->provider_id, true, NULL);
        if (retval == DATA_CONTROL_ERROR_PERMISSION_DENIED) {
                retval = datacontrol_check_cert(provider->provider_id, false, NULL);
-               if (retval != DATA_CONTROL_ERROR_NONE)
-                       return retval;
-       } else if (retval != DATA_CONTROL_ERROR_NONE) {
-               return retval;
+               if (retval == DATA_CONTROL_ERROR_PERMISSION_DENIED)
+                       return DATA_CONTROL_ERROR_PERMISSION_DENIED;
        }
 
        return datacontrol_add_data_change_cb(
@@ -63,10 +61,8 @@ EXPORT_API int data_control_remove_data_change_cb(data_control_h provider, int c
        retval = datacontrol_check_cert(provider->provider_id, true, NULL);
        if (retval == DATA_CONTROL_ERROR_PERMISSION_DENIED) {
                retval = datacontrol_check_cert(provider->provider_id, false, NULL);
-               if (retval != DATA_CONTROL_ERROR_NONE)
-                       return retval;
-       } else if (retval != DATA_CONTROL_ERROR_NONE) {
-               return retval;
+               if (retval == DATA_CONTROL_ERROR_PERMISSION_DENIED)
+                       return DATA_CONTROL_ERROR_PERMISSION_DENIED;
        }
 
        return datacontrol_remove_data_change_cb((datacontrol_h)provider, callback_id);