const char* kAllowMixedContent =
"http://samsung.com/tv/metadata/allow.mixedcontent";
+const char* kAllowNotificationLayer =
+ "http://samsung.com/tv/metadata/allow.notification.layer";
const char* kAmbientScreen =
"http://samsung.com/tv/metadata/ambient.screen.support";
const char* kAppLocationFormat =
const char* kWrtMessagePort = "wrt.message.port";
const char* kMultitaskingSupport =
"http://samsung.com/tv/metadata/multitasking.support";
+const char* kWindowLayer = "window_layer";
#if defined(TIZEN_VIDEO_HOLE)
const char* kVideoHoleSupport =
if (half_window_option)
ApplyHalfWindow(half_window_option);
+ auto* window_layer = appsvc_get_data(bundle, kWindowLayer);
+ if (window_layer)
+ ApplyNotificationWindow(window_layer);
+
auto& app_data = ApplicationData::GetInstance();
if (launch_mode == "backgroundExecution") {
AmbientMode::CreateInstance(
}
void NativeWebRuntimeDelegateTV::ApplyHalfWindow(
- std::string half_window_option) {
+ const std::string& half_window_option) {
LOG(INFO) << "HalfWindowSupport value = " << half_window_option;
auto native_window_tv = WRTNativeWindowTV::GetMainNativeWindow();
if (native_window_tv)
native_window_tv->HalfWindowSupport(half_window_option);
}
+void NativeWebRuntimeDelegateTV::ApplyNotificationWindow(
+ const std::string& window_layer) {
+ LOG(INFO) << "window_layer value = " << window_layer;
+ if (window_layer != "notification")
+ return;
+
+ auto native_window_tv = WRTNativeWindowTV::GetMainNativeWindow();
+ if (!native_window_tv)
+ return;
+
+ auto allow_notification =
+ ApplicationData::GetInstance().GetMetadata(kAllowNotificationLayer);
+ LOG(INFO) << "allow.notification.layer value = " << allow_notification;
+ if (allow_notification == "true")
+ native_window_tv->SetNotificationWindow(true);
+}
+
void NativeWebRuntimeDelegateTV::SubscribePowerState() {
if (power_callback_registered_)
return;
LOG(INFO) << "ecore_wl2_window_stack_mode_set = " << mode;
}
+void WRTNativeWindowTV::SetNotificationWindow(bool notification) {
+ LOG(INFO) << "set notification window, value is = " << notification;
+ tizen_policy* tz_policy = GetWindowTreeHost()->GetTizenPolicy();
+ Ecore_Wl2_Window* wl_win =
+ ecore_evas_wayland2_window_get(GetPlatformCanvas());
+ struct wl_surface* surface = ecore_wl2_window_surface_get(wl_win);
+ if (notification)
+ tizen_policy_set_notification_level(tz_policy, surface,
+ TIZEN_POLICY_LEVEL_TOP);
+ else
+ tizen_policy_set_notification_level(tz_policy, surface,
+ TIZEN_POLICY_LEVEL_NONE);
+}
+
void WRTNativeWindowTV::SetDimScreen() {
LOG(INFO) << "SetDimScreen, alphaset is " << alphaset_;
if (!alphaset_) {