if (TIZEN_FEATURE_APPSVC_ALIAS) {
std::string alias_id = ::GetAliasAppId(appid);
if (!alias_id.empty())
- appid = alias_id.c_str();
+ return ::SetBundle(b, AUL_SVC_K_PKG_NAME, alias_id.c_str());
}
return ::SetBundle(b, AUL_SVC_K_PKG_NAME, appid);
free(appid_array);
}
+extern "C" API int aul_svc_set_window_position(bundle* b,
+ int x, int y, int w, int h) {
+ if (b == nullptr) {
+ _E("Invalid parameter");
+ return AUL_SVC_RET_EINVAL;
+ }
+
+ ::SetBundle(b, AUL_K_HINT_SCREEN_POS_X, std::to_string(x).c_str());
+ ::SetBundle(b, AUL_K_HINT_SCREEN_POS_Y, std::to_string(y).c_str());
+ ::SetBundle(b, AUL_K_HINT_SCREEN_WIDTH, std::to_string(w).c_str());
+ ::SetBundle(b, AUL_K_HINT_SCREEN_HEIGHT, std::to_string(h).c_str());
+
+ return AUL_SVC_RET_OK;
+}
+
+extern "C" API int aul_svc_get_window_position(bundle* b,
+ int* x, int* y, int* w, int* h) {
+ if (b == nullptr ||
+ x == nullptr ||
+ y == nullptr ||
+ w == nullptr ||
+ h == nullptr) {
+ _E("Invalid parameter");
+ return AUL_SVC_RET_EINVAL;
+ }
+
+ char* x_str = nullptr;
+ char* y_str = nullptr;
+ char* w_str = nullptr;
+ char* h_str = nullptr;
+
+ bundle_get_str(b , AUL_K_HINT_SCREEN_POS_X, &x_str);
+ bundle_get_str(b , AUL_K_HINT_SCREEN_POS_Y, &y_str);
+ bundle_get_str(b , AUL_K_HINT_SCREEN_WIDTH, &w_str);
+ bundle_get_str(b , AUL_K_HINT_SCREEN_HEIGHT, &h_str);
+
+ if (x_str == nullptr ||
+ y_str == nullptr ||
+ w_str == nullptr ||
+ h_str == nullptr) {
+ _E("failed to get position");
+ return AUL_SVC_RET_ERROR;
+ }
+
+ *x = atoi(x_str);
+ *y = atoi(y_str);
+ *w = atoi(w_str);
+ *h = atoi(h_str);
+
+ return AUL_SVC_RET_OK;
+}
+
extern "C" API int aul_svc_set_defapp(const char* op, const char* mime_type,
const char* uri, const char* defapp) {
DEPRECATION_WARNING();