2 * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
\r
4 * Licensed under the Apache License, Version 2.0 (the License);
\r
5 * you may not use this file except in compliance with the License.
\r
6 * You may obtain a copy of the License at
\r
8 * http://www.apache.org/licenses/LICENSE-2.0
\r
10 * Unless required by applicable law or agreed to in writing, software
\r
11 * distributed under the License is distributed on an AS IS BASIS,
\r
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 * See the License for the specific language governing permissions and
\r
14 * limitations under the License.
\r
18 #include <privacy_manager.h>
\r
19 #include <privacy_info.h>
\r
20 #include <privacy_manager_client.h>
\r
21 #include <privacy_manager_client_types.h>
\r
22 #include <privacy_info_client.h>
\r
23 #include <privacy_manager_types_private.h>
\r
25 static int _privacy_info_convert_error(int error)
\r
28 return PRIVACY_MANAGER_ERROR_NONE;
\r
31 int privacy_info_destroy(privacy_info_h privacy_info)
\r
34 if (privacy_info == NULL)
\r
35 return PRIV_MGR_ERROR_INVALID_PARAMETER;
\r
37 if (privacy_info->privacy_info_client)
\r
39 retval = privacy_info_client_s_destroy(privacy_info->privacy_info_client);
\r
40 if (retval != PRIV_MGR_ERROR_SUCCESS)
\r
44 free (privacy_info);
\r
46 return PRIV_MGR_ERROR_SUCCESS;
\r
49 int privacy_info_get_privacy_id(privacy_info_h privacy_info, char **package)
\r
51 int retval = privacy_info_client_get_privacy_id(privacy_info->privacy_info_client, package);
\r
53 return _privacy_info_convert_error(retval);
\r
56 int privacy_info_get_privacy_display_name(struct privacy_info_s* privacy_info, char **name)
\r
58 int retval = privacy_info_client_get_privacy_display_name(privacy_info->privacy_info_client, name);
\r
60 return _privacy_info_convert_error(retval);
\r
63 int privacy_info_get_privacy_description(struct privacy_info_s* privacy_info, char **description)
\r
65 int retval = privacy_info_client_get_privacy_description(privacy_info->privacy_info_client, description);
\r
67 return _privacy_info_convert_error(retval);
\r
70 int privacy_info_is_enabled(struct privacy_info_s* privacy_info, bool *enable)
\r
72 int retval = privacy_info_client_is_enabled(privacy_info->privacy_info_client, enable);
\r
74 return _privacy_info_convert_error(retval);
\r