Privilege Info: Managing Privilege Information
This tutorial demonstrates how you can display privilege information, such as the name and description of a given privilege.
Warm-up
Become familiar with the Privilege Info API basics by learning about:
-
Getting Privilege Information
Get privilege information, such as the display name and description of a privilege.
Getting Privilege Information
To get privilege display information:
-
To use the functions and data types of the Privilege Info API (in mobile and wearable applications), include the <privilege_information.h> header file in your application:
#include <privilege_information.h>
- To get various privilege information:
- Get the privilege display name using the privilege_info_get_display_name() function:
char* displayName = NULL; int retVal = privilege_info_get_display_name("2.2", "http://tizen.org/privilege/application.launch", &displayName);
The function takes the following parameters:
- API version
- Privilege name
- Privilege display name
- Get the privilege display name by package type using the privilege_info_get_display_name_by_pkgtype() function:
char* displayName = NULL; int retVal = privilege_info_get_display_name_by_pkgtype("PRVINFO_PACKAGE_TYPE_WEB", "2.2", "http://tizen.org/privilege/application.launch", &displayName);
The function takes the following parameters:
- Package type
- API version
- Privilege name
- Privilege display name
- Get the privilege description using the privilege_info_get_description() function:
char* description = NULL; int retVal = privilege_info_get_description("2.2", "http://tizen.org/privilege/application.launch", &description);
The function takes the following parameters:
- API version
- Privilege name
- Description of the privilege
- Get the privilege description by package type using the privilege_info_get_description_by_pkgtype() function:
char* description = NULL; int retVal = privilege_info_get_description_by_pkgtype("PRVINFO_PACKAGE_TYPE_WEB", "2.2", "http://tizen.org/privilege/application.launch", &description);
The function takes the following parameters:
- Package type
- API version
- Privilege name
- Description of the privilege
All functions above return the defined privilege_info_error_e enum value that indicates the result of executing the function and provides the privilege description by assigning the matching value to the third parameter.
- Get the privilege display name using the privilege_info_get_display_name() function: