#include <appsvc.h>
#include <aul_svc.h>
#include <aul_widget.h>
+#include <system_info.h>
#include "watch_holder.hh"
#include "bundle_cpp.h"
LOGE("Failed to get appid (%d)", getpid());
}
appid_ = appid_buf;
+
+ int w = 360;
+ int ret = system_info_get_platform_int(
+ "http://tizen.org/feature/screen.width", &w);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ LOGE("fail to get width: %d", ret);
+ default_width_ = w;
+
+ int h = 360;
+ ret = system_info_get_platform_int(
+ "http://tizen.org/feature/screen.height", &h);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ LOGE("fail to get height: %d", ret);
+ default_height_ = h;
}
std::shared_ptr<Watch> WatchHolder::CreateWatch(std::string appid,
int WatchHolder::Launch(
string watch_appid, bool background, bundle* extra) {
- Evas_Coord x, y, w, h;
+ int x, y, w, h;
evas_object_geometry_get(win_, &x, &y, &w, &h);
Bundle data;
+ if (w == 0 && h == 0) {
+ LOGW("Viewer window not ready assign default size");
+ h = default_height_;
+ w = default_width_;
+ }
+
if (extra != nullptr)
data = Bundle(extra, true, true);
aul_svc_set_appid(data.GetHandle(), watch_appid.c_str());
data.Add("WATCH_HEIGHT", std::to_string(h));
data.Add("WATCH_BG_LAUNCH", std::to_string((int)background));
data.Add(AUL_K_WIDGET_VIEWER, appid_);
+ LOGI("Size (%d, %d)", w, h);
if (extra != nullptr)
extra_map_[watch_appid] = Bundle(extra, true, true);