Knox Tizen Wearable SDK
application.h
1 /*
2  * Copyright (c) 2000-2017 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * PROPRIETARY/CONFIDENTIAL
5  *
6  * This software is the confidential and proprietary information of
7  * SAMSUNG ELECTRONICS ("Confidential Information").
8  * You shall not disclose such Confidential Information and shall
9  * use it only in accordance with the terms of the license agreement
10  * you entered into with SAMSUNG ELECTRONICS.
11  * SAMSUNG make no representations or warranties about the suitability
12  * of the software, either express or implied, including but not
13  * limited to the implied warranties of merchantability, fitness for
14  * a particular purpose, or non-infringement.
15  * SAMSUNG shall not be liable for any damages suffered by licensee as
16  * a result of using, modifying or distributing this software or its derivatives.
17  */
18 
19 #ifndef LIBMDM_MDM_APPLICATION_H
20 #define LIBMDM_MDM_APPLICATION_H
21 
22 #include "mdm_client_type.h"
23 #include "stdbool.h"
24 
35 typedef enum _mdm_app_status {
39 
46 typedef struct {
47  char * pkg_name;
48  unsigned int usage;
49 } app_usage_t;
50 
57 typedef struct {
58  char * pkg_name;
59  unsigned long usage;
61 
68 typedef struct {
69  int type;
70  char *pkg_name;
71  long bytes;
73 
80 typedef struct {
81  int client_id;
82  void *list;
84 
85 /*
86  * @brief Type of struct passed as argument to the Application appstore install/update callbacks.
87  * @since_tizen 2.3.2.3
88  */
89 typedef enum {
90  MDM_APPSTORE_STATUS_SUCCESS = TIZEN_ERROR_NONE,
91  MDM_APPSTORE_UNKNOWN_ERROR = TIZEN_ERROR_UNKNOWN,
92  MDM_APPSTORE_APP_NOT_AVAILABLE_ERROR = TIZEN_ERROR_INVALID_PARAMETER,
93  MDM_APPSTORE_APP_ALREADY_UPDATED = TIZEN_ERROR_PACKAGE_MANAGER | 0x73,
94  MDM_APPSTORE_SERVER_RESPONSE_ERROR = TIZEN_ERROR_CONNECTION_TIME_OUT,
95  MDM_APPSTORE_CONNECTION_ERROR = TIZEN_ERROR_NETWORK_UNREACHABLE,
96  MDM_APPSTORE_APP_DOWNLOAD_ERROR = TIZEN_ERROR_DOWNLOAD,
97  MDM_APPSTORE_APP_INSTALL_ERROR = TIZEN_ERROR_PACKAGE_MANAGER,
98  MDM_APPSTORE_APP_NOT_FOUND_ON_DEVICE = TIZEN_ERROR_APPLICATION | 0x21,
99  MDM_APPSTORE_APP_ALREADY_INSTALLED = TIZEN_ERROR_PACKAGE_MANAGER | 0x72,
100 } mdm_appstore_error_e;
101 
102 /*
103  * @brief Type of struct passed as argument to the Application appstore install/update callbacks.
104  * @since_tizen 2.3.2.3
105  * @see mdm_install_application_by_url
106  * @see mdm_update_application_by_url
107  */
108 typedef struct {
109  mdm_appstore_error_e error_code;
110  char * error_description;
111  char * app_name;
112 } mdm_appstore_error_info_s;
113 
114 #ifdef __cplusplus
115 extern "C" {
116 #endif
117 
118 
163 mdm_result_t mdm_install_application(const char *pkg_path);
164 
210 mdm_result_t mdm_update_application(const char *pkg_path);
211 
258 mdm_result_t mdm_disable_application(const char *pkg_name);
259 
304 mdm_result_t mdm_enable_application(const char *pkg_name);
305 
349 mdm_result_t mdm_uninstall_application(const char *pkg_name);
350 
384 mdm_status_t mdm_get_application_state(const char *pkg_name);
385 
437 mdm_data_t *mdm_uninstall_applications(GList *pkg_list);
438 
488 
535 
589 
637 
684 
732 
782 mdm_result_t mdm_set_application_state(const char *pkg_name, mdm_app_status_t state);
783 
784 /*
785  * @brief API to check if any of privileges on the list is blocked.
786  *
787  * @since_mdm 1.1.0
788  * @since_tizen 2.3.2.3
789  *
790  * @feature %http://developer.samsung.com/tizen/feature/mdm
791  *
792  * @par Usage:
793  * The function takes a GList argument containing a set of privileges that are checked.
794  * If any of them is blocked MDM_TRUE is returned.
795  * If all of them are unblocked MDM_FALSE is returned.
796  * In case when NULL-list is passed or another error happened MDM_STATUS_ERROR is returned.
797  *
798  * @code{.c}
799 
800  GList *privilege_list = NULL;
801  privilege_list = g_list_append(privilege_list, "http://developer.samsung.com/tizen/privilege/mdm.misc");
802  privilege_list = g_list_append(privilege_list, "http://developer.samsung.com/tizen/privilege/mdm.restriction");
803  privilege_list = g_list_append(privilege_list, "http://developer.samsung.com/tizen/privilege/mdm.kiosk");
804 
805  mdm_status_t stat = mdm_is_app_privilege_blocked(privilege_list);
806 
807  if (stat == MDM_TRUE)
808  {
809  // At least one of the privileges is blocked.
810  }
811  else if (stat == MDM_FALSE)
812  {
813  // All of the privileges are not blocked.
814  }
815  else
816  {
817  // Error occured.
818  }
819 
820  g_list_free(privilege_list);
821 
822  * @endcode
823  *
824  * @param[in] privilege_list GList contaning strings with privileges to be examined.
825  *
826  * @return #mdm_status_t : One of below values:
827  *
828  * @retval @c #MDM_TRUE At least one of the privileges is blocked
829  * @retval @c #MDM_FALSE All privileges are not blocked
830  * @retval @c #MDM_STATUS_ERROR An error occured
831  *
832  * @see mdm_get_app_blocked_privileges
833  */
834 mdm_status_t mdm_is_app_privilege_blocked(GList *privilege_list);
835 
836 /*
837  * @brief API to check if a given signature is blocked.
838  *
839  * @since_mdm 1.1.0
840  * @since_tizen 2.3.2.3
841  *
842  * @feature %http://developer.samsung.com/tizen/feature/mdm
843  *
844  * @par Usage:
845  * The function takes a string argument containing a signature which is checked.
846  * If signature is blocked MDM_TRUE is returned.
847  * If signature is unblocked MDM_FALSE is returned.
848  * In case when NULL-string is passed or another error happened MDM_STATUS_ERROR is returned.
849  *
850  * @code{.c}
851 
852  mdm_status_t stat = mdm_is_app_signature_blocked("com.samsung.ebook");
853 
854  if (stat == MDM_TRUE)
855  {
856  // The signaturee is blocked.
857  }
858  else if (stat == MDM_FALSE)
859  {
860  // The signature is not blocked.
861  }
862  else
863  {
864  // Error occured.
865  }
866 
867  * @endcode
868  *
869  * @param[in] signature Signature to be examined.
870  *
871  * @return #mdm_status_t : One of below values:
872  *
873  * @retval @c #MDM_TRUE signature is blocked
874  * @retval @c #MDM_FALSE Signature is not blocked
875  * @retval @c #MDM_STATUS_ERROR An error occured
876  *
877  * @see mdm_get_app_blocked_signatures
878  */
879 mdm_status_t mdm_is_app_signature_blocked(const char *signature);
880 
920 mdm_status_t mdm_is_application_installed(const char *pkg_name);
921 
957 mdm_status_t mdm_is_application_running(const char *app_id);
958 
1000 mdm_data_t *mdm_get_application_name(const char *pkg_name);
1001 
1042 mdm_data_t *mdm_get_application_version(const char *pkg_name);
1043 
1094 
1095 
1133 mdm_result_t mdm_start_application(const char *app_id);
1134 
1171 mdm_result_t mdm_stop_application(const char *app_id);
1172 
1235 
1275 
1331 
1368 
1404 mdm_data_t *mdm_get_application_code_size(const char *pkg_name);
1405 
1441 mdm_data_t *mdm_get_application_data_size(const char *pkg_name);
1442 
1479 mdm_data_t *mdm_get_application_total_size(const char *pkg_name);
1480 
1517 mdm_result_t mdm_get_application_memory_usage(const char *app_id, unsigned int *usage);
1518 
1557 mdm_result_t mdm_get_application_cpu_usage(const char *app_id, unsigned long *usage);
1558 
1616 mdm_data_t *mdm_get_most_cpu_usage_apps(int appCount, mdm_status_t showAllProcess);
1617 
1672 mdm_data_t *mdm_get_most_memory_usage_apps(int appCount, mdm_status_t showAllProcess);
1673 
1726 MDM_DEPRECATED_API mdm_data_t *mdm_get_most_data_usage_apps(int appCount);
1727 
1728 /*
1729  * @brief API to add a privilege to the application privilege blacklist.
1730  *
1731  * @since_mdm 1.0.0
1732  *
1733  * @since_tizen 2.3.2.3
1734  *
1735  * @feature %http://developer.samsung.com/tizen/feature/mdm
1736  *
1737  * @par Usage:
1738  * Use this API to blacklist third party applications based on the privileges
1739  * requested by those applications.
1740  * Applications with matching privileges will be prevented from being installed.
1741  * This will not affect existing third party applications that have blacklisted
1742  * privileges.
1743  *
1744  * @remarks
1745  * The privilege name is added to the installation blacklist and treated as Perl-compatible regular expression
1746  * (refer to http://www.pcre.org for more details).
1747  *
1748  *
1749  * @code{.c}
1750  mdm_result_t ret = mdm_add_app_privilege_to_blacklist("http://tizen.org/privilege/camera");
1751  if (ret == MDM_RESULT_SUCCESS) {
1752  // Successfully added
1753  } else {
1754  // Failed to add
1755  }
1756 
1757  * @endcode
1758  *
1759  * @privlevel public
1760  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.application
1761  *
1762  * @param[in] appPermission The application privilege to add to the blacklist.
1763  *
1764  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
1765  *
1766  * @retval #MDM_RESULT_SUCCESS Successful
1767  * @retval #MDM_RESULT_FAIL General failure
1768  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
1769  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
1770  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
1771  *
1772  * @par Permission:
1773  * Usage of this API is restricted to registered clients only.
1774  *
1775  * @see mdm_remove_app_privilege_from_blacklist
1776  *
1777  */
1778 mdm_result_t mdm_add_app_privilege_to_blacklist(const char *appPermission);
1779 
1780 /*
1781  * @brief API to remove a privilege from the application privilege blacklist.
1782  *
1783  * @since_mdm 1.0.0
1784  *
1785  * @since_tizen 2.3.2.3
1786  *
1787  * @feature %http://developer.samsung.com/tizen/feature/mdm
1788  *
1789  * @par Usage:
1790  * Use this API to remove application privileges from the blacklist.
1791  *
1792  * @code{.c}
1793  mdm_result_t ret = mdm_remove_app_privilege_from_blacklist("http://tizen.org/privilege/camera");
1794  if (ret == MDM_RESULT_SUCCESS) {
1795  // Removed the privilege from the blacklist
1796  } else {
1797  // Failed to remove the privilege
1798  }
1799 
1800  * @endcode
1801  *
1802  * @privlevel public
1803  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.application
1804  *
1805  * @param[in] appPermission The application privilege to remove from the
1806  * blacklist.
1807  *
1808  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
1809  *
1810  * @retval #MDM_RESULT_SUCCESS Successful
1811  * @retval #MDM_RESULT_FAIL General failure
1812  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
1813  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
1814  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
1815  *
1816  * @par Permission:
1817  * Usage of this API is restricted to registered clients only.
1818  *
1819  * @see mdm_add_app_privilege_to_blacklist
1820  *
1821  */
1822 mdm_result_t mdm_remove_app_privilege_from_blacklist(const char *appPermission);
1823 
1824 /*
1825  * @brief API to add a privilege to the application privilege whitelist.
1826  *
1827  * @since_mdm 1.0.0
1828  *
1829  * @since_tizen 2.3.2.3
1830  *
1831  * @feature %http://developer.samsung.com/tizen/feature/mdm
1832  *
1833  * @par Usage:
1834  * Use this API to whitelist third party applications based on the privileges
1835  * requested by those applications.
1836  * Applications with matching privileges will be allowed to be installed on the device.
1837  * Whitelist takes precedence over the blacklist so if applications with matching privilege
1838  * are already in the blacklist then the installation is allowed.
1839  *
1840  * @remarks
1841  * The privilege is added to the installation whitelist and treated as Perl-compatible regular expression
1842  * (refer to http://www.pcre.org for more details). An application with a matching privilege in the whitelist
1843  * is an exception to the configured privilege blacklist and therefore will be allowed to be installed.
1844  * Installation is not forbidden as long as the privilege (matching regex-pattern) is not added to the blacklist.
1845  *
1846  * @code{.c}
1847  mdm_result_t ret = mdm_add_app_privilege_to_whitelist("http://tizen.org/privilege/camera");
1848  if (ret == MDM_RESULT_SUCCESS) {
1849  // Successfully added
1850  } else {
1851  // Failed to add
1852  }
1853 
1854  * @endcode
1855  *
1856  * @privlevel public
1857  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.application
1858  *
1859  * @param[in] app_permission The application privilege to add to the whitelist.
1860  *
1861  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
1862  *
1863  * @retval #MDM_RESULT_SUCCESS Successful
1864  * @retval #MDM_RESULT_FAIL General failure
1865  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
1866  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
1867  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
1868  *
1869  * @par Permission:
1870  * Usage of this API is restricted to registered clients only.
1871  *
1872  * @see mdm_remove_app_privilege_from_whitelist
1873  *
1874  */
1875 mdm_result_t mdm_add_app_privilege_to_whitelist(const char *app_permission);
1876 
1877 /*
1878  * @brief API to remove a privilege from the application privilege whitelist.
1879  *
1880  * @since_mdm 1.0.0
1881  *
1882  * @since_tizen 2.3.2.3
1883  *
1884  * @feature %http://developer.samsung.com/tizen/feature/mdm
1885  *
1886  * @par Usage:
1887  * Use this API to remove application privileges from the whitelist.
1888  *
1889  * @code{.c}
1890  mdm_result_t ret = mdm_remove_app_privilege_from_whitelist("http://tizen.org/privilege/camera");
1891  if (ret == MDM_RESULT_SUCCESS) {
1892  // Removed the privilege from the blacklist
1893  } else {
1894  // Failed to remove the privilege
1895  }
1896 
1897  * @endcode
1898  *
1899  * @privlevel public
1900  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.application
1901  *
1902  * @param[in] app_permission The application privilege to remove from the
1903  * whitelist.
1904  *
1905  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
1906  *
1907  * @retval #MDM_RESULT_SUCCESS Successful
1908  * @retval #MDM_RESULT_FAIL General failure
1909  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
1910  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
1911  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
1912  *
1913  * @par Permission:
1914  * Usage of this API is restricted to registered clients only.
1915  *
1916  * @see mdm_add_app_privilege_to_whitelist
1917  *
1918  */
1919 mdm_result_t mdm_remove_app_privilege_from_whitelist(const char *app_permission);
1920 
1921 /*
1922  * @brief API to add a signature to the application signature blacklist.
1923  *
1924  * @since_mdm 1.0.0
1925  *
1926  * @since_tizen 2.3.2.3
1927  *
1928  * @feature %http://developer.samsung.com/tizen/feature/mdm
1929  *
1930  * @par Usage:
1931  * Use this API to blacklist third party applications based on the signatures of
1932  * those applications.
1933  * Applications that have matching signatures will be prevented from being
1934  * installed. This will not affect existing third party applications that have
1935  * blacklisted signatures.
1936  *
1937  * @remarks
1938  * The administrator can use wildcard character "*" instead of specifying a signature
1939  *
1940  * @code{.c}
1941  mdm_result_t ret = mdm_add_app_signature_to_blacklist("sckQjBcGhFQFHc9p3knEkBVecd...");
1942  if (ret == MDM_RESULT_SUCCESS) {
1943  // Successfully added
1944  } else {
1945  // Failed to add
1946  }
1947 
1948  * @endcode
1949  *
1950  * @privlevel public
1951  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.application
1952  *
1953  * @param[in] appSignature The application signature to add to the blacklist.
1954  *
1955  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
1956  *
1957  * @retval #MDM_RESULT_SUCCESS Successful
1958  * @retval #MDM_RESULT_FAIL General failure
1959  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
1960  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
1961  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
1962  *
1963  * @par Permission:
1964  * Usage of this API is restricted to registered clients only.
1965  *
1966  * @see mdm_remove_app_signature_from_blacklist
1967  *
1968  */
1969 mdm_result_t mdm_add_app_signature_to_blacklist(const char *appSignature);
1970 
1971 /*
1972  * @brief API to remove a signature from the application signature blacklist.
1973  *
1974  * @since_mdm 1.0.0
1975  *
1976  * @since_tizen 2.3.2.3
1977  *
1978  * @feature %http://developer.samsung.com/tizen/feature/mdm
1979  *
1980  * @par Usage:
1981  * Use this API to remove an application signature from the blacklist.
1982  * Applications with a matching signature are now allowed to be installed.
1983  *
1984  * @code{.c}
1985  mdm_result_t ret = mdm_remove_app_signature_from_blacklist("sckQjBcGhFQFHc9p3knEkBVecd...");
1986  if (ret == MDM_RESULT_SUCCESS) {
1987  // Successfully removed
1988  } else {
1989  // Failed to remove
1990  }
1991 
1992  * @endcode
1993  *
1994  * @privlevel public
1995  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.application
1996  *
1997  * @param[in] appSignature The application signature to remove from the
1998  * blacklist.
1999  *
2000  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
2001  *
2002  * @retval #MDM_RESULT_SUCCESS Successful
2003  * @retval #MDM_RESULT_FAIL General failure
2004  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
2005  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
2006  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
2007  *
2008  * @par Permission:
2009  * Usage of this API is restricted to registered clients only.
2010  *
2011  * @see mdm_add_app_signature_to_blacklist
2012  *
2013  */
2014 mdm_result_t mdm_remove_app_signature_from_blacklist(const char *appSignature);
2015 
2016 /*
2017  * @brief API to add a signature to the application signature whitelist.
2018  *
2019  * @since_mdm 1.0.0
2020  *
2021  * @since_tizen 2.3.2.3
2022  *
2023  * @feature %http://developer.samsung.com/tizen/feature/mdm
2024  *
2025  * @par Usage:
2026  * Use this API to whitelist third party applications based on the signatures of
2027  * those applications.
2028  * Applications that have matching signatures will be allowed to be installed on the device.
2029  * Whitelist takes precedence over the blacklist so if applications with matching signatures
2030  * are already in the blacklist then the installation is allowed.
2031  *
2032  * @code{.c}
2033  mdm_result_t ret = mdm_add_app_signature_to_whitelist("sckQjBcGhFQFHc9p3knEkBVecd...");
2034  if (ret == MDM_RESULT_SUCCESS) {
2035  // Successfully added
2036  } else {
2037  // Failed to add
2038  }
2039 
2040  * @endcode
2041  *
2042  * @privlevel public
2043  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.application
2044  *
2045  * @param[in] app_signature The application signature to add to the whitelist.
2046  *
2047  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
2048  *
2049  * @retval #MDM_RESULT_SUCCESS Successful
2050  * @retval #MDM_RESULT_FAIL General failure
2051  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
2052  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
2053  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
2054  *
2055  * @par Permission:
2056  * Usage of this API is restricted to registered clients only.
2057  *
2058  * @see mdm_remove_app_signature_from_whitelist
2059  *
2060  */
2061 mdm_result_t mdm_add_app_signature_to_whitelist(const char *app_signature);
2062 
2063 /*
2064  * @brief API to remove a signature from the application signature whitelist.
2065  *
2066  * @since_mdm 1.0.0
2067  *
2068  * @since_tizen 2.3.2.3
2069  *
2070  * @feature %http://developer.samsung.com/tizen/feature/mdm
2071  *
2072  * @par Usage:
2073  * Use this API to remove an application signature from the whitelist.
2074  *
2075  * @code{.c}
2076  mdm_result_t ret = mdm_remove_app_signature_from_whitelist("sckQjBcGhFQFHc9p3knEkBVecd...");
2077  if (ret == MDM_RESULT_SUCCESS) {
2078  // Successfully removed
2079  } else {
2080  // Failed to remove
2081  }
2082 
2083  * @endcode
2084  *
2085  * @privlevel public
2086  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.application
2087  *
2088  * @param[in] app_signature The application signature to remove from the
2089  * whitelist.
2090  *
2091  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
2092  *
2093  * @retval #MDM_RESULT_SUCCESS Successful
2094  * @retval #MDM_RESULT_FAIL General failure
2095  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
2096  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
2097  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
2098  *
2099  * @par Permission:
2100  * Usage of this API is restricted to registered clients only.
2101  *
2102  * @see mdm_add_app_signature_to_whitelist
2103  *
2104  */
2105 mdm_result_t mdm_remove_app_signature_from_whitelist(const char *app_signature);
2106 
2155 
2210 
2257 
2301 
2344 
2388 
2445 
2481 
2526 
2569 
2612 
2613 /*
2614  * @brief API to get the list of blacklisted application privileges.
2615  *
2616  * @since_mdm 1.1.0
2617  *
2618  * @since_tizen 2.3.1.5
2619  *
2620  * @feature %http://developer.samsung.com/tizen/feature/mdm
2621  *
2622  * @par Usage:
2623  * Use this API to get the list of privileges that are blacklisted.
2624  * The applications with matching privileges will be prevented from being installed.
2625  *
2626  * @code{.c}
2627  mdm_data_t *lp_data = mdm_get_app_privilege_blacklist();
2628  if (lp_data){
2629  // success
2630  GList *blacklist = (GList *)lp_data->data;
2631  while(blacklist) {
2632  char *privlege = (char *)blacklist->data;
2633  // check privilege and block installation
2634  blacklist = g_list_next(blacklist);
2635  }
2636 
2637  // Free after use
2638  mdm_free_data(lp_data);
2639  } else {
2640  // fail
2641  }
2642 
2643  * @endcode
2644  *
2645  * @return A list that contains all of the blacklisted privileges for the
2646  * calling admin, if successful. Otherwise, return NULL.
2647  *
2648  * @see mdm_add_app_privilege_to_blacklist, mdm_remove_app_privilege_from_blacklist,
2649  mdm_get_app_privilege_all_blacklists
2650  *
2651  */
2652 mdm_data_t *mdm_get_app_privilege_blacklist(void);
2653 
2654 /*
2655  * @brief API to get the list of whitelisted application privileges.
2656  *
2657  * @since_mdm 1.1.0
2658  *
2659  * @since_tizen 2.3.2.3
2660  *
2661  * @feature %http://developer.samsung.com/tizen/feature/mdm
2662  *
2663  * @par Usage:
2664  * Use this API to get the list of privileges that are whitelisted.
2665  * The applications with matching privileges will be allowed to be installed on the device.
2666  *
2667  * @code{.c}
2668  mdm_data_t *lp_data = mdm_get_app_privilege_whitelist();
2669  if (lp_data){
2670  // success
2671  GList *whitelist = (GList *)lp_data->data;
2672  while(whitelist) {
2673  char *privlege = (char *)whitelist->data;
2674  // check privilege and allow installation
2675  whitelist = g_list_next(whitelist);
2676  }
2677 
2678  // Free after use
2679  mdm_free_data(lp_data);
2680  } else {
2681  // fail
2682  }
2683 
2684  * @endcode
2685  *
2686  * @return A list that contains all of the whitelisted privileges for the
2687  * calling admin, if successful. Otherwise, return NULL.
2688  *
2689  * @see mdm_add_app_privilege_to_whitelist, mdm_remove_app_privilege_from_whitelist
2690  *
2691  */
2692 mdm_data_t *mdm_get_app_privilege_whitelist(void);
2693 
2694 /*
2695  * @brief API to get the list of blacklisted application signatures.
2696  *
2697  * @since_mdm 1.0.0
2698  *
2699  * @since_tizen 2.3.2.3
2700  *
2701  * @feature %http://developer.samsung.com/tizen/feature/mdm
2702  *
2703  * @par Usage:
2704  * Use this API to get the list of signatures that are blacklisted.
2705  * Applications with matching signatures are prevented from being installed.
2706  *
2707  * @code{.c}
2708  mdm_data_t *lp_data = mdm_get_app_signature_blacklist();
2709  if (lp_data){
2710  // success
2711  GList *blacklist = (GList *)lp_data->data;
2712  while(blacklist) {
2713  char *signature = (char *)blacklist->data;
2714  // check signature and block installation
2715  blacklist = g_list_next(blacklist);
2716  }
2717  // Free after use
2718  mdm_free_data(lp_data);
2719  } else {
2720  // fail
2721  }
2722 
2723  * @endcode
2724  *
2725  * @return A list that contains all of the blacklisted signatures, if
2726  * successful. Otherwise, return NULL.
2727  *
2728  * @see mdm_add_app_signature_to_blacklist, mdm_remove_app_signature_from_blacklist,
2729  mdm_get_app_signature_all_blacklists
2730  *
2731  */
2732 mdm_data_t *mdm_get_app_signature_blacklist(void);
2733 
2734 /*
2735  * @brief API to get the list of whitelisted application signatures.
2736  *
2737  * @since_mdm 1.1.0
2738  *
2739  * @since_tizen 2.3.2.3
2740  *
2741  * @feature %http://developer.samsung.com/tizen/feature/mdm
2742  *
2743  * @par Usage:
2744  * Use this API to get the list of signatures that are whitelisted.
2745  * Applications with matching signatures are allowed to be installed on the device.
2746  *
2747  * @code{.c}
2748  mdm_data_t *lp_data = mdm_get_app_signature_whitelist();
2749  if (lp_data){
2750  // success
2751  GList *whitelist = (GList *)lp_data->data;
2752  while(whitelist) {
2753  char *signature = (char *)whitelist->data;
2754  // check signature and allow installation
2755  whitelist = g_list_next(whitelist);
2756  }
2757  // Free after use
2758  mdm_free_data(lp_data);
2759  } else {
2760  // fail
2761  }
2762 
2763  * @endcode
2764  *
2765  * @return A list that contains all of the whitelisted signatures, if
2766  * successful. Otherwise, return NULL.
2767  *
2768  * @see mdm_add_app_signature_to_whitelist, mdm_remove_app_signature_from_whitelist
2769  *
2770  */
2771 mdm_data_t *mdm_get_app_signature_whitelist(void);
2772 
2773 /*
2774  * @brief API to get the list of blacklisted application package privileges for all admins.
2775  *
2776  * @since_mdm 1.0.0
2777  *
2778  * @since_tizen 2.3.2.3
2779  *
2780  * @feature %http://developer.samsung.com/tizen/feature/mdm
2781  *
2782  * @par Usage:
2783  * Use this API to get the list of privileges that are blacklisted.
2784  * Applications with matching privileges are prevented from being installed.
2785  * Existing applications on the device with matching privileges will not be
2786  * disabled.
2787  *
2788  * @code{.c}
2789  mdm_data_t *lp_data = mdm_get_app_privilege_all_blacklists();
2790 
2791  if(lp_data) {
2792  // success
2793  list = (GList *)lp_data->data;
2794  if(list) {
2795  GList *current = g_list_first(list);
2796  GList *blacklist = NULL;
2797  while(current && current->data) {
2798  app_control_info_t *app_control_info = (app_control_info_t *)current->data;
2799  printf("client_id : %d", app_control_info->client_id);
2800  blacklist = (GList *)app_control_info->list;
2801  while(blacklist && blacklist->data) {
2802  char *privilege = (char *)blacklist->data;
2803  printf("privielge : %s", privilege);
2804  blacklist = g_list_next(blacklist);
2805  }
2806  current = g_list_next(current);
2807  }
2808  } else {
2809  // Nothing in the blacklist.
2810  }
2811  mdm_free_data(lp_data);
2812  } else {
2813  // fail
2814  }
2815 
2816  * @endcode
2817  *
2818  * @return A list that contains all of the blacklisted privileges with the
2819  * controlling admin application package name, if successful. Otherwise,
2820  * returns NULL.
2821  *
2822  * @see mdm_add_app_privilege_to_blacklist
2823  * @see mdm_remove_app_privilege_from_blacklist
2824  *
2825  */
2826 mdm_data_t *mdm_get_app_privilege_all_blacklists(void);
2827 
2828 /*
2829  * @brief API to get the list of whitelisted application privileges for all admins.
2830  *
2831  * @since_mdm 1.1.0
2832  *
2833  * @since_tizen 2.3.2.3
2834  *
2835  * @feature %http://developer.samsung.com/tizen/feature/mdm
2836  *
2837  * @par Usage:
2838  * Use this API to get the list of privileges that are whitelisted.
2839  * Applications with matching privileges are allowed to be installed on the device.
2840  *
2841  * @code{.c}
2842  mdm_data_t *lp_data = mdm_get_app_privilege_all_whitelists();
2843 
2844  if(lp_data) {
2845  // success
2846  list = (GList *)lp_data->data;
2847  if(list) {
2848  GList *current = g_list_first(list);
2849  GList *whitelist = NULL;
2850  while(current && current->data) {
2851  app_control_info_t *app_control_info = (app_control_info_t *)current->data;
2852  printf("client_id : %d", app_control_info->client_id);
2853  whitelist = (GList *)app_control_info->list;
2854  while(whitelist && whitelist->data) {
2855  char *privilege = (char *)whitelist->data;
2856  printf("privielge : %s", privilege);
2857  whitelist = g_list_next(whitelist);
2858  }
2859  current = g_list_next(current);
2860  }
2861  } else {
2862  // Nothing in the whitelist.
2863  }
2864  mdm_free_data(lp_data);
2865  } else {
2866  // fail
2867  }
2868 
2869  * @endcode
2870  *
2871  * @return A list that contains all of the whitelisted privileges with the
2872  * controlling admin application package name, if successful. Otherwise,
2873  * returns NULL.
2874  *
2875  * @see mdm_add_app_privilege_to_whitelist
2876  * @see mdm_remove_app_privilege_from_whitelist
2877  *
2878  */
2879 mdm_data_t *mdm_get_app_privilege_all_whitelists(void);
2880 
2881 /*
2882  * @brief API to get the list of blacklisted application package signatures for all admins.
2883  *
2884  * @since_mdm 1.0.0
2885  *
2886  * @since_tizen 2.3.2.3
2887  *
2888  * @feature %http://developer.samsung.com/tizen/feature/mdm
2889  *
2890  * @par Usage:
2891  * Use this API to get the list of signatures that are blacklisted.
2892  * Existing application packages on the device with matching signatures will not
2893  * be disabled.
2894  *
2895  * @code{.c}
2896  mdm_data_t *lp_data = mdm_get_app_signature_all_blacklists();
2897 
2898  if(lp_data) {
2899  // success
2900  list = (GList *)lp_data->data;
2901  if(list) {
2902  GList *current = g_list_first(list);
2903  GList *blacklist = NULL;
2904  while(current && current->data) {
2905  app_control_info_t *app_control_info = (app_control_info_t *)current->data;
2906  printf("client_id : %d", app_control_info->client_id);
2907  blacklist = (GList *)app_control_info->list;
2908  while(blacklist && blacklist->data) {
2909  char *signature = (char *)blacklist->data;
2910  printf("signature : %s", signature);
2911  blacklist = g_list_next(blacklist);
2912  }
2913  current = g_list_next(current);
2914  }
2915  } else {
2916  // Nothing in the blacklist.
2917  }
2918  mdm_free_data(lp_data);
2919  } else {
2920  // fail
2921  }
2922 
2923  * @endcode
2924  *
2925  * @return A list that contains all of the blacklisted signatures for all
2926  * the admins on the device, if successful. Otherwise, returns NULL.
2927  *
2928  * @see mdm_add_app_signature_to_blacklist, mdm_remove_app_signature_from_blacklist,
2929  * mdm_get_app_signature_blacklist
2930  *
2931  */
2932 mdm_data_t *mdm_get_app_signature_all_blacklists(void);
2933 
2934 /*
2935  * @brief API to get the list of whitelisted application signatures for all admins.
2936  *
2937  * @since_mdm 1.1.0
2938  *
2939  * @since_tizen 2.3.2.3
2940  *
2941  * @feature %http://developer.samsung.com/tizen/feature/mdm
2942  *
2943  * @par Usage:
2944  * Use this API to get the list of signatures that are allowed.
2945  * Application packages with matching signatures are allowed to be installed on the device.
2946  *
2947  * @code{.c}
2948  mdm_data_t *lp_data = mdm_get_app_signature_all_whitelists();
2949 
2950  if(lp_data) {
2951  // success
2952  list = (GList *)lp_data->data;
2953  if(list) {
2954  GList *current = g_list_first(list);
2955  GList *whitelist = NULL;
2956  while(current && current->data) {
2957  app_control_info_t *app_control_info = (app_control_info_t *)current->data;
2958  printf("client_id : %d", app_control_info->client_id);
2959  whitelist = (GList *)app_control_info->list;
2960  while(whitelist && whitelist->data) {
2961  char *signature = (char *)whitelist->data;
2962  printf("signature : %s", signature);
2963  whitelist = g_list_next(whitelist);
2964  }
2965  current = g_list_next(current);
2966  }
2967  } else {
2968  // Nothing in the blacklist.
2969  }
2970  mdm_free_data(lp_data);
2971  } else {
2972  // fail
2973  }
2974 
2975  * @endcode
2976  *
2977  * @return A list that contains all of the whitelisted signatures for all
2978  * the admins on the device, if successful. Otherwise, returns NULL.
2979  *
2980  * @see mdm_add_app_signature_to_whitelist, mdm_remove_app_signature_from_whitelist
2981  *
2982  */
2983 mdm_data_t *mdm_get_app_signature_all_whitelists(void);
2984 
2985 /*
2986  * @brief API to get the list of blocked application privileges.
2987  *
2988  * @since_mdm 1.1.0
2989  *
2990  * @since_tizen 2.3.2.3
2991  *
2992  * @feature %http://developer.samsung.com/tizen/feature/mdm
2993  *
2994  * @par Usage:
2995  * Use this API to get the list of privileges that are blocked.
2996  * Application packages with matching privileges are prevented from being
2997  * installed on the device.
2998  * Existing application packages on the device with matching privileges will not
2999  * be disabled.
3000  *
3001  * @code{.c}
3002  mdm_data_t *lp_data = mdm_get_blocked_app_privileges();
3003  if (lp_data){
3004  // success
3005  GList *blockedlist = (GList *)lp_data->data;
3006  while(blockedlist) {
3007  char *privilege = (char *)blockedlist->data;
3008  // check privilege and block installation
3009  blockedlist = g_list_next(blockedlist);
3010  }
3011  // Free after use
3012  mdm_free_data(lp_data);
3013  } else {
3014  // fail
3015  }
3016 
3017  * @endcode
3018  *
3019  * @return A list that contains all the blocked privileges, if
3020  * successful. Otherwise, return NULL.
3021  *
3022  * @see mdm_add_app_privilege_to_blacklist
3023  * @see mdm_add_app_privilege_to_whitelist
3024  * @see mdm_remove_app_privilege_from_blacklist
3025  * @see mdm_remove_app_privilege_from_whitelist
3026  *
3027  */
3028 mdm_data_t *mdm_get_app_blocked_privileges(void);
3029 
3030 /*
3031  * @brief API to get the list of blocked application signatures.
3032  *
3033  * @since_mdm 1.1.0
3034  *
3035  * @since_tizen 2.3.2.3
3036  *
3037  * @feature %http://developer.samsung.com/tizen/feature/mdm
3038  *
3039  * @par Usage:
3040  * Use this API to get the list of signatures that are blocked.
3041  * Application packages with matching signatures are prevented from being
3042  * installed on the device.
3043  * Existing application packages on the device with matching signatures will not
3044  * be disabled.
3045  *
3046  * @code{.c}
3047  mdm_data_t *lp_data = mdm_get_blocked_app_signatures();
3048  if (lp_data){
3049  // success
3050  GList *blockedlist = (GList *)lp_data->data;
3051  while(blockedlist) {
3052  char *signatures = (char *)blockedlist->data;
3053  // check signature and block installation
3054  blockedlist = g_list_next(blockedlist);
3055  }
3056  // Free after use
3057  mdm_free_data(lp_data);
3058  } else {
3059  // fail
3060  }
3061 
3062  * @endcode
3063  *
3064  * @return A list that contains all the blocked signatures, if
3065  * successful. Otherwise, return NULL.
3066  *
3067  * @see mdm_add_app_signature_to_blacklist
3068  * @see mdm_add_app_signature_to_whitelist
3069  * @see mdm_remove_app_signature_from_blacklist
3070  * @see mdm_remove_app_signature_from_whitelist
3071  *
3072  */
3073 mdm_data_t *mdm_get_app_blocked_signatures(void);
3074 
3075 /*
3076  * @brief API to clear the application privilege blacklist.
3077  *
3078  * @since_mdm 1.1.0
3079  *
3080  * @since_tizen 2.3.2.3
3081  *
3082  * @feature %http://developer.samsung.com/tizen/feature/mdm
3083  *
3084  * @par Usage:
3085  * Use this API remove all the elements in the application privilege blacklist.
3086  *
3087  * @code{.c}
3088  mdm_result_t ret = mdm_clear_app_privilege_blacklist();
3089  if (ret == MDM_RESULT_SUCCESS){
3090  // Blacklist cleared.
3091  } else {
3092  // Call failed.
3093  }
3094  * @endcode
3095  *
3096  * @privlevel public
3097  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.application
3098  *
3099  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
3100  *
3101  * @retval #MDM_RESULT_SUCCESS Successful
3102  * @retval #MDM_RESULT_FAIL General failure
3103  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
3104  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
3105  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
3106  *
3107  * @par Permission:
3108  * Usage of this API is restricted to registered clients only.
3109  *
3110  */
3111 mdm_result_t mdm_clear_app_privilege_blacklist(void);
3112 
3113 /*
3114  * @brief API to clear the application privilege whitelist.
3115  *
3116  * @since_mdm 1.1.0
3117  *
3118  * @since_tizen 2.3.2.3
3119  *
3120  * @feature %http://developer.samsung.com/tizen/feature/mdm
3121  *
3122  * @par Usage:
3123  * Use this API remove all the elements in the application privilege whitelist.
3124  *
3125  * @code{.c}
3126  mdm_result_t ret = mdm_clear_app_privilege_whitelist();
3127  if (ret == MDM_RESULT_SUCCESS){
3128  // Whitelist cleared.
3129  } else {
3130  // Call failed.
3131  }
3132  * @endcode
3133  *
3134  * @privlevel public
3135  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.application
3136  *
3137  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
3138  *
3139  * @retval #MDM_RESULT_SUCCESS Successful
3140  * @retval #MDM_RESULT_FAIL General failure
3141  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
3142  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
3143  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
3144  *
3145  * @par Permission:
3146  * Usage of this API is restricted to registered clients only.
3147  *
3148  */
3149 mdm_result_t mdm_clear_app_privilege_whitelist(void);
3150 
3151 /*
3152  * @brief API to clear the application signature blacklist.
3153  *
3154  * @since_mdm 1.1.0
3155  *
3156  * @since_tizen 2.3.2.3
3157  *
3158  * @feature %http://developer.samsung.com/tizen/feature/mdm
3159  *
3160  * @par Usage:
3161  * Use this API remove all the elements in the application signature blacklist.
3162  *
3163  * @code{.c}
3164  mdm_result_t ret = mdm_clear_app_signature_blacklist();
3165  if (ret == MDM_RESULT_SUCCESS){
3166  // Blacklist cleared.
3167  } else {
3168  // Call failed.
3169  }
3170  * @endcode
3171  *
3172  * @privlevel public
3173  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.application
3174  *
3175  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
3176  *
3177  * @retval #MDM_RESULT_SUCCESS Successful
3178  * @retval #MDM_RESULT_FAIL General failure
3179  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
3180  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
3181  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
3182  *
3183  * @par Permission:
3184  * Usage of this API is restricted to registered clients only.
3185  *
3186  */
3187 mdm_result_t mdm_clear_app_signature_blacklist(void);
3188 
3189 /*
3190  * @brief API to clear the application signature whitelist.
3191  *
3192  * @since_mdm 1.1.0
3193  *
3194  * @since_tizen 2.3.2.3
3195  *
3196  * @feature %http://developer.samsung.com/tizen/feature/mdm
3197  *
3198  * @par Usage:
3199  * Use this API remove all the elements in the application signature whitelist.
3200  *
3201  * @code{.c}
3202  mdm_result_t ret = mdm_clear_app_signature_whitelist();
3203  if (ret == MDM_RESULT_SUCCESS){
3204  // Whitelist cleared.
3205  } else {
3206  // Call failed.
3207  }
3208  * @endcode
3209  *
3210  * @privlevel public
3211  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.application
3212  *
3213  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
3214  *
3215  * @retval #MDM_RESULT_SUCCESS Successful
3216  * @retval #MDM_RESULT_FAIL General failure
3217  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
3218  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
3219  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
3220  *
3221  * @par Permission:
3222  * Usage of this API is restricted to registered clients only.
3223  *
3224  */
3225 mdm_result_t mdm_clear_app_signature_whitelist(void);
3226 
3283 
3320 
3321 /*
3322  * @brief API to install an application from appstore.
3323  *
3324  * @since_mdm 1.0.0
3325  *
3326  * @since_tizen 2.3.2.3
3327  *
3328  * @feature %http://developer.samsung.com/tizen/feature/mdm
3329  *
3330  * @par Usage:
3331  * The admin can call this API to silently download and install an application
3332  * without user interaction from appstore.
3333  *
3334  * @code{.c}
3335 
3336  //
3337  // Application appstore callback
3338  //
3339  static void __appstore_install_callback__(void *cb_data, void *user_data)
3340  {
3341  mdm_appstore_error_info_s *cb_info = (mdm_appstore_error_info_s *)cb_data;
3342 
3343  if(cb_info->error_code == MDM_APPSTORE_STATUS_SUCCESS)
3344  {
3345  // Installation success
3346  // ...
3347  }
3348  else
3349  {
3350  // Installation failed
3351  // ...
3352  }
3353  }
3354 
3355  int fun()
3356  {
3357  // Connect to the MDM
3358  mdm_get_service();
3359 
3360  mdm_result_t ret = mdm_install_application_by_url(NULL, "com.samsung.example", __appstore_install_callback__,
3361  NULL);
3362 
3363  if (ret == MDM_RESULT_SUCCESS) {
3364  // installation from appstore started
3365  } else {
3366  // error occured
3367  }
3368  }
3369 
3370  * @endcode
3371  *
3372  * @privlevel public
3373  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.application
3374  *
3375  * @param[in] store_url Path of url to appstore, without scheme. If value is set to NULL then default appstore
3376  location is used.
3377  * @param[in] app_name Name of the application to install from appstore.
3378  * @param[in] cb_function Callback function
3379  * @param[in] user_data User data that is passed to the callback function
3380  *
3381  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
3382  *
3383  * @retval #MDM_RESULT_SUCCESS Successful
3384  * @retval #MDM_RESULT_FAIL General failure
3385  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
3386  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
3387  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
3388  *
3389  * @see mdm_update_application_by_url
3390  */
3391 mdm_result_t mdm_install_application_by_url(const char *store_url, const char *app_name,
3392  mdm_client_callback_function_ext cb_function, void *user_data);
3393 
3394 /*
3395  * @brief API to update an application from appstore.
3396  *
3397  * @since_mdm 1.0.0
3398  *
3399  * @since_tizen 2.3.2.3
3400  *
3401  * @feature %http://developer.samsung.com/tizen/feature/mdm
3402  *
3403  * @par Usage:
3404  * The admin can call this API to silently update an application
3405  * without user interaction from appstore.
3406  *
3407  * @code{.c}
3408 
3409  //
3410  // Application appstore callback
3411  //
3412  static void __appstore_update_callback__(void *cb_data, void *user_data)
3413  {
3414  mdm_appstore_error_info_s *error_info = (mdm_appstore_error_info_s *)cb_data;
3415 
3416  if(cb_info->error_code == MDM_APPSTORE_STATUS_SUCCESS)
3417  {
3418  // Update success
3419  // ...
3420  }
3421  else
3422  {
3423  // Update failed
3424  // ...
3425  }
3426  }
3427 
3428  int fun()
3429  {
3430  // Connect to the MDM
3431  mdm_get_service();
3432 
3433  mdm_result_t ret = mdm_update_application_by_url(NULL, "com.samsung.example", __appstore_update_callback__,
3434  NULL);
3435 
3436  if (ret == MDM_RESULT_SUCCESS) {
3437  // update from appstore started
3438  } else {
3439  // error occured
3440  }
3441  }
3442 
3443  * @endcode
3444  *
3445  * @privlevel public
3446  * @privilege %http://developer.samsung.com/tizen/privilege/mdm.application
3447  *
3448  * @param[in] store_url Path of url to appstore, without scheme. If value is set to NULL then default appstore
3449  location is used.
3450  * @param[in] app_name Name of the application to update from appstore url.
3451  * @param[in] cb_function Callback function
3452  * @param[in] user_data User data that is passed to the callback function
3453  *
3454  * @return #mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
3455  *
3456  * @retval #MDM_RESULT_SUCCESS Successful
3457  * @retval #MDM_RESULT_FAIL General failure
3458  * @retval #MDM_RESULT_NOT_SUPPORTED Not supported
3459  * @retval #MDM_RESULT_INVALID_PARAM Invalid parameter
3460  * @retval #MDM_RESULT_ACCESS_DENIED The application does not have the privilege to call this function.
3461  *
3462  * @see mdm_install_application_by_url
3463  */
3464 mdm_result_t mdm_update_application_by_url(const char *store_url, const char *app_name,
3465  mdm_client_callback_function_ext cb_function, void *user_data);
3466 
3512 mdm_result_t knox_mdm_add_privacy_permission_state_for_package(const char *package_name, const char *privilege,
3514 
3557 mdm_result_t knox_mdm_remove_privacy_permissions_from_packages(const char *package_name_pattern,
3558  const char *privilege_pattern);
3559 
3613  const char *privilege, bool all_admins, mdm_privacy_permission_state_t *state);
3614 
3667 mdm_data_t *knox_mdm_get_privacy_permission_data(const char *package_name_pattern, const char *privilege_pattern,
3668  bool all_admins, mdm_privacy_permission_state_t state_pattern);
3669 
3707 
3747 
3752 #ifdef __cplusplus
3753 }
3754 #endif
3755 
3756 #endif //LIBMDM_MDM_APPLICATION_H
mdm_data_t * mdm_get_most_data_usage_apps(int appCount)
API to get a list of application packages that have the highest data usage.
mdm_result_t mdm_remove_app_package_name_from_whitelist(const char *pkg_name)
API to remove an application package name from the application package name whitelist.
mdm_data_t * mdm_get_application_code_size(const char *pkg_name)
API to get the code size of an application.
mdm_data_t * mdm_get_application_data_size(const char *pkg_name)
API to get the data size of an application.
mdm_data_t * mdm_get_application_version(const char *pkg_name)
API to get the application version.
mdm_result_t mdm_clear_all_app_package_names_from_installation_whitelist(void)
API to remove all application package names from the installation whitelist.
This structure is used to store GList.
mdm_result_t mdm_set_application_uninstallation_disabled(const char *pkg_name)
API to disable the uninstallation of an application package.
mdm_data_t * mdm_get_application_state_list(mdm_app_status_t state)
API to get the list of applications on the device that have the specified state.
mdm_result_t mdm_set_application_uninstallation_enabled(const char *pkg_name)
API to enable the uninstallation of an application package.
mdm_data_t * mdm_get_installed_applications_list(void)
API to get a list of all installed application packages.
mdm_privacy_permission_state_t
Runtime permission policy value stored in the following states.
unsigned int usage
Definition: application.h:48
mdm_status_t mdm_get_application_installation_disabled(const char *pkg_name)
API to check whether a particular application package can be installed.
mdm_result_t mdm_get_application_cpu_usage(const char *app_id, unsigned long *usage)
API to get the CPU usage of an application.
void(* mdm_client_callback_function_ext)(void *cb_data, void *user_data)
Policy callback function pointer.
mdm_result_t mdm_get_application_memory_usage(const char *app_id, unsigned int *usage)
API to get the RAM memory usage of an application.
Application control info.
Definition: application.h:80
Application data usage.
Definition: application.h:57
mdm_status_t
MDM Policy status.
mdm_status_t mdm_get_application_installation_mode(void)
API to get the current installation mode for all applications.
mdm_result_t mdm_uninstall_application(const char *pkg_name)
API to uninstall an application package.
mdm_result_t mdm_update_application(const char *pkg_path)
API to update an application package on the device.
mdm_data_t * mdm_set_application_state_list(GList *pkg_list, mdm_app_status_t state)
API to set the state of a list of applications.
mdm_result_t mdm_remove_app_package_name_from_blacklist(const char *pkg_name)
API to remove an application package name from the application package name blacklist.
mdm_result_t mdm_disable_application(const char *pkg_name)
API to disable an application package without uninstalling it.
mdm_data_t * mdm_get_application_total_size(const char *pkg_name)
API to get the total size of an application, which includes both code and data.
unsigned long usage
Definition: application.h:59
mdm_data_t * mdm_get_most_memory_usage_apps(int appCount, mdm_status_t showAllProcess)
API to get a list of running applications or processes that have the highest memory usage...
mdm_result_t mdm_set_application_uninstallation_mode(mdm_status_t value)
API to set the default mode for application uninstallation.
mdm_result_t mdm_enable_application(const char *pkg_name)
API to enable an application package that was previously disabled.
mdm_app_status_t
Possible MDM application statuses.
Definition: application.h:35
mdm_result_t mdm_set_application_installation_mode(mdm_status_t state)
API to set the default application installation mode.
mdm_result_t mdm_set_application_installation_disabled(const char *pkg_name)
API to disable the installation of application package.
mdm_result_t knox_mdm_add_privacy_permission_state_for_package(const char *package_name, const char *privilege, mdm_privacy_permission_state_t state)
API to set runtime permission state for specified application package.
mdm_result_t mdm_set_application_installation_enabled(const char *pkg_name)
API to enable the installation of application package, that was previously disabled.
Application network statistics.
Definition: application.h:68
mdm_result_t mdm_start_application(const char *app_id)
API to launch an application.
mdm_status_t knox_mdm_widget_board_get_edit_permission(bool all_admins)
API to get information about whether any widget board edition is allowed. For more about widgets...
mdm_result_t mdm_clear_all_app_package_names_from_uninstallation_whitelist(void)
API to remove all application package names from the uninstallation whitelist.
mdm_result_t
MDM API result.
mdm_status_t mdm_get_application_state(const char *pkg_name)
API to check whether a given application package is enabled or disabled.
mdm_result_t mdm_install_application(const char *pkg_path)
API to install an application package on the device.
mdm_status_t mdm_is_application_running(const char *app_id)
API to check if an application is currently running.
mdm_result_t knox_mdm_get_privacy_permission_state_for_package(const char *package_name, const char *privilege, bool all_admins, mdm_privacy_permission_state_t *state)
API to get current state of a particular runtime permission for selected package name.
mdm_result_t mdm_clear_all_app_package_names_from_uninstallation_blacklist(void)
API to remove all application package names from the uninstallation blacklist.
mdm_data_t * mdm_get_app_package_names_all_blacklist(void)
API to get the list of blacklisted application package names for all admins.
mdm_status_t mdm_get_application_uninstallation_disabled(const char *pkg_name)
API to check if an application can be uninstalled.
mdm_data_t * mdm_uninstall_applications(GList *pkg_list)
API for bulk uninstallation of application packages.
mdm_status_t mdm_get_application_uninstallation_mode(void)
API to get the current uninstallation mode for all applications.
mdm_result_t mdm_set_application_state(const char *pkg_name, mdm_app_status_t state)
API to set the state of an application.
char * pkg_name
Definition: application.h:47
mdm_data_t * knox_mdm_get_privacy_permission_data(const char *package_name_pattern, const char *privilege_pattern, bool all_admins, mdm_privacy_permission_state_t state_pattern)
API to get current state of a particular runtime privacy permission for selected packages and privile...
mdm_data_t * mdm_get_application_name(const char *pkg_name)
API to get the name of an application.
mdm_result_t mdm_add_app_package_name_to_blacklist(const char *pkg_name)
Add an application package name to the application package name blacklist.
mdm_data_t * mdm_get_app_package_names_all_whitelist(void)
API to get whitelist of application package names for all admins.
mdm_data_t * mdm_get_most_cpu_usage_apps(int appCount, mdm_status_t showAllProcess)
API to get a list of running applications or processes that have the highest CPU usage.
Application usage.
Definition: application.h:46
mdm_result_t mdm_add_app_package_name_to_whitelist(const char *pkg_name)
API to add an application package name to the application package name whitelist. ...
mdm_result_t mdm_stop_application(const char *app_id)
API to stop an application.
mdm_result_t knox_mdm_widget_board_set_edit_permission(mdm_status_t status)
API to set whether the widget board can be edited.
mdm_result_t knox_mdm_remove_privacy_permissions_from_packages(const char *package_name_pattern, const char *privilege_pattern)
API to remove the state of a particular permission for specific application packages.
mdm_status_t mdm_is_application_installed(const char *pkg_name)
API to check if an application package is installed.
mdm_data_t * mdm_get_application_network_status_list(void)
API to get a list of applications and their corresponding network traffic usage.
mdm_result_t mdm_clear_all_app_package_names_from_installation_blacklist(void)
API to remove all application package names from the installation blacklist.