PKG_CHECK_MODULES(PKGMGR_INFO_DEPS REQUIRED pkgmgr-info)
PKG_CHECK_MODULES(SENSOR_DEPS REQUIRED sensor)
PKG_CHECK_MODULES(TIZEN_EXTENSION_CLIENT_DEPS REQUIRED tizen-extension-client)
+PKG_CHECK_MODULES(TIZEN_LAUNCH_CLIENT_DEPS REQUIRED tizen-launch-client)
PKG_CHECK_MODULES(TIZEN_SHARED_QUEUE_DEPS REQUIRED tizen-shared-queue)
PKG_CHECK_MODULES(TTRACE_DEPS REQUIRED ttrace)
PKG_CHECK_MODULES(VCONF_DEPS REQUIRED vconf)
void RotationInit();
void RotationShutdown();
void OnRotationChanged(int degree) override;
+ void SetAppInfo();
std::list<std::shared_ptr<WinNode>> winnode_list_;
unsigned int hint_;
wl_handler_->SetAppId(appid_);
}
+void AppCoreUiBase::Impl::SetAppInfo() {
+ if (wl_handler_->Init() < 0) return;
+
+ wl_handler_->SetAppInfo(appid_);
+}
+
void AppCoreUiBase::Impl::PluginInit(int argc, char** argv) {
LogTracer tracer("AppCoreUiBase::Impl::PluginInit()");
plugin_.reset(AppCoreUiPlugin::Load());
if (impl_->hint_ & HINT_WINDOW_ID_CONTROL)
impl_->SetAppId();
+ impl_->SetAppInfo();
AppCoreBase::Run(argc, argv);
}
wl_registry_add_listener(reg_, ®_listener_, this);
wl_display_roundtrip(dsp_);
- if (tz_policy_ == nullptr) {
+ if (tz_policy_ == nullptr || launch_appinfo_ == nullptr) {
_E("Failed to get tizen policy interface");
Fini();
return -1;
_D("Set AppId: %s", app_id.c_str());
}
+void WaylandHandler::SetAppInfo(const std::string& app_id) {
+ if (!initialized_) return;
+
+ tizen_launch_appinfo_set_pid(launch_appinfo_, app_id.c_str(),
+ static_cast<uint32_t>(getpid()));
+ tizen_launch_appinfo_ready_metadata(launch_appinfo_, app_id.c_str(),
+ static_cast<uint32_t>(getpid()));
+ wl_display_flush(dsp_);
+ _W("appid=%s, pid=%d", app_id.c_str(), getpid());
+}
+
void WaylandHandler::WlListenerCb(void* data, struct wl_registry* reg,
- uint32_t id, const char* interface, uint32_t ver) {
+ uint32_t id, const char* interface,
+ uint32_t ver) {
+ auto* handle = static_cast<WaylandHandler*>(data);
if (interface && !strcmp(interface, "tizen_policy")) {
- auto* handle = static_cast<WaylandHandler*>(data);
if (handle->tz_policy_ == nullptr) {
- handle->tz_policy_ = reinterpret_cast<struct tizen_policy*>(
- wl_registry_bind(reinterpret_cast<struct wl_registry*>(handle->reg_),
- id, &tizen_policy_interface, 7));
+ handle->tz_policy_ = reinterpret_cast<tizen_policy*>(
+ wl_registry_bind(reinterpret_cast<wl_registry*>(handle->reg_),
+ id, &tizen_policy_interface, 7));
+ }
+ } else if (interface && !strcmp(interface, "tizen_launch_appinfo")) {
+ if (handle->launch_appinfo_ == nullptr) {
+ handle->launch_appinfo_ = reinterpret_cast<tizen_launch_appinfo*>(
+ wl_registry_bind(reinterpret_cast<wl_registry*>(handle->reg_), id,
+ &tizen_launch_appinfo_interface, 2));
}
}
}
#define TIZEN_CPP_APP_CORE_UI_CPP_WAYLAND_HANDLER_PRIVATE_HH_
#include <tizen-extension-client-protocol.h>
+#include <tizen-launch-client-protocol.h>
#include <wayland-client.h>
#include <wayland-tbm-client.h>
void SetBgState();
void UnsetBgState();
void SetAppId(const std::string& app_id);
+ void SetAppInfo(const std::string& app_id);
private:
static void WlListenerCb(void* data, struct wl_registry* reg,
struct wl_display* dsp_ = nullptr;
struct wl_registry* reg_ = nullptr;
struct tizen_policy* tz_policy_ = nullptr;
+ tizen_launch_appinfo* launch_appinfo_ = nullptr;
const struct wl_registry_listener reg_listener_ = {
WlListenerCb,