*/
extern int watch_manager_window_unbind(void);
+/**
+ * @brief Gets watch's setup appid.
+ * @since_tizen 3.0
+ * @remarks setup_appid should be freed.
+ * @param[in] app_id A watch app id
+ * @param[out] setup_appid A watch app id
+ * @return @c 0 on success, otherwise a negative error value
+ */
+extern int watch_manager_get_setup_appid(const char *app_id, char **setup_appid);
+
#ifdef __cplusplus
}
#endif
#include <Elementary.h>
#include <system_info.h>
#include <tbm_surface.h>
+#include <pkgmgr-info.h>
#define API __attribute__((visibility("default")))
#endif
#define KEY_SCREEN_SHAPE_CIRCLE "http://tizen.org/feature/screen.shape.circle"
+#define METADATA_SETUP_APPID "http://tizen.org/metadata/watch/setup-appid"
static int __watch_viewer_initialized = 0;
static int __watch_size_policy = WATCH_POLICY_HINT_EXPAND;
return screen_connector_toolkit_evas_unbind(__toolkit);
}
+API int watch_manager_get_setup_appid(const char *app_id, char **setup_appid)
+{
+ int ret = 0;
+ pkgmgrinfo_appinfo_h handle;
+ char *tmp_appid = NULL;
+
+ ret = pkgmgrinfo_appinfo_get_appinfo(app_id, &handle);
+ if (ret != PMINFO_R_OK)
+ return -1;
+
+ ret = pkgmgrinfo_appinfo_get_metadata_value(handle, METADATA_SETUP_APPID, &tmp_appid);
+ if (ret != PMINFO_R_OK) {
+ pkgmgrinfo_appinfo_destroy_appinfo(handle);
+ return -1;
+ }
+
+ if (tmp_appid)
+ *setup_appid = strdup(tmp_appid);
+
+ pkgmgrinfo_appinfo_destroy_appinfo(handle);
+ return ret;
+}