From 5e05dbc54d0ca08d81136936c8410af41a349bde Mon Sep 17 00:00:00 2001 From: Youngcheol Kang Date: Wed, 10 May 2017 17:10:21 +0900 Subject: [PATCH 01/16] fixup! Implement Fullscreen API In tizen 2.4 environment, WRT calls the ewk_view_fullscreen_exit() API and exits the event handler when pressing hardware back key if it's fullscreen mode in only "Software key" mode or "windowed" view mode. However above two conditions(software key and windowed view modes) were omitted in tizen 3.0, so the ewk_view_fullscreen_exit() API was always called when pressing hardware back key in fullscreen mode. This CL fixes these problem. Bug: http://suprem.sec.samsung.net/jira/browse/TWF-3201 Change-Id: I4dda2d78be7af8cf75df72875aa2d7e94bbe2da9 Signed-off-by: Youngcheol Kang --- runtime/browser/web_application.cc | 5 +++++ runtime/browser/web_view_impl.cc | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index 94ed40a..1d0a6c4 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -1003,6 +1003,11 @@ void WebApplication::OnHardwareKey(WebView* view, const std::string& keyname) { RemoveWebViewFromStack(view_stack_.front()); } } + + if (app_data_->widget_info()->view_modes() == "fullscreen") { + ewk_view_fullscreen_exit(view->evas_object()); + return; + } } } else if (enabled && kKeyNameMenu == keyname) { view->EvalJavascript(kMenuKeyEventScript); diff --git a/runtime/browser/web_view_impl.cc b/runtime/browser/web_view_impl.cc index 34d8e57..ea77e15 100644 --- a/runtime/browser/web_view_impl.cc +++ b/runtime/browser/web_view_impl.cc @@ -985,10 +985,6 @@ void WebViewImpl::OnRotation(int degree) { void WebViewImpl::OnKeyEvent(Eext_Callback_Type key_type) { std::string keyname; if (key_type == EEXT_CALLBACK_BACK) { - if (fullscreen_) { - ewk_view_fullscreen_exit(ewk_view_); - return; - } if (EINA_TRUE == ewk_view_text_selection_clear(ewk_view_)) { return; } -- 2.7.4 From b00afca150143afe1e1b5e163d76296959040434 Mon Sep 17 00:00:00 2001 From: "jaekuk, lee" Date: Tue, 23 May 2017 21:16:36 +0900 Subject: [PATCH 02/16] [release 0.3.2]tizen porting Change-Id: I75ab917767be3406d23e01e6c162a5a281ed3145 Signed-off-by: jaekuk, lee --- runtime/browser/web_application.cc | 4 ---- runtime/browser/web_view_impl.cc | 4 ---- 2 files changed, 8 deletions(-) mode change 100644 => 100755 runtime/browser/web_view_impl.cc diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index 1d0a6c4..5cd985f 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -711,14 +711,12 @@ void WebApplication::ClosePage() { for (; it != view_stack_.end(); ++it) { (*it)->ReplyToJavascriptDialog(); view_stack_.front()->SetVisibility(false); -#ifdef DENABLE_EWK_ADDITIONAL_FEATURE if (ewk_view_page_close((*it)->evas_object())) { LOGGER(DEBUG) << "ewk_view_page_close returns true"; valid_evas_object_count++; } else { LOGGER(DEBUG) << "ewk_view_page_close returns false"; } -#endif } } @@ -1215,12 +1213,10 @@ void WebApplication::SetupWebView(WebView* view) { void WebApplication::SetupWebViewCompatibilitySettings(WebView* view) { if (tizenWebKitCompatibilityEnabled()) { Ewk_Settings* settings = ewk_view_settings_get(view->evas_object()); -#ifdef DENABLE_COMPATIBILITY_MODE_SET ewk_settings_tizen_compatibility_mode_set(settings, m_tizenCompatibilitySettings.m_major, m_tizenCompatibilitySettings.m_minor, m_tizenCompatibilitySettings.m_release); -#endif ewk_settings_text_autosizing_enabled_set(settings, EINA_FALSE); } } diff --git a/runtime/browser/web_view_impl.cc b/runtime/browser/web_view_impl.cc old mode 100644 new mode 100755 index ea77e15..01050c5 --- a/runtime/browser/web_view_impl.cc +++ b/runtime/browser/web_view_impl.cc @@ -1028,15 +1028,11 @@ void WebViewImpl::SetDefaultEncoding(const std::string& encoding) { } void WebViewImpl::SetLongPolling(unsigned long longpolling) { -#ifdef DENABLE_CHROMIUM_EWK_FEATURE ewk_view_session_timeout_set(ewk_view_, longpolling); -#endif } void WebViewImpl::SetBGColor(int r, int g, int b, int a) { -#ifdef DENABLE_CHROMIUM_EWK_FEATURE ewk_view_bg_color_set(ewk_view_, r, g, b, a); -#endif } } // namespace runtime -- 2.7.4 From f6fcd9acc6681a448f5bdcfda6be2f20b04d23f2 Mon Sep 17 00:00:00 2001 From: "jaekuk, lee" Date: Wed, 24 May 2017 10:47:59 +0900 Subject: [PATCH 03/16] Changed the header file of appcore-watch from appcore-watch.h to watch_app.h Change-Id: Ib676f08863f8ec72eedd448c9fa6df20f12b4298 Signed-off-by: jaekuk, lee --- runtime/browser/watch_runtime.cc | 1 - runtime/browser/web_application.cc | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) mode change 100644 => 100755 runtime/browser/watch_runtime.cc diff --git a/runtime/browser/watch_runtime.cc b/runtime/browser/watch_runtime.cc old mode 100644 new mode 100755 index 4ec298b..39302ca --- a/runtime/browser/watch_runtime.cc +++ b/runtime/browser/watch_runtime.cc @@ -15,7 +15,6 @@ */ #include -#include #include #include diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index 5cd985f..b6d8865 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -29,7 +29,7 @@ #include #ifdef WATCH_FACE_FEATURE_SUPPORT -#include +#include #endif #include "common/application_data.h" @@ -736,9 +736,7 @@ void WebApplication::Exit() { case common::ApplicationData::AppType::WATCH: if (TIZEN_FEATURE_watch_face_support) { LOGGER(ERROR) << "watch_ui_exit"; -#ifdef DENABLE_WATCH_APP watch_app_exit(); -#endif break; } else { goto __default; -- 2.7.4 From 2921f491ed136a6681a96cb394c5c261b81e53dd Mon Sep 17 00:00:00 2001 From: "jaekuk, lee" Date: Thu, 15 Jun 2017 15:12:39 +0900 Subject: [PATCH 04/16] Changed a string to a variable "fullscreen" => kViewmodeTypeFullscreen "windowed" => kViewmodeTypeWindowed Change-Id: I354ce4c9fa84745c9c18d208faf570a9b16e970b Signed-off-by: jaekuk, lee --- runtime/browser/web_application.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index b6d8865..4e3d730 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -144,6 +144,9 @@ const char* kDefaultCSPRule = const char* kResWgtPath = "res/wgt/"; const char* kAppControlMain = "http://tizen.org/appcontrol/operation/main"; +const std::string kViewmodeTypeFullscreen = "fullscreen"; +const std::string kViewmodeTypeWindowed = "windowed"; + // Looking for added privilege by Application developer in config.xml. bool FindPrivilegeFromConfig(common::ApplicationData* app_data, const std::string& privilege) { @@ -446,7 +449,7 @@ bool WebApplication::Initialize() { } if (app_data_->widget_info() != NULL && - app_data_->widget_info()->view_modes() == "fullscreen") { + app_data_->widget_info()->view_modes() == kViewmodeTypeFullscreen) { window_->SetCurrentViewModeFullScreen(true); window_->FullScreen(true); } @@ -990,7 +993,7 @@ void WebApplication::OnHardwareKey(WebView* view, const std::string& keyname) { if ((app_data_->setting_info() != NULL && app_data_->setting_info()->backbutton_presence()) || (app_data_->widget_info() != NULL && - app_data_->widget_info()->view_modes() == "windowed")) { + app_data_->widget_info()->view_modes() == kViewmodeTypeWindowed)) { if (!view->Backward()) { if (view_stack_.size() == 1) { LOGGER(DEBUG) << "Terminate"; @@ -1000,7 +1003,7 @@ void WebApplication::OnHardwareKey(WebView* view, const std::string& keyname) { } } - if (app_data_->widget_info()->view_modes() == "fullscreen") { + if (app_data_->widget_info()->view_modes() == kViewmodeTypeFullscreen) { ewk_view_fullscreen_exit(view->evas_object()); return; } -- 2.7.4 From 93796edd1a1f569edfee7a088b60ce2755508507 Mon Sep 17 00:00:00 2001 From: "jaekuk, lee" Date: Tue, 20 Jun 2017 14:21:01 +0900 Subject: [PATCH 05/16] Implemented progressbar for web application issue : http://suprem.sec.samsung.net/jira/browse/MPR-1117 Hosted web app such as YouTube displays a white screen until the page finishes loading. Modified WRT to display progressbar until the page finishes loading if progressbar-presence is enabled in config.xml. Change-Id: I114d69543caea76161d0ace22cf57ae052c8f099 Signed-off-by: jaekuk, lee --- runtime/browser/native_window.cc | 24 ++++++++++++++++++++++++ runtime/browser/native_window.h | 4 ++++ runtime/browser/web_application.cc | 29 +++++++++++++++++++++++++++++ runtime/browser/web_application.h | 1 + 4 files changed, 58 insertions(+) diff --git a/runtime/browser/native_window.cc b/runtime/browser/native_window.cc index 6e723e5..43f6bef 100755 --- a/runtime/browser/native_window.cc +++ b/runtime/browser/native_window.cc @@ -23,6 +23,7 @@ #include "common/arraysize.h" #include "common/logger.h" +#include "common/platform_info.h" namespace runtime { @@ -75,6 +76,8 @@ NativeWindow::NativeWindow() currentViewModeFullScreen_(false), focus_(NULL), content_(NULL), + progressbar_(NULL), + top_layout_(NULL), rotation_(0), handler_id_(0) { } @@ -126,6 +129,7 @@ void NativeWindow::Initialize() { EVAS_SIZE_EXPAND_FILL(top_layout); elm_object_content_set(conformant, top_layout); evas_object_show(top_layout); + top_layout_ = top_layout; // focus Evas_Object* focus = elm_bg_add(top_layout); @@ -139,6 +143,17 @@ void NativeWindow::Initialize() { evas_object_show(focus); focus_ = focus; + if (common::getProfile() == common::kPROFILE_MOBILE) { + // progressbar + Evas_Object *progressbar = elm_progressbar_add(top_layout); + EVAS_SIZE_EXPAND_FILL(progressbar); + elm_progressbar_unit_format_set(progressbar, "%1.1f%%"); + elm_progressbar_horizontal_set(progressbar, EINA_TRUE); + elm_object_part_content_set(top_layout, "elm.swallow.progress", progressbar); + evas_object_show(progressbar); + progressbar_ = progressbar; + } + // focus callback auto focus_callback = [](void* user_data, Evas_Object*, @@ -304,4 +319,13 @@ void NativeWindow::ManualRotationDone() { } } +void NativeWindow::SignalEmit(const char* emission, + const char* source) { + elm_object_signal_emit(top_layout_, emission, source); +} + +void NativeWindow::UpdateProgress(double value) { + elm_progressbar_value_set(progressbar_, ELM_SCALE_SIZE(value)); +} + } // namespace runtime diff --git a/runtime/browser/native_window.h b/runtime/browser/native_window.h index 0a5f23c..a305389 100755 --- a/runtime/browser/native_window.h +++ b/runtime/browser/native_window.h @@ -63,6 +63,8 @@ class NativeWindow { Type type() const { return window_type_;} void EnableManualRotation(bool enable); void ManualRotationDone(); + void SignalEmit(const char* emission, const char* source); + void UpdateProgress(double value); protected: virtual Evas_Object* CreateWindowInternal() = 0; @@ -80,6 +82,8 @@ class NativeWindow { bool currentViewModeFullScreen_; Evas_Object* focus_; Evas_Object* content_; + Evas_Object* progressbar_; + Evas_Object* top_layout_; int rotation_; int handler_id_; ScreenOrientation natural_orientation_; diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index 4e3d730..b8a95bc 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -144,6 +144,10 @@ const char* kDefaultCSPRule = const char* kResWgtPath = "res/wgt/"; const char* kAppControlMain = "http://tizen.org/appcontrol/operation/main"; +// window signal callback +const char *kEdjeShowProgressSignal = "show,progress,signal"; +const char *kEdjeHideProgressSignal = "hide,progress,signal"; + const std::string kViewmodeTypeFullscreen = "fullscreen"; const std::string kViewmodeTypeWindowed = "windowed"; @@ -1144,8 +1148,33 @@ void WebApplication::OnLoadStart(WebView* /*view*/) { LOGGER(DEBUG) << "LoadStart"; } +void WebApplication::OnLoadProgress(WebView* view, double persent) { + LOGGER(DEBUG) << "LoadProgress, progress ;"<setting_info() != NULL && + app_data_->setting_info()->progressbar_presence()) || + (app_data_->widget_info() != NULL && + app_data_->widget_info()->view_modes() == kViewmodeTypeWindowed)) { + if (persent == 1.0) { + window_->SignalEmit(kEdjeHideProgressSignal, ""); + } else { + window_->SignalEmit(kEdjeShowProgressSignal, ""); + window_->UpdateProgress(persent); + } + } + } +} + void WebApplication::OnLoadFinished(WebView* /*view*/) { LOGGER(DEBUG) << "LoadFinished"; + if (common::getProfile() == common::kPROFILE_MOBILE) { + if ((app_data_->setting_info() != NULL && + app_data_->setting_info()->progressbar_presence()) || + (app_data_->widget_info() != NULL && + app_data_->widget_info()->view_modes() == kViewmodeTypeWindowed)) { + window_->SignalEmit(kEdjeHideProgressSignal, ""); + } + } splash_screen_->HideSplashScreen(SplashScreen::HideReason::LOADFINISHED); } diff --git a/runtime/browser/web_application.h b/runtime/browser/web_application.h index 0614f1f..99e56d0 100755 --- a/runtime/browser/web_application.h +++ b/runtime/browser/web_application.h @@ -71,6 +71,7 @@ class WebApplication : public WebView::EventListener { virtual void OnHardwareKey(WebView* view, const std::string& keyname); virtual void OnConsoleMessage(const std::string& msg, int level); virtual void OnLoadStart(WebView* view); + virtual void OnLoadProgress(WebView* view, double persent); virtual void OnLoadFinished(WebView* view); virtual void OnRendered(WebView* view); virtual void OnLanguageChanged(); -- 2.7.4 From 10cdfc656c2adc296461a5ab703286b8bb2b0a14 Mon Sep 17 00:00:00 2001 From: Pawel Niemirski Date: Wed, 28 Jun 2017 12:11:50 +0200 Subject: [PATCH 06/16] Register service worker on PWA launch Start the registration if config.xml has following metadata: Bug: http://suprem.sec.samsung.net/jira/browse/RWASP-1583 Change-Id: I9ada897e7b654b4a72596935b3d6dc4a53ce13c8 Signed-off-by: Pawel Niemirski --- runtime/browser/web_application.cc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index b8a95bc..4caa495 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -151,6 +151,8 @@ const char *kEdjeHideProgressSignal = "hide,progress,signal"; const std::string kViewmodeTypeFullscreen = "fullscreen"; const std::string kViewmodeTypeWindowed = "windowed"; +const char* const kServiceWorkerConfigKey = "service-worker-url"; + // Looking for added privilege by Application developer in config.xml. bool FindPrivilegeFromConfig(common::ApplicationData* app_data, const std::string& privilege) { @@ -282,6 +284,16 @@ static bool ProcessWellKnownScheme(const std::string& url) { return true; } +void OnDidRegisterServiceWorkerCb(Ewk_Context*, const char*, const char*, + Eina_Bool result, void*) { + if (result) { + LOGGER(DEBUG) << "Service-worker has been registered successfully"; + } else { + LOGGER(DEBUG) << + "An unexpected error has occurred during service-worker registeration"; + } +} + } // namespace std::vector ParseTizenVersion(const std::string& tizen_string) { @@ -530,6 +542,15 @@ void WebApplication::Launch(std::unique_ptr appcontrol) { resource_manager_->GetStartResource(appcontrol.get()); view->SetDefaultEncoding(res->encoding()); + if (app_data_->meta_data_info().get() && + app_data_->meta_data_info()->HasKey(kServiceWorkerConfigKey)) { + std::string service_worker_url = + app_data_->meta_data_info()->GetValue(kServiceWorkerConfigKey); + ewk_context_service_worker_register(ewk_context_, res->uri().c_str(), + service_worker_url.c_str(), + OnDidRegisterServiceWorkerCb, this); + } + STEP_PROFILE_END("OnCreate -> URL Set"); STEP_PROFILE_START("URL Set -> Rendered"); -- 2.7.4 From f243269ce5ed3b7873822be118149af731f7bb06 Mon Sep 17 00:00:00 2001 From: "min7.choi" Date: Mon, 10 Jul 2017 10:39:10 +0900 Subject: [PATCH 07/16] Remove caps due to security issue & apply caps directly in security-config Change-Id: I70b6f0e2b4c1fb65c2bbecb5bd741c737ac020ed Signed-off-by: min7.choi --- packaging/crosswalk-tizen.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/packaging/crosswalk-tizen.spec b/packaging/crosswalk-tizen.spec index baed898..6f41520 100755 --- a/packaging/crosswalk-tizen.spec +++ b/packaging/crosswalk-tizen.spec @@ -253,7 +253,6 @@ rm -fr %{buildroot} %attr(644,root,root) %{_datadir}/aul/wrt.loader %attr(755,root,root) %{_bindir}/wrt-upgrade %attr(755,root,root) %{_datadir}/upgrade/scripts/720.wrt.upgrade.sh -%caps(cap_sys_admin,cap_setgid=ei) %{_bindir}/wrt-loader %license LICENSE LICENSE.BSD # If it is unified or wearable, create circular-display extension -- 2.7.4 From 0813953a6f113909b0adad3f41088d0e083de8bc Mon Sep 17 00:00:00 2001 From: Pawel Niemirski Date: Wed, 12 Jul 2017 14:13:09 +0200 Subject: [PATCH 08/16] Support swipe to refresh feature Enable the feature if config.xml has following metadata: Bug: http://suprem.sec.samsung.net/jira/browse/RWASP-1534 Change-Id: Id430ea44a3bb344a2836e841f5103a1bb1f55141 Signed-off-by: Pawel Niemirski --- runtime/browser/web_application.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index 4caa495..014e882 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -153,6 +153,8 @@ const std::string kViewmodeTypeWindowed = "windowed"; const char* const kServiceWorkerConfigKey = "service-worker-url"; +const char* const kEnableSwipeToRefreshConfigKey = "enable-swipe-to-refresh"; + // Looking for added privilege by Application developer in config.xml. bool FindPrivilegeFromConfig(common::ApplicationData* app_data, const std::string& privilege) { @@ -551,6 +553,12 @@ void WebApplication::Launch(std::unique_ptr appcontrol) { OnDidRegisterServiceWorkerCb, this); } + if (app_data_->meta_data_info().get() && + app_data_->meta_data_info()->HasKey(kEnableSwipeToRefreshConfigKey)) { + Ewk_Settings* settings = ewk_view_settings_get(view->evas_object()); + ewk_settings_swipe_to_refresh_enabled_set(settings, EINA_TRUE); + } + STEP_PROFILE_END("OnCreate -> URL Set"); STEP_PROFILE_START("URL Set -> Rendered"); -- 2.7.4 From 604ec856a53f38ec68f996361d5c87d556684a9e Mon Sep 17 00:00:00 2001 From: "jaekuk, lee" Date: Fri, 11 Aug 2017 18:46:58 +0900 Subject: [PATCH 09/16] Add ASLR to wrt-loader and wrt-upgrade Change-Id: Ib16832362f941d15cb68c894ea815512cfb086b1 Signed-off-by: jaekuk, lee --- loader/loader.gyp | 3 +++ wrt-upgrade/wrt-upgrade.gyp | 3 +++ 2 files changed, 6 insertions(+) mode change 100644 => 100755 loader/loader.gyp diff --git a/loader/loader.gyp b/loader/loader.gyp old mode 100644 new mode 100755 index 152ec46..3e99808 --- a/loader/loader.gyp +++ b/loader/loader.gyp @@ -9,6 +9,9 @@ 'sources': [ 'wrt_loader.cc', ], + 'ldflags': [ + '-pie', + ], 'variables': { 'packages': [ 'dlog', diff --git a/wrt-upgrade/wrt-upgrade.gyp b/wrt-upgrade/wrt-upgrade.gyp index cc8a116..55b48a6 100755 --- a/wrt-upgrade/wrt-upgrade.gyp +++ b/wrt-upgrade/wrt-upgrade.gyp @@ -13,6 +13,9 @@ 'wrt-upgrade.cc', 'wrt-upgrade-info.cc', ], + 'ldflags': [ + '-pie', + ], 'variables': { 'packages': [ 'sqlite3', -- 2.7.4 From 7a7e40daac586efb25776e614b75232ea153c4af Mon Sep 17 00:00:00 2001 From: Sunmin Lee Date: Mon, 11 Sep 2017 12:03:51 +0900 Subject: [PATCH 10/16] Remove old update script RW update script for Tizen 2.4 (to 3.0) is not necessary in Tizen 4.0. Remove this file to avoid being executed during Tizen 4.0 update. Change-Id: I1ced307959fb9637ee4f484077244313e00db42d --- packaging/crosswalk-tizen.spec | 7 - wrt-upgrade/720.wrt.upgrade.sh | 16 --- wrt-upgrade/wrt-upgrade-info.cc | 171 ----------------------- wrt-upgrade/wrt-upgrade-info.h | 103 -------------- wrt-upgrade/wrt-upgrade.cc | 294 ---------------------------------------- wrt-upgrade/wrt-upgrade.gyp | 38 ------ wrt-upgrade/wrt-upgrade.h | 34 ----- xwalk_tizen.gyp | 1 - 8 files changed, 664 deletions(-) delete mode 100755 wrt-upgrade/720.wrt.upgrade.sh delete mode 100644 wrt-upgrade/wrt-upgrade-info.cc delete mode 100644 wrt-upgrade/wrt-upgrade-info.h delete mode 100755 wrt-upgrade/wrt-upgrade.cc delete mode 100755 wrt-upgrade/wrt-upgrade.gyp delete mode 100644 wrt-upgrade/wrt-upgrade.h diff --git a/packaging/crosswalk-tizen.spec b/packaging/crosswalk-tizen.spec index 6f41520..b78ff93 100755 --- a/packaging/crosswalk-tizen.spec +++ b/packaging/crosswalk-tizen.spec @@ -183,7 +183,6 @@ mkdir -p %{buildroot}%{_datadir}/locale mkdir -p %{buildroot}%{_datadir}/icons/xwalk mkdir -p %{buildroot}%{_datadir}/edje/xwalk mkdir -p %{buildroot}%{extension_path} -mkdir -p %{buildroot}%{_datadir}/upgrade/scripts # Loader script file mkdir -p %{buildroot}%{_datadir}/aul/ @@ -227,10 +226,6 @@ install -p -m 755 out/Default/lib/libxwalk_injected_bundle.so %{buildroot}%{_lib # wrt-loader install -p -m 755 out/Default/wrt-loader %{buildroot}%{_bindir} -# wrt-upgrade -install -p -m 755 out/Default/wrt-upgrade %{buildroot}%{_bindir} -install -p -m 644 out/Default/gen/720.wrt.upgrade.sh %{buildroot}%{_datadir}/upgrade/scripts/720.wrt.upgrade.sh - %clean rm -fr %{buildroot} @@ -251,8 +246,6 @@ rm -fr %{buildroot} %attr(755,root,root) %{_bindir}/wrt-client %attr(755,root,root) %{_bindir}/wrt-loader %attr(644,root,root) %{_datadir}/aul/wrt.loader -%attr(755,root,root) %{_bindir}/wrt-upgrade -%attr(755,root,root) %{_datadir}/upgrade/scripts/720.wrt.upgrade.sh %license LICENSE LICENSE.BSD # If it is unified or wearable, create circular-display extension diff --git a/wrt-upgrade/720.wrt.upgrade.sh b/wrt-upgrade/720.wrt.upgrade.sh deleted file mode 100755 index 805a177..0000000 --- a/wrt-upgrade/720.wrt.upgrade.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -PATH=/bin:/usr/bin:/sbin:/usr/sbin - -#excute upgrade application -/usr/bin/wrt-upgrade - -#remove unuse databases -rm /opt/dbspace/.wrt.db -rm /opt/dbspace/.wrt.db-journal - -rm -r /opt/share/widget - -rm /opt/usr/dbspace/.wrt_custom_handler.db -rm /opt/usr/dbspace/.wrt_custom_handler.db-journal -rm /opt/usr/dbspace/.wrt_i18n.db -rm /opt/usr/dbspace/.wrt_i18n.db-journal diff --git a/wrt-upgrade/wrt-upgrade-info.cc b/wrt-upgrade/wrt-upgrade-info.cc deleted file mode 100644 index ca905fe..0000000 --- a/wrt-upgrade/wrt-upgrade-info.cc +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright (c) 2013 Intel Corporation. All rights reserved. -// Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "wrt-upgrade/wrt-upgrade-info.h" -#include "common/logger.h" - -// #include - -namespace { -const std::string kSectionPrefix = "_SECT_"; -const std::string kSectionSuffix = "_SECT_"; - -const std::string kDBPublicSection = "public"; -const std::string kDBPrivateSection = "private"; - -const std::string kGeolocationPermissionPrefix = "__WRT_GEOPERM_"; -const std::string kNotificationPermissionPrefix = "__WRT_NOTIPERM_"; -const std::string kQuotaPermissionPrefix = "__WRT_QUOTAPERM_"; -const std::string kCertificateAllowPrefix = "__WRT_CERTIPERM_"; -const std::string kUsermediaPermissionPrefix = "__WRT_USERMEDIAPERM_"; - -const std::string kValueAllow = "allowed"; -const std::string kValueDenied = "denied"; -const std::string kValueUnknown = "unknown"; - -const std::string kAppDirectoryPrefix = "/opt/usr/home/owner/apps_rw/"; -const std::string kAppSecurityOriginDBFile = "/data/.security_origin.db"; -const std::string kAppCertificateDBFile = "/data/.certificate.db"; - -enum { - FEATURE_GEOLOCATION = 0, - FEATURE_WEB_NOTIFICATION, - FEATURE_USER_MEDIA, - FEATURE_FULLSCREEN_MODE, - FEATURE_WEB_DATABASE, - FEATURE_CAMERA, - FEATURE_AUDIO_RECORDER -}; -enum { - RESULT_UNKNOWN = 0, - RESULT_ALLOW_ONCE, - RESULT_DENY_ONCE, - RESULT_ALLOW_ALWAYS, - RESULT_DENY_ALWAYS -}; -} // namespace - -namespace upgrade { - -PreferenceInfo::PreferenceInfo(std::string key, std::string value) { - m_section_ = kDBPublicSection; - m_key_ = key; - m_value_ = value; -} -SecurityOriginInfo::SecurityOriginInfo( - int feature, - std::string scheme, - std::string host, - int port, - int result) { - m_section_ = kDBPrivateSection; - m_key_ = translateKey(feature, scheme, host, port); - m_value_ = translateValue(result); -} -std::string SecurityOriginInfo::translateKey( - int feature, - std::string scheme, - std::string host, - int port) { - - std::string key = ""; - - switch (feature) { - case FEATURE_GEOLOCATION : - key += kGeolocationPermissionPrefix; - break; - case FEATURE_WEB_NOTIFICATION : - key += kNotificationPermissionPrefix; - break; - case FEATURE_USER_MEDIA : - key += kUsermediaPermissionPrefix; - break; - case FEATURE_WEB_DATABASE : - key += kQuotaPermissionPrefix; - break; - default : - break; - } - - key += scheme; - key += "://"; - key += host; - key += ":"; - key += std::to_string(port); - - return key; -} -std::string SecurityOriginInfo::translateValue(int result) { - std::string value = ""; - - switch (result) { - case RESULT_ALLOW_ALWAYS : - value = kValueAllow; - break; - case RESULT_DENY_ALWAYS : - value = kValueDenied; - break; - case RESULT_UNKNOWN : - case RESULT_ALLOW_ONCE : - case RESULT_DENY_ONCE : - default : - value = kValueUnknown; - break; - } - return value; -} -CertificateInfo::CertificateInfo( - std::string pem, - int result) { - m_section_ = kDBPrivateSection; - m_key_ = translateKey(pem); - m_value_ = translateValue(result); -} -std::string CertificateInfo::translateKey(std::string pem) { - std::string key = ""; - key = kCertificateAllowPrefix + pem; - return key; -} -std::string CertificateInfo::translateValue(int result) { - std::string value = ""; - - switch (result) { - case RESULT_ALLOW_ALWAYS : - value = kValueAllow; - break; - case RESULT_DENY_ALWAYS : - value = kValueDenied; - break; - case RESULT_UNKNOWN : - case RESULT_ALLOW_ONCE : - case RESULT_DENY_ONCE : - default : - value = kValueUnknown; - break; - } - return value; -} -WrtUpgradeInfo::WrtUpgradeInfo(std::string appid) { - app_id_ = appid; - pkg_id_ = appid.substr(0, appid.find_first_of('.')); - app_dir_ = kAppDirectoryPrefix + pkg_id_; -} -void WrtUpgradeInfo::addPreferenceInfo(PreferenceInfo preference) { - preference_info_list_.push_back(preference); -} -void WrtUpgradeInfo::addSecurityOriginInfo(SecurityOriginInfo security_origin) { - security_origin_info_list_.push_back(security_origin); -} -void WrtUpgradeInfo::addCertificateInfo(CertificateInfo certificate) { - certificate_info_list.push_back(certificate); -} - -std::string WrtUpgradeInfo::getSecurityOriginDB() { - return app_dir_ + kAppSecurityOriginDBFile; -} -std::string WrtUpgradeInfo::getCertificateDB() { - return app_dir_ + kAppCertificateDBFile; -} -} // namespace upgrade diff --git a/wrt-upgrade/wrt-upgrade-info.h b/wrt-upgrade/wrt-upgrade-info.h deleted file mode 100644 index c304e62..0000000 --- a/wrt-upgrade/wrt-upgrade-info.h +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) 2013 Intel Corporation. All rights reserved. -// Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef WRT_UPGRADE_INFO_H -#define WRT_UPGRADE_INFO_H - -#include -#include -#include - -namespace upgrade { -class PreferenceInfo{ - public: - PreferenceInfo(std::string key, std::string value); - std::string getSection() {return m_section_;} - std::string getKey() {return m_key_;} - std::string getValue() {return m_value_;} - private: - std::string m_section_; - std::string m_key_; - std::string m_value_; -}; - -class SecurityOriginInfo{ - public: - SecurityOriginInfo( - int feature, - std::string scheme, - std::string host, - int port, - int result); - std::string getSection() {return m_section_;} - std::string getKey() {return m_key_;} - std::string getValue() {return m_value_;} - private: - std::string translateKey( - int feature, - std::string scheme, - std::string host, - int port); - std::string translateValue(int result); - std::string m_section_; - std::string m_key_; - std::string m_value_; -}; - -class CertificateInfo{ - public: - CertificateInfo( - std::string pem, - int result); - std::string getSection() {return m_section_;} - std::string getKey() {return m_key_;} - std::string getValue() {return m_value_;} - private: - std::string translateKey(std::string pem); - std::string translateValue(int result); - std::string m_section_; - std::string m_key_; - std::string m_value_; -}; - -class WrtUpgradeInfo{ - public: - WrtUpgradeInfo() {} - explicit WrtUpgradeInfo(std::string appid); - - std::string getAppid() { return app_id_; } - std::string getPkgid() { return pkg_id_; } - std::string getAppDir() { return app_dir_; } - std::string getSecurityOriginDB(); - std::string getCertificateDB(); - - void addPreferenceInfo(PreferenceInfo preference); - void addSecurityOriginInfo(SecurityOriginInfo security_origin); - void addCertificateInfo(CertificateInfo certificate); - - PreferenceInfo getPreferenceInfo(int idx) - {return preference_info_list_[idx];} - SecurityOriginInfo getSecurityOriginInfo(int idx) - {return security_origin_info_list_[idx];} - CertificateInfo getCertificateInfo(int idx) - {return certificate_info_list[idx];} - - int getPreferenceInfoSize() - {return static_cast(preference_info_list_.size());} - int getSecurityOriginInfoSize() - {return static_cast(security_origin_info_list_.size());} - int getCertificateInfoSize() - {return static_cast(certificate_info_list.size());} - - private: - std::string pkg_id_; - std::string app_id_; - std::string app_dir_; - std::vector preference_info_list_; - std::vector security_origin_info_list_; - std::vector certificate_info_list; -}; -} // namespace upgrade -#endif // WRT_UPGRADE_INFO_H diff --git a/wrt-upgrade/wrt-upgrade.cc b/wrt-upgrade/wrt-upgrade.cc deleted file mode 100755 index 43e7ea4..0000000 --- a/wrt-upgrade/wrt-upgrade.cc +++ /dev/null @@ -1,294 +0,0 @@ -// Copyright (c) 2013 Intel Corporation. All rights reserved. -// Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "wrt-upgrade/wrt-upgrade.h" - -#include -#include - -#include -#include -#include - -#include "common/picojson.h" -#include "common/logger.h" -#include "common/file_utils.h" - -namespace { - const std::string kWRTDbFile = "/opt/dbspace/.wrt.db"; - const std::string kAppDirectoryPrefix = "/opt/usr/home/owner/apps_rw/"; - const std::string kAppMigrationFile = "/data/.runtime.migration"; - const std::string kJournalPostfix = "-journal"; -} // namespace - -namespace upgrade { -WrtUpgrade::WrtUpgrade() { -} -WrtUpgrade::~WrtUpgrade() { -} -void WrtUpgrade::Run() { - ParseWrtDatabse(); - ParseSecurityOriginDatabase(); - ParseCertificatenDatabase(); - CreateMigrationFile(); - RemoveDatabases(); -} -void WrtUpgrade::ParseWrtDatabse() { - std::cout << "parseWrtDatabse" << std::endl; - sqlite3 *wrt_db; - try { - int ret = sqlite3_open(kWRTDbFile.c_str(), &wrt_db); - if (ret != SQLITE_OK) { - throw("error to open wrt database"); - } - - // get applist - std::string query = "select tizen_appid from widgetinfo"; - sqlite3_stmt* stmt = NULL; - - ret = sqlite3_prepare_v2(wrt_db, query.c_str() , -1, &stmt, NULL); - if (ret != SQLITE_OK) { - throw("error for prepare query"); - } - - while (SQLITE_ROW == sqlite3_step(stmt)) { - std::string appid - = std::string(reinterpret_cast( - sqlite3_column_text(stmt, 0))); - application_list_.push_back(appid); - application_map_.insert( - std::pair(appid, WrtUpgradeInfo(appid))); - } - - ret = sqlite3_finalize(stmt); - if (ret != SQLITE_OK) { - throw("error for finalize stmt"); - } - - // get widget preference - query = "select tizen_appid,key_name,key_value from widgetpreference"; - stmt = NULL; - - ret = sqlite3_prepare_v2(wrt_db, query.c_str() , -1, &stmt, NULL); - if (ret != SQLITE_OK) { - throw("error for prepare query"); - } - - while (SQLITE_ROW == sqlite3_step(stmt)) { - std::string appid - = std::string(reinterpret_cast( - sqlite3_column_text(stmt, 0))); - std::string key - = std::string(reinterpret_cast( - sqlite3_column_text(stmt, 1))); - std::string value - = std::string(reinterpret_cast( - sqlite3_column_text(stmt, 2))); - - application_map_[appid].addPreferenceInfo(PreferenceInfo(key, value)); - } - ret = sqlite3_finalize(stmt); - if (ret != SQLITE_OK) { - throw("error for finalize stmt"); - } - } catch(const char* err) { - std::cout << err << std::endl; - } - sqlite3_close(wrt_db); -} -void WrtUpgrade::ParseSecurityOriginDatabase() { - std::cout << "parseSecurityOriginDatabase" << std::endl; - for (int i = 0; i < static_cast(application_list_.size()) ; i++) { - sqlite3 *security_origin_db; - std::string appid = application_list_[i]; - try { - std::string db_path = application_map_[appid].getSecurityOriginDB(); - - if (access(db_path.c_str(), 0) != 0) { - throw("file is not exist : ["+db_path+"]"); - } - int ret = sqlite3_open(db_path.c_str(), &security_origin_db); - if (ret != SQLITE_OK) { - throw("error to open wrt database"); - } - - // get applist - std::string query = "select * from securityorigininfo"; - sqlite3_stmt* stmt = NULL; - - ret = sqlite3_prepare_v2( - security_origin_db, query.c_str() , -1, &stmt, NULL); - if (ret != SQLITE_OK) { - throw("error for prepare query"); - } - - while (SQLITE_ROW == sqlite3_step(stmt)) { - int feature = sqlite3_column_int(stmt, 0); - std::string scheme - = std::string(reinterpret_cast( - sqlite3_column_text(stmt, 1))); - std::string host - = std::string(reinterpret_cast( - sqlite3_column_text(stmt, 2))); - int port = sqlite3_column_int(stmt, 3); - int result = sqlite3_column_int(stmt, 4); - application_map_[appid].addSecurityOriginInfo( - SecurityOriginInfo(feature, scheme, host, port, result)); - } - - ret = sqlite3_finalize(stmt); - if (ret != SQLITE_OK) { - throw("error for finalize stmt"); - } - } catch(...) { - } - sqlite3_close(security_origin_db); - } -} -void WrtUpgrade::ParseCertificatenDatabase() { - std::cout << "parseCertificateDatabase" << std::endl; - for (int i = 0 ; i < static_cast(application_list_.size()) ; i++) { - sqlite3 *certificate_db; - std::string appid = application_list_[i]; - try { - std::string db_path = application_map_[appid].getCertificateDB(); - - if (access(db_path.c_str(), 0) != 0) { - throw("file is not exist : ["+db_path+"]"); - } - int ret = sqlite3_open(db_path.c_str(), &certificate_db); - if (ret != SQLITE_OK) { - throw("error to open wrt database"); - } - - // get applist - std::string query = "select * from certificateinfo"; - sqlite3_stmt* stmt = NULL; - - ret = sqlite3_prepare_v2(certificate_db, query.c_str() , -1, &stmt, NULL); - if (ret != SQLITE_OK) { - throw("error for prepare query"); - } - - while (SQLITE_ROW == sqlite3_step(stmt)) { - std::string certificate - = std::string(reinterpret_cast( - sqlite3_column_text(stmt, 0))); - int result = sqlite3_column_int(stmt, 1); - application_map_[appid].addCertificateInfo( - CertificateInfo(certificate, result)); - } - - ret = sqlite3_finalize(stmt); - if (ret != SQLITE_OK) { - throw("error for finalize stmt"); - } - } catch(...) { - } - sqlite3_close(certificate_db); - } -} -void WrtUpgrade::CreateMigrationFile() { - std::cout << "createMigrationFile" << std::endl; - for (int i = 0 ; i < static_cast(application_list_.size()) ; i++) { - std::string appid = application_list_[i]; - std::string json_str = CreateJsonObject(appid); - if (!json_str.empty()) { - std::string pkg_id = appid.substr(0, appid.find_first_of('.')); - std::string output_file_path - = kAppDirectoryPrefix + pkg_id + kAppMigrationFile; - std::ofstream output_file(output_file_path); - output_file << json_str; - output_file.close(); - } - } -} -void WrtUpgrade::RemoveDatabases() { - for (int i = 0 ; i < static_cast(application_list_.size()) ; i++) { - std::string appid = application_list_[i]; - try { - std::string security_origin_db_path - = application_map_[appid].getSecurityOriginDB(); - std::string security_origin_journal_db_path - = security_origin_db_path + kJournalPostfix; - std::string certificate_db_path - = application_map_[appid].getCertificateDB(); - std::string certificate_journal_db_path - = certificate_db_path + kJournalPostfix; - - RemoveFile(security_origin_db_path); - RemoveFile(security_origin_journal_db_path); - RemoveFile(certificate_db_path); - RemoveFile(certificate_journal_db_path); - } catch(...) { - } - } -} -std::string WrtUpgrade::CreateJsonObject(std::string appid) { - WrtUpgradeInfo info = application_map_[appid]; - - if (info.getPreferenceInfoSize() == 0 - && info.getSecurityOriginInfoSize() == 0 - && info.getCertificateInfoSize() == 0) { - return ""; - } - std::cout << "createJsonObject for " << appid << std::endl; - - // make preference value arr : vector - picojson::array preference_arr; - for (int i = 0 ; i < info.getPreferenceInfoSize() ; i++) { - PreferenceInfo p_info = info.getPreferenceInfo(i); - picojson::object obj; - obj["key"] = picojson::value(p_info.getKey()); - obj["value"] = picojson::value(p_info.getValue()); - preference_arr.push_back(picojson::value(obj)); - } - - // make security_origin value arr : vector - picojson::array securityorigin_arr; - for (int i = 0 ; i < info.getSecurityOriginInfoSize() ; i++) { - SecurityOriginInfo s_info = info.getSecurityOriginInfo(i); - picojson::object obj; - obj["section"] = picojson::value(s_info.getSection()); - obj["key"] = picojson::value(s_info.getKey()); - obj["value"] = picojson::value(s_info.getValue()); - securityorigin_arr.push_back(picojson::value(obj)); - } - - // make certificate value arr : vector - picojson::array certificate_arr; - for (int i = 0 ; i < info.getCertificateInfoSize() ; i++) { - CertificateInfo c_info = info.getCertificateInfo(i); - picojson::object obj; - obj["section"] = picojson::value(c_info.getSection()); - obj["key"] = picojson::value(c_info.getKey()); - obj["value"] = picojson::value(c_info.getValue()); - certificate_arr.push_back(picojson::value(obj)); - } - - // make one json - picojson::object migration_obj; - migration_obj["preference"] = picojson::value(preference_arr); - migration_obj["security_orgin"] = picojson::value(securityorigin_arr); - migration_obj["certificate"] = picojson::value(certificate_arr); - - picojson::value migration_val = picojson::value(migration_obj); - std::string json_str = migration_val.serialize(); - return json_str; -} -bool WrtUpgrade::RemoveFile(const std::string& path) { - if (!common::utils::Exists(path)) { - LOGGER(ERROR) << "File is not Exist : " << path; - return false; - } - return (remove(path.c_str()) == 0); -} -} // namespace upgrade -int main() { - std::cout << "Tizen database migration tool for Webruntime" << std::endl; - upgrade::WrtUpgrade mt; - mt.Run(); - return 0; -} diff --git a/wrt-upgrade/wrt-upgrade.gyp b/wrt-upgrade/wrt-upgrade.gyp deleted file mode 100755 index 55b48a6..0000000 --- a/wrt-upgrade/wrt-upgrade.gyp +++ /dev/null @@ -1,38 +0,0 @@ -{ - 'includes': [ - '../build/common.gypi', - ], - 'targets': [ - { - 'target_name': 'wrt-upgrade', - 'type': 'executable', - 'dependencies': [ - '../common/common.gyp:xwalk_tizen_common', - ], - 'sources': [ - 'wrt-upgrade.cc', - 'wrt-upgrade-info.cc', - ], - 'ldflags': [ - '-pie', - ], - 'variables': { - 'packages': [ - 'sqlite3', - 'dlog', - ], - }, - 'libraries' : [ - '-ldl', - ], - 'copies': [ - { - 'destination': '<(SHARED_INTERMEDIATE_DIR)', - 'files': [ - '720.wrt.upgrade.sh' - ], - }, - ], - }, # end of target 'wrt-upgrade' - ], # end of targets -} diff --git a/wrt-upgrade/wrt-upgrade.h b/wrt-upgrade/wrt-upgrade.h deleted file mode 100644 index 110cf46..0000000 --- a/wrt-upgrade/wrt-upgrade.h +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2013 Intel Corporation. All rights reserved. -// Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef WRT_UPGRADE_H -#define WRT_UPGRADE_H -#include -#include -#include -#include - -#include "wrt-upgrade/wrt-upgrade-info.h" - -namespace upgrade { -class WrtUpgrade{ - public: - WrtUpgrade(); - ~WrtUpgrade(); - void Run(); - private: - void ParseWrtDatabse(); - void ParseSecurityOriginDatabase(); - void ParseCertificatenDatabase(); - void CreateMigrationFile(); - void RemoveDatabases(); - bool RemoveFile(const std::string& path); - void RedirectSymlink(); - std::string CreateJsonObject(std::string appid); - std::vector application_list_; - std::map application_map_; -}; -} // namespace upgrade -#endif // WRT_UPGRADE_H diff --git a/xwalk_tizen.gyp b/xwalk_tizen.gyp index 94dea57..4c6f3a9 100644 --- a/xwalk_tizen.gyp +++ b/xwalk_tizen.gyp @@ -8,7 +8,6 @@ 'extensions/extensions.gyp:*', 'runtime/runtime.gyp:*', 'loader/loader.gyp:*', - 'wrt-upgrade/wrt-upgrade.gyp:*', ], }, # end of target 'xwalk_tizen' ], # end of targets -- 2.7.4 From 40ec744190fd68ed603de6da7eb89336738772d8 Mon Sep 17 00:00:00 2001 From: "min7.choi" Date: Tue, 9 Jan 2018 15:46:31 +0900 Subject: [PATCH 11/16] Remove Ecore-wayland dependency In Tizen 5.0, upgrading EFL to opensource EFL 1.20 version. Upstream has deprecated ecore-wayland and changed its policy to use ecore-wl2. In crosswalk, there is one api with an ecore-wayland dependency(ecore_wl_screen_size_get()). This can be replaced by elm_win_screen_size_get() api. So removed the ecore-wayland dependency and used elm_win_screen_size_get() Change-Id: I7083eec69a98f0cae5fe1406d1544fc2f1557cac Signed-off-by: min7.choi --- packaging/crosswalk-tizen.spec | 1 - runtime/browser/native_window.cc | 3 +-- runtime/browser/notification_window.cc | 1 - runtime/browser/runtime_process.cc | 1 - runtime/browser/splash_screen.cc | 7 +++---- runtime/browser/splash_screen.h | 2 +- runtime/runtime.gyp | 1 - 7 files changed, 5 insertions(+), 11 deletions(-) diff --git a/packaging/crosswalk-tizen.spec b/packaging/crosswalk-tizen.spec index b78ff93..945b02e 100755 --- a/packaging/crosswalk-tizen.spec +++ b/packaging/crosswalk-tizen.spec @@ -34,7 +34,6 @@ BuildRequires: pkgconfig(cynara-client) BuildRequires: pkgconfig(deviced) BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(ecore) -BuildRequires: pkgconfig(ecore-wayland) BuildRequires: pkgconfig(efl-extension) BuildRequires: pkgconfig(elementary) BuildRequires: pkgconfig(glib-2.0) diff --git a/runtime/browser/native_window.cc b/runtime/browser/native_window.cc index 43f6bef..7845b2d 100755 --- a/runtime/browser/native_window.cc +++ b/runtime/browser/native_window.cc @@ -16,7 +16,6 @@ #include "runtime/browser/native_window.h" -#include #include #include #include @@ -96,7 +95,7 @@ void NativeWindow::Initialize() { window_ = CreateWindowInternal(); elm_win_conformant_set(window_, EINA_TRUE); int w, h; - ecore_wl_screen_size_get(&w, &h); + elm_win_screen_size_get(window_, NULL, NULL, &w, &h); evas_object_resize(window_, w, h); elm_win_size_base_set(window_, w, h); elm_win_autodel_set(window_, EINA_TRUE); diff --git a/runtime/browser/notification_window.cc b/runtime/browser/notification_window.cc index ee70e53..e701601 100644 --- a/runtime/browser/notification_window.cc +++ b/runtime/browser/notification_window.cc @@ -15,7 +15,6 @@ */ #include -#include #include namespace runtime { diff --git a/runtime/browser/runtime_process.cc b/runtime/browser/runtime_process.cc index 4a1576b..6b8e2ad 100755 --- a/runtime/browser/runtime_process.cc +++ b/runtime/browser/runtime_process.cc @@ -20,7 +20,6 @@ #include #include -#include #include "common/application_data.h" #include "common/command_line.h" diff --git a/runtime/browser/splash_screen.cc b/runtime/browser/splash_screen.cc index 6b7b456..fe86062 100755 --- a/runtime/browser/splash_screen.cc +++ b/runtime/browser/splash_screen.cc @@ -20,7 +20,6 @@ #include #include -#include #include #include "common/logger.h" @@ -111,7 +110,7 @@ SplashScreen::SplashScreen( ChooseOrientation(splash_map, window->orientation()); if (used_orientation == wgt::parse::ScreenOrientation::NONE) return; - auto dimensions = GetDimensions(); + auto dimensions = GetDimensions(window); SetBackground(splash_map[used_orientation], window->evas_object(), dimensions, app_path); @@ -145,9 +144,9 @@ void SplashScreen::HideSplashScreen(HideReason reason) { is_active_ = false; } -std::pair SplashScreen::GetDimensions() { +std::pair SplashScreen::GetDimensions(NativeWindow* window) { int w, h; - ecore_wl_screen_size_get(&w, &h); + elm_win_screen_size_get(window->evas_object(), NULL, NULL, &w, &h); evas_object_resize(background_, w, h); return std::make_pair(w, h); } diff --git a/runtime/browser/splash_screen.h b/runtime/browser/splash_screen.h index 11d49cd..bde9894 100755 --- a/runtime/browser/splash_screen.h +++ b/runtime/browser/splash_screen.h @@ -41,7 +41,7 @@ class SplashScreen { void HideSplashScreen(HideReason reason); private: - std::pair GetDimensions(); + std::pair GetDimensions(NativeWindow* window); void SetBackground(const wgt::parse::LaunchScreenData& splash_data, Evas_Object* parent, const SplashScreenBound& bound, const std::string& app_path); diff --git a/runtime/runtime.gyp b/runtime/runtime.gyp index 0beb057..5b5d394 100755 --- a/runtime/runtime.gyp +++ b/runtime/runtime.gyp @@ -57,7 +57,6 @@ 'capi-system-info', 'chromium-efl', 'ecore', - 'ecore-wayland', 'elementary', 'efl-extension', 'deviced', -- 2.7.4 From 1cb8937fe537ba3cd7f3e37b80faef677857b289 Mon Sep 17 00:00:00 2001 From: Guneet K Date: Mon, 5 Feb 2018 11:38:58 +0530 Subject: [PATCH 12/16] Set background color as black for wearable web apps [Model] COMMON [BinType] AP [Customer] [Issue#] P170609-03650 [Request] N/A [Occurrence Version] DayR765AUC_20170607.002 [Problem] White background displayed for KA Stock App instead of black background [Cause & Measure] Cause: Background color is set as black only for watchfaces. Hence default bg color for web apps is white Measure: Call ewk_view_bg_color_set to set background color as black for web apps [Checking Method] 1. Build and install crosswalk-tizen rpm 2. Install KA Stock web app 3. Background color of web app should be black Change-Id: I50f8c24f9f735ebb0ef24f49d9e8a1ebdbb11999 Signed-off-by: Guneet K --- runtime/browser/web_application.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index 014e882..27ff04c 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -584,10 +584,10 @@ void WebApplication::Launch(std::unique_ptr appcontrol) { } // ewk_view_bg_color_set is not working at webview initialization. - if (common::getProfile() == common::kPROFILE_WEARABLE && - app_data_->app_type() == common::ApplicationData::WATCH) { - view->SetBGColor(0, 0, 0, 255); - } + // if (common::getProfile() == common::kPROFILE_WEARABLE && + // app_data_->app_type() == common::ApplicationData::WATCH) { + view->SetBGColor(0, 0, 0, 255); + //} if (appcontrol->data(AUL_K_DEBUG) == "1") { debug_mode_ = true; -- 2.7.4 From 7d7034a40127f1f8731694950ec3ac7e32118612 Mon Sep 17 00:00:00 2001 From: Guneet K Date: Mon, 5 Feb 2018 17:00:00 +0530 Subject: [PATCH 13/16] [compatibility] Set background color as black for wearable web apps Call ewk_view_bg_color_set to set background color as black for web apps. Background color is set as black only for watchfaces. Hence default bg color for web apps is white. [Reference] http://slp-info.sec.samsung.net/gerrit/#/c/3106551 Change-Id: Iec328524219b009701e394aa71bb8cb588e8378b Signed-off-by: Guneet K --- runtime/browser/web_application.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index 27ff04c..8838e50 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -584,10 +584,9 @@ void WebApplication::Launch(std::unique_ptr appcontrol) { } // ewk_view_bg_color_set is not working at webview initialization. - // if (common::getProfile() == common::kPROFILE_WEARABLE && - // app_data_->app_type() == common::ApplicationData::WATCH) { - view->SetBGColor(0, 0, 0, 255); - //} + if (common::getProfile() == common::kPROFILE_WEARABLE) { + view->SetBGColor(0, 0, 0, 255); + } if (appcontrol->data(AUL_K_DEBUG) == "1") { debug_mode_ = true; -- 2.7.4 From 05630a9f230f1ea489209343489719f7957640d0 Mon Sep 17 00:00:00 2001 From: Guneet K Date: Thu, 1 Feb 2018 19:08:51 +0530 Subject: [PATCH 14/16] [compatibility] Implemented window resize for non circular apps Apps with 320x320 and square apps are not displayed properly. View is truncated. Resize the view to 320x320 so that maximum possible view is displayed in visible area. These kind of apps are identified by profile tag. --------------------------------------------- | SlNo| Profile | Value | Display | --------------------------------------------- | 1 | Not Present | NA | 320x320 | | 2 | Present | mobile | 320x320 | | 3 | Present | NULL | 320x320 | | 4 | Present | wearable | 360x360 | --------------------------------------------- [Reference] http://slp-info.sec.samsung.net/gerrit/#/c/3119525/ Change-Id: I3b60cc73910b462becfa04e9112fe39f15203511 Signed-off-by: Guneet K Signed-off-by: deepti --- common/application_data.cc | 10 ++++++++++ common/application_data.h | 7 +++++++ common/platform_info.h | 2 ++ runtime/browser/native_window.cc | 15 ++++++++++++-- runtime/browser/native_window.h | 7 +++++++ runtime/browser/preload_manager.cc | 4 +++- runtime/browser/ui_runtime.cc | 24 +++++++++++++++++++---- runtime/browser/watch_runtime.cc | 18 +++++++++++++++-- runtime/browser/web_application.cc | 12 ++++++++++++ runtime/browser/web_application.h | 1 + runtime/resources/xwalk_tizen.edc | 40 +++++++++++++++++++++++++++++++++----- runtime/runtime.gyp | 3 ++- 12 files changed, 128 insertions(+), 15 deletions(-) diff --git a/common/application_data.cc b/common/application_data.cc index b25d347..d4e5c05 100755 --- a/common/application_data.cc +++ b/common/application_data.cc @@ -121,6 +121,11 @@ std::shared_ptr return csp_report_info_; } +std::shared_ptr + ApplicationData::profile_tag_info() const { + return profile_tag_info_; +} + const std::string ApplicationData::pkg_id() const { if (pkg_id_.empty()) { app_info_h app_info; @@ -243,6 +248,11 @@ bool ApplicationData::LoadManifestData() { widget_config_parser->GetManifestData( wgt::parse::CSPInfo::Report_only_key())); + profile_tag_info_ = + std::static_pointer_cast( + widget_config_parser->GetManifestData( + wgt::parse::ProfileTagInfo::Key())); + // Set default empty object if (widget_info_.get() == NULL) { widget_info_.reset(new wgt::parse::WidgetInfo); diff --git a/common/application_data.h b/common/application_data.h index aa910e2..4419123 100755 --- a/common/application_data.h +++ b/common/application_data.h @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -78,6 +79,8 @@ class ApplicationData { csp_info() const; std::shared_ptr csp_report_info() const; + std::shared_ptr + profile_tag_info() const; const std::string application_path() const { return application_path_; } const std::string pkg_id() const; @@ -111,6 +114,10 @@ class ApplicationData { csp_info_; std::shared_ptr csp_report_info_; + + std::shared_ptr + profile_tag_info_; + ApplicationData::AppType GetAppType(); std::string application_path_; diff --git a/common/platform_info.h b/common/platform_info.h index 009c6f7..20732f7 100644 --- a/common/platform_info.h +++ b/common/platform_info.h @@ -38,6 +38,8 @@ enum _profile { (common::getProfile() & ((common::kPROFILE_WEARABLE))) #define TIZEN_FEATURE_rotary_event_support \ (common::getProfile() & ((common::kPROFILE_WEARABLE))) +#define TIZEN_FEATURE_display_resize_support \ + (common::getProfile() & ((common::kPROFILE_WEARABLE))) extern enum _profile getProfile(void); diff --git a/runtime/browser/native_window.cc b/runtime/browser/native_window.cc index 7845b2d..5cf9f35 100755 --- a/runtime/browser/native_window.cc +++ b/runtime/browser/native_window.cc @@ -78,9 +78,13 @@ NativeWindow::NativeWindow() progressbar_(NULL), top_layout_(NULL), rotation_(0), - handler_id_(0) { + handler_id_(0), + natural_orientation_(ScreenOrientation::PORTRAIT_PRIMARY), + display_shape_type_(Shape::STANDARD) + { } + NativeWindow::~NativeWindow() { if (window_) evas_object_del(window_); @@ -124,7 +128,14 @@ void NativeWindow::Initialize() { // top layout Evas_Object* top_layout = elm_layout_add(conformant); - elm_layout_file_set(top_layout, kEdjePath, "web-application"); + if (display_shape_type_ == Shape::SQUARE) { + LOGGER(DEBUG) << "Device shape square"; + elm_layout_file_set(top_layout, kEdjePath, "web-applicationsview"); + } else { + LOGGER(DEBUG) << "Device shape standard"; + elm_layout_file_set(top_layout, kEdjePath, "web-application"); + } + EVAS_SIZE_EXPAND_FILL(top_layout); elm_object_content_set(conformant, top_layout); evas_object_show(top_layout); diff --git a/runtime/browser/native_window.h b/runtime/browser/native_window.h index a305389..330edcf 100755 --- a/runtime/browser/native_window.h +++ b/runtime/browser/native_window.h @@ -38,6 +38,10 @@ class NativeWindow { NORMAL = 0, NOTIFICATION = 1 }; + enum class Shape { + STANDARD = 0, + SQUARE = 1 + }; typedef std::function RotationHandler; NativeWindow(); virtual ~NativeWindow(); @@ -63,6 +67,8 @@ class NativeWindow { Type type() const { return window_type_;} void EnableManualRotation(bool enable); void ManualRotationDone(); + void SetDisplayShape(Shape disp_shape) { display_shape_type_ = disp_shape; } + Shape GetDisplayShape() { return display_shape_type_; } void SignalEmit(const char* emission, const char* source); void UpdateProgress(double value); @@ -87,6 +93,7 @@ class NativeWindow { int rotation_; int handler_id_; ScreenOrientation natural_orientation_; + Shape display_shape_type_; std::map handler_table_; }; diff --git a/runtime/browser/preload_manager.cc b/runtime/browser/preload_manager.cc index 53317ae..a8c482a 100755 --- a/runtime/browser/preload_manager.cc +++ b/runtime/browser/preload_manager.cc @@ -21,6 +21,7 @@ #include #include +#include "common/platform_info.h" #include "common/logger.h" #include "runtime/browser/native_app_window.h" #include "extensions/common/xwalk_extension_server.h" @@ -49,7 +50,8 @@ void PreloadManager::CreateCacheComponet() { ewk_context_new_with_injected_bundle_path(INJECTED_BUNDLE_PATH); context = context; // To prevent build warning cached_window_.reset(new NativeAppWindow()); - cached_window_->Initialize(); + if (!TIZEN_FEATURE_display_resize_support) + cached_window_->Initialize(); } NativeWindow* PreloadManager::GetCachedNativeWindow() { diff --git a/runtime/browser/ui_runtime.cc b/runtime/browser/ui_runtime.cc index 7a6188f..9ea592b 100755 --- a/runtime/browser/ui_runtime.cc +++ b/runtime/browser/ui_runtime.cc @@ -27,6 +27,7 @@ #include "common/app_db.h" #include "common/command_line.h" #include "common/logger.h" +#include "common/platform_info.h" #include "common/profiler.h" #include "runtime/common/constants.h" #include "runtime/browser/native_app_window.h" @@ -40,9 +41,9 @@ namespace { const char kCategoryAlwaysOnTop[] = "http://tizen.org/category/always_on_top"; -static NativeWindow* CreateNativeWindow(NativeWindow::Type windowType) { +static NativeWindow* CreateNativeWindow(NativeWindow::Type windowType, + NativeWindow::Shape win_shape) { SCOPE_PROFILE(); - NativeWindow* window; switch (windowType) { @@ -58,6 +59,7 @@ static NativeWindow* CreateNativeWindow(NativeWindow::Type windowType) { } break; } + window->SetDisplayShape(win_shape); window->Initialize(); return window; @@ -76,6 +78,19 @@ bool AlwaysTopRequested(common::AppControl* appcontrol) { return appcontrol->data("always_on_top") == "true"; } +const char kConfigProfile[] = "mobile"; +NativeWindow::Shape GetWindowType(common::ApplicationData* app_data) { + // As profile tag is not present app will be treated as square app + if (!app_data->profile_tag_info()) { + return NativeWindow::Shape::SQUARE; + } + std::string type = app_data->profile_tag_info()->GetProfileType(); + if (!type.compare(kConfigProfile)) { + return NativeWindow::Shape::SQUARE; + } + return NativeWindow::Shape::STANDARD; +} + } // namespace UiRuntime::UiRuntime(common::ApplicationData* app_data) @@ -100,8 +115,9 @@ void UiRuntime::ResetWebApplication(NativeWindow::Type windowType) { application_.reset(); native_window_.reset(); - - native_window_.reset(CreateNativeWindow(windowType)); + if (TIZEN_FEATURE_display_resize_support) + native_window_.reset(CreateNativeWindow(windowType, GetWindowType(app_data_))); + else native_window_.reset(CreateNativeWindow(windowType, NativeWindow::Shape::STANDARD)); LOGGER(DEBUG) << "runtime.cc Created native window"; application_.reset(new WebApplication(native_window_.get(), app_data_, diff --git a/runtime/browser/watch_runtime.cc b/runtime/browser/watch_runtime.cc index 39302ca..749e4f9 100755 --- a/runtime/browser/watch_runtime.cc +++ b/runtime/browser/watch_runtime.cc @@ -35,7 +35,7 @@ namespace runtime { namespace { -static NativeWindow* CreateNativeWindow() { +static NativeWindow* CreateNativeWindow(NativeWindow::Shape win_shape) { SCOPE_PROFILE(); NativeWindow* window = NULL; auto cached = PreloadManager::GetInstance()->GetCachedNativeWindow(); @@ -43,11 +43,25 @@ static NativeWindow* CreateNativeWindow() { delete cached; } window = new NativeWatchWindow(); + window->SetDisplayShape(win_shape); window->Initialize(); return window; } +const char kConfigProfile[] = "mobile"; +NativeWindow::Shape GetWindowType(common::ApplicationData* app_data) { + // As profile tag is not present app will be treated as square app + if (!app_data->profile_tag_info()) { + return NativeWindow::Shape::SQUARE; + } + std::string type = app_data->profile_tag_info()->GetProfileType(); + if (!type.compare(kConfigProfile)) { + return NativeWindow::Shape::SQUARE; + } + return NativeWindow::Shape::STANDARD; +} + } // namespace WatchRuntime::WatchRuntime(common::ApplicationData* app_data) @@ -85,7 +99,7 @@ bool WatchRuntime::OnCreate() { appdb->Remove(kAppDBRuntimeSection, kAppDBRuntimeBundle); // Init WebApplication - native_window_ = CreateNativeWindow(); + native_window_ = CreateNativeWindow(GetWindowType(app_data_)); STEP_PROFILE_START("WebApplication Create"); application_ = new WebApplication(native_window_, app_data_); STEP_PROFILE_END("WebApplication Create"); diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index 8838e50..0963b0f 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -539,6 +539,8 @@ void WebApplication::Launch(std::unique_ptr appcontrol) { WebView* view = new WebView(window_, ewk_context_); SetupWebView(view); SetupWebViewCompatibilitySettings(view); + if (TIZEN_FEATURE_display_resize_support) + SetDisplayEffect(view); std::unique_ptr res = resource_manager_->GetStartResource(appcontrol.get()); @@ -1279,6 +1281,16 @@ void WebApplication::SetupWebViewCompatibilitySettings(WebView* view) { } } +void WebApplication::SetDisplayEffect(WebView* view) { + if (window_->GetDisplayShape() == NativeWindow::Shape::SQUARE) { + // Currently blur effect API is called on view, which is not + // correct. Needs to be moved to context. Once new API is + // provided on context below code will get changed. + LOGGER(DEBUG) << "WebApplication::Set Blur effect"; + ewk_view_mirrored_blur_set(view->evas_object(), true); + } +} + bool WebApplication::OnDidNavigation(WebView* /*view*/, const std::string& url) { // scheme handling diff --git a/runtime/browser/web_application.h b/runtime/browser/web_application.h index 99e56d0..d85aa6e 100755 --- a/runtime/browser/web_application.h +++ b/runtime/browser/web_application.h @@ -120,6 +120,7 @@ class WebApplication : public WebView::EventListener { void LaunchInspector(common::AppControl* appcontrol); void SetupWebView(WebView* view); void SetupWebViewCompatibilitySettings(WebView* view); + void SetDisplayEffect(WebView* view); void RemoveWebViewFromStack(WebView* view); void SetupTizenVersion(); diff --git a/runtime/resources/xwalk_tizen.edc b/runtime/resources/xwalk_tizen.edc index a48c190..c612e64 100755 --- a/runtime/resources/xwalk_tizen.edc +++ b/runtime/resources/xwalk_tizen.edc @@ -25,11 +25,6 @@ collections { type: SWALLOW; description { state: "default" 0.0; - fixed: 1 1; - rel1 { relative: 0.0 0.0; to: base; } - rel2 { relative: 1.0 1.0; to: base; } - align: 0.0 0.0; - } /* ratio 1x1 (only for gear3) */ description { @@ -95,6 +90,41 @@ collections { }//end of group group { + name: "web-applicationsview"; + inherit: "web-application"; + parts{ + part { + name: "elm.swallow.content"; + scale: 0; + type: SWALLOW; + description { + state: "default" 0.0; + //rel1 { offset: 20 20; } + //rel2 { offset: -20 -20; } + min: 320 320; + max: 320 320; + fixed: 1 1; + } + // Below code will also do the same + /*description { + state: "default" 0.0; + rel1 { offset: 20 20; } + rel2 { offset: -20 -20; } + }*/ + + /* ratio 1x1 (only for gear3) */ + description { + state: "ratio1x1" 0.0; + fixed: 1 1; + aspect: 1 1; + aspect_preference: BOTH; + align: 0.5 0.5; + } + } + } + } + + group { name: "PopupTextEntrySet"; parts{ part { diff --git a/runtime/runtime.gyp b/runtime/runtime.gyp index 5b5d394..1a43272 100755 --- a/runtime/runtime.gyp +++ b/runtime/runtime.gyp @@ -72,7 +72,8 @@ 'defines': ['TIZEN_PRODUCT_TV'], }], ['tizen_model_formfactor == "circle"', { - 'defines': ['MODEL_FORMFACTOR_CIRCLE'], + 'defines': ['MODEL_FORMFACTOR_CIRCLE', + 'DISPLAY_RESIZE_SUPPORT'], }], ['tizen_feature_rotary_event_support == 1', { 'defines': ['ROTARY_EVENT_FEATURE_SUPPORT'], -- 2.7.4 From 5c4f17218595a535cba3378d1a7828974d430218 Mon Sep 17 00:00:00 2001 From: deepti Date: Wed, 14 Feb 2018 12:15:06 +0530 Subject: [PATCH 15/16] [compatibility] 1)Don't show window in suspend state 2)Show window object if there's delay in receiving frame rendered event 1)Window is shown even after app is suspended Window is shown on receiving frame,rendered call back. frame,rendered call back is invoking for every frame load Measure: Maintain a state variable for suspend. In suspended state don't show window on frame,rendered call back 2)xwalk shows window object once frame rendered callback is received. For this app, before frame rendered step is reached, alert function (synchronized job) is used which suspends the engine and frame rendered event is never emitted Provide a fallback mechanism from xwalk side to show the window irrespectively after a certain time [Reference] http://slp-info.sec.samsung.net/gerrit/#/c/3062458/ http://slp-info.sec.samsung.net/gerrit/#/c/3105521/ signed-off-by: deepti Change-Id: I3d8fb6b1a421a46ce135d14e754b2549fec05f7f --- runtime/browser/ui_runtime.cc | 2 ++ runtime/browser/web_application.cc | 46 ++++++++++++++++++++++++++++++++++++-- runtime/browser/web_application.h | 8 +++++++ 3 files changed, 54 insertions(+), 2 deletions(-) diff --git a/runtime/browser/ui_runtime.cc b/runtime/browser/ui_runtime.cc index 9ea592b..37212dd 100755 --- a/runtime/browser/ui_runtime.cc +++ b/runtime/browser/ui_runtime.cc @@ -151,6 +151,8 @@ bool UiRuntime::OnCreate() { setlocale(LC_ALL, ""); bindtextdomain(kTextDomainRuntime, kTextLocalePath); + application_->SetTimeoutFirstFrameDelay(); + return true; } diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index 0963b0f..2020951 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -60,6 +60,8 @@ #define SESSION_COUNTER_INTERVAL 0.1 #define MAIN_LOOP_INTERVAL 1 +static const float FirstFrameDelayWaitTime = 2.0f; + using namespace extensions; namespace runtime { @@ -321,8 +323,10 @@ WebApplication::WebApplication( lang_changed_mode_(false), is_terminate_called_(false), is_close_page_called_(false), + is_window_inactive_(false), ewk_context_( ewk_context_new_with_injected_bundle_path(INJECTED_BUNDLE_PATH)), + firstframe_delay_timer_(NULL), has_ownership_of_ewk_context_(true), window_(window), appid_(app_data->app_id()), @@ -341,7 +345,9 @@ WebApplication::WebApplication( lang_changed_mode_(false), is_terminate_called_(false), is_close_page_called_(false), + is_window_inactive_(false), ewk_context_(context), + firstframe_delay_timer_(NULL), has_ownership_of_ewk_context_(false), window_(window), appid_(app_data->app_id()), @@ -679,6 +685,7 @@ void WebApplication::Resume() { if (view_stack_.size() > 0 && view_stack_.front() != NULL) view_stack_.front()->SetVisibility(true); + is_window_inactive_ = false; if (app_data_->setting_info() != NULL && app_data_->setting_info()->background_support_enabled()) { return; @@ -694,6 +701,7 @@ void WebApplication::Suspend() { if (view_stack_.size() > 0 && view_stack_.front() != NULL) view_stack_.front()->SetVisibility(false); + is_window_inactive_ = true; if (app_data_->setting_info() != NULL && app_data_->setting_info()->background_support_enabled()) { LOGGER(DEBUG) << "gone background (backgroud support enabed)"; @@ -708,6 +716,7 @@ void WebApplication::Suspend() { void WebApplication::Terminate() { // Just process closing page once. + is_window_inactive_ = false; if (is_terminate_called_ || is_close_page_called_) return; @@ -736,6 +745,7 @@ void WebApplication::ProcessClosingPage() { ecore_main_loop_begin(); ecore_timer_del(main_loop.timer); ecore_timer_del(session_counter.timer); + UnsetTimeout(); } void WebApplication::ClosePage() { @@ -1214,14 +1224,19 @@ void WebApplication::OnRendered(WebView* view) { LOGGER(DEBUG) << "Rendered"; splash_screen_->HideSplashScreen(SplashScreen::HideReason::RENDERED); + if (firstframe_delay_timer_) { + UnsetTimeout(); + } + // Set web view into Web voice touch agent if (NULL != vc_webview_) { vc_webview_->vc_webview_set_view(view->evas_object()); } // Do not show(), active() for language change - if(lang_changed_mode_ == false){ - // Show window after frame rendered. + if(lang_changed_mode_ == false && + is_window_inactive_ == false) { + // Show window after frame rendered. if (common::getProfile() == common::kPROFILE_MOBILE) { if (common::utils::StartsWith(view->GetUrl(), kFileScheme)) { window_->Show(); @@ -1542,4 +1557,31 @@ void WebApplication::OnUsermediaPermissionRequest( popup->Show(); } +void WebApplication::SetTimeoutFirstFrameDelay() { + LOGGER(DEBUG); + firstframe_delay_timer_ = ecore_timer_add( + FirstFrameDelayWaitTime, + FirstFrameDelayTimerCallback, this); +} + +Eina_Bool WebApplication::FirstFrameDelayTimerCallback(void* data) { + LOGGER(DEBUG); + WebApplication* This = static_cast(data); + /* Do not show(), active() when window is already in background */ + if(This->is_window_inactive_ == false) { + This->window_->Show(); + This->window_->Active(); + } + This->firstframe_delay_timer_ = NULL; + return ECORE_CALLBACK_CANCEL; +} + +void WebApplication::UnsetTimeout() { + LOGGER(DEBUG); + if (firstframe_delay_timer_) { + ecore_timer_del(firstframe_delay_timer_); + firstframe_delay_timer_ = NULL; + } +} + } // namespace runtime diff --git a/runtime/browser/web_application.h b/runtime/browser/web_application.h index d85aa6e..a7eead7 100755 --- a/runtime/browser/web_application.h +++ b/runtime/browser/web_application.h @@ -112,6 +112,8 @@ class WebApplication : public WebView::EventListener { Ecore_Timer* timer; } main_loop, session_counter; + void SetTimeoutFirstFrameDelay(); + private: bool Initialize(); @@ -132,12 +134,16 @@ class WebApplication : public WebView::EventListener { bool tizenWebKitCompatibilityEnabled() const { return (m_major && m_major < 3); } } m_tizenCompatibilitySettings; + static Eina_Bool FirstFrameDelayTimerCallback(void* data); + void UnsetTimeout(); + bool launched_; bool debug_mode_; bool verbose_mode_; bool lang_changed_mode_; bool is_terminate_called_; bool is_close_page_called_; + bool is_window_inactive_; Ewk_Context* ewk_context_; bool has_ownership_of_ewk_context_; NativeWindow* window_; @@ -152,6 +158,8 @@ class WebApplication : public WebView::EventListener { std::string csp_rule_; std::string csp_report_rule_; VCWebView* vc_webview_; + + Ecore_Timer* firstframe_delay_timer_; }; } // namespace runtime -- 2.7.4 From a3d10ea3a3024a4df111443dafad5f0786bf4042 Mon Sep 17 00:00:00 2001 From: "surya.kumar7" Date: Wed, 28 Feb 2018 13:00:23 +0530 Subject: [PATCH 16/16] Print dlerror() for debugging dlopen() fails for numerous reasons and returns NULL in such cases. Logging the error will be useful for inspecting the failure reason. Change-Id: Idc21de1165537160baf1c7dfbb76a2b3c3cfe2d8 Signed-off-by: surya.kumar7 --- loader/wrt_loader.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/loader/wrt_loader.cc b/loader/wrt_loader.cc index 14ea066..d42d69d 100644 --- a/loader/wrt_loader.cc +++ b/loader/wrt_loader.cc @@ -21,7 +21,7 @@ int main(int argc, char* argv[]) { void* handle = dlopen("/usr/bin/xwalk_runtime", RTLD_NOW); if (!handle) { - dlog_print(DLOG_DEBUG, "XWALK", "Error loading xwalk_runtime"); + dlog_print(DLOG_ERROR, "XWALK", "Error loading xwalk_runtime: %s", dlerror()); return false; } @@ -29,7 +29,7 @@ int main(int argc, char* argv[]) { MAIN_FUNC real_main = reinterpret_cast(dlsym(handle, "main")); if (!real_main) { - dlog_print(DLOG_DEBUG, "XWALK", "Error loading real_main"); + dlog_print(DLOG_ERROR, "XWALK", "Error loading real_main: %s", dlerror()); return false; } -- 2.7.4