Adds source code of VconfHandle and removes bring-up tag.
Change-Id: I30a8ae83ac9e423d1a3778dca6b0aac497fd6880
Signed-off-by: DongHyun Song <dh81.song@samsung.com>
}
#endif
+#if defined(OS_TIZEN_TV_PRODUCT)
+pid_t ZygoteCommunication::GetZygotePid() {
+ return pid_;
+}
+#endif
} // namespace content
void DropProcessPrivileges(const std::string& app_id);
#endif
+#if defined(OS_TIZEN_TV_PRODUCT)
+ pid_t GetZygotePid();
+#endif
+
private:
// Should be called every time a Zygote child is born.
void ZygoteChildBorn(pid_t process);
public_configs = [ "//tizen_src/build:capi-system-info-public" ]
sources = [
+ "vconf_handle.cc",
+ "vconf_handle.h",
"system_info.h",
"system_info.cc",
]
+ deps = [ "//base" ]
}
--- /dev/null
+// Copyright 2019 Samsung Electronics. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "vconf_handle.h"
+
+#include <memory>
+
+#include "base/logging.h"
+
+#if defined(OS_TIZEN_TV_PRODUCT)
+#include <vconf/vconf_rtc.h>
+#endif
+
+VconfHandle::VconfHandle(const std::string vconf_key) {
+ vconf_key_ = vconf_key;
+}
+
+std::string VconfHandle::Str() {
+ std::unique_ptr<char, decltype(std::free)*>
+ vconf_value {vconf_get_str(vconf_key_.c_str()), std::free};
+ if (!vconf_value.get()) {
+ return std::string();
+ } else {
+ return std::string(vconf_value.get());
+ }
+}
+
+int VconfHandle::Int() {
+ int vconf_value = 0;
+ if (vconf_get_int(vconf_key_.c_str(), &vconf_value) < 0)
+ return -1;
+ return vconf_value;
+}
+
+absl::optional<bool> VconfHandle::Bool() {
+ int vconf_value = -1;
+ if (vconf_get_bool(vconf_key_.c_str(), &vconf_value) == -1)
+ return absl::nullopt;
+ return (vconf_value == 1);
+}
+
+void VconfHandle::Set(const char* value, const bool is_rtc) {
+ if (is_rtc) {
+#if defined(OS_TIZEN_TV_PRODUCT)
+ vconf_set_str_rtc(vconf_key_.c_str(), value);
+#else
+ LOG(ERROR) << "RunTimeCreated vconf is not supported";
+#endif
+ } else {
+ vconf_set_str(vconf_key_.c_str(), value);
+ }
+}
+
+void VconfHandle::Set(const std::string value, const bool is_rtc) {
+ if (is_rtc) {
+#if defined(OS_TIZEN_TV_PRODUCT)
+ vconf_set_str_rtc(vconf_key_.c_str(), value.c_str());
+#else
+ LOG(ERROR) << "RunTimeCreated vconf is not supported";
+#endif
+ } else {
+ vconf_set_str(vconf_key_.c_str(), value.c_str());
+ }
+}
+
+void VconfHandle::Set(const int value, const bool is_rtc) {
+ if (is_rtc) {
+#if defined(OS_TIZEN_TV_PRODUCT)
+ vconf_set_int_rtc(vconf_key_.c_str(), value);
+#else
+ LOG(ERROR) << "RunTimeCreated vconf is not supported";
+#endif
+ } else {
+ vconf_set_int(vconf_key_.c_str(), value);
+ }
+}
+
+void VconfHandle::Set(const bool value, const bool is_rtc) {
+ if (is_rtc) {
+#if defined(OS_TIZEN_TV_PRODUCT)
+ vconf_set_bool_rtc(vconf_key_.c_str(), value);
+#else
+ LOG(ERROR) << "RunTimeCreated vconf is not supported";
+#endif
+ } else {
+ vconf_set_bool(vconf_key_.c_str(), value);
+ }
+}
--- /dev/null
+// Copyright 2019 Samsung Electronics. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMMON_VCONF_HANDLE_H_
+#define COMMON_VCONF_HANDLE_H_
+
+#include <string>
+#include <vconf/vconf.h>
+
+#include "third_party/abseil-cpp/absl/types/optional.h"
+
+class VconfHandle {
+ public:
+ VconfHandle(const std::string vconf_key);
+
+ std::string Str();
+ int Int();
+ absl::optional<bool> Bool();
+ void Set(const char* value, const bool is_rtc = false);
+ void Set(const std::string value, const bool is_rtc = false);
+ void Set(const int value, const bool is_rtc = false);
+ void Set(const bool value, const bool is_rtc = false);
+
+ private:
+ std::string vconf_key_;
+};
+
+#endif // COMMON_VCONF_HANDLE_H_
#include <mutex>
#include <thread>
-#include <aul_proc_group.h>
#include <dlfcn.h>
#include <sys/resource.h>
#include <tzplatform_config.h>
#include "wrt/xwalk_extensions/browser/xwalk_extension_manager.h"
#include "tizen_src/chromium_impl/ui/gl/gl_shared_context_efl.h"
+#if TIZEN_VERSION_AT_LEAST(7, 0, 0)
+#include <aul_proc_group.h>
+#endif
+
#ifndef LIB_PATH
#error LIB_PATH is not set.
#endif
// static
void WRTMainDelegateTV::GroupZygoteProcess(bool is_oom) {
-#if defined(ENABLE_PROCESS_GROUP)
+#if TIZEN_VERSION_AT_LEAST(7, 0, 0)
// Group zygote process with browser process so that OOM score
// can be synchronized.
auto oom_score_adj_path = base::FilePath("/proc/self/oom_score_adj");
#include "content/renderer/render_process_impl.h"
#include "electron/shell/common/gin_converters/content_converter.h"
#include "gin/object_template_builder.h"
-#if !defined(WRT_JS_BRINGUP)
#include "tizen_src/chromium_impl/tizen/vconf_handle.h"
+#if !defined(WRT_JS_BRINGUP)
#include "tizen_src/ewk/efl_integration/devtools_port_manager.h"
#endif
#include "v8/include/v8.h"
std::string TVExtension::QueryProductValue(const std::string& query) const {
if (query == "getDuid") {
-#if !defined(WRT_JS_BRINGUP)
return VconfHandle("db/comss/duid").Str();
-#endif
} else if (query == "getFirmware") {
return GetSystemInfoString(SYSTEM_INFO_KEY_SW_VERSION);
} else if (query == "getLocalSet") {
} else if (query == "getModel") {
return GetSystemInfoString(SYSTEM_INFO_KEY_MODEL);
} else if (query == "getModelCode") {
-#if !defined(WRT_JS_BRINGUP)
return VconfHandle("db/comss/modelid").Str();
-#endif
} else if (query == "getRealModel") {
return GetSystemInfoString(SYSTEM_INFO_KEY_PRODUCT_CODE_BOM);
} else if (query == "getSmartTVServerVersion") {
-#if !defined(WRT_JS_BRINGUP)
return VconfHandle("db/comss/infolinkversion").Str();
-#endif
} else if (query == "getSmartTVServerType") {
int server_type = -1;
system_info_get_value_int(SYSTEM_INFO_KEY_INFO_LINK_SERVER_TYPE,
}
void TVExtension::NotifyInstall(const std::string& install_info) const {
-#if !defined(WRT_JS_BRINGUP)
VconfHandle(kVconfNotifyInstallKey).Set(install_info);
-#endif
}
std::string TVExtension::GetMetadata(const std::string& key) const {
}
std::string TVExtension::GetForegroundApp() const {
-#if !defined(WRT_JS_BRINGUP)
return VconfHandle(kVconfCurrentAppId).Str();
-#endif
}
std::string TVExtension::GetSSOGuid() const {
#include "base/logging.h"
#include "gin/object_template_builder.h"
-#if !defined(WRT_JS_BRINGUP)
#include "tizen_src/chromium_impl/tizen/vconf_handle.h"
-#endif
#include "v8/include/v8.h"
#if defined(OS_TIZEN_TV_PRODUCT)
}
std::string MDEExtension::GetCurrentLoginId() const {
-#if defined(WRT_JS_BRINGUP)
- return std::string();
-#else
return VconfHandle(kVconfCurrentLoginId).Str();
-#endif
}
std::string MDEExtension::GetDeviceName() const {
-#if defined(WRT_JS_BRINGUP)
- return std::string();
-#else
return VconfHandle(kVconfDeviceName).Str();
-#endif
}
std::string MDEExtension::GetDeviceUUID() const {
-#if defined(WRT_JS_BRINGUP)
- return std::string();
-#else
return VconfHandle(kVconfDeviceUUID).Str();
-#endif
}
#endif
#include "wrt/src/base/string_utils.h"
#if defined(OS_TIZEN_TV_PRODUCT)
-#if !defined(WRT_JS_BRINGUP)
#include "tizen_src/chromium_impl/tizen/vconf_handle.h"
-#endif
#include "wrt/src/common/application_data.h"
#endif
auto& app_data = ApplicationData::GetInstance();
std::string vconfValue = "AppID:" + app_data.app_id() + ", URL is blocked.";
LOG(ERROR) << "key: rtc/memory/WebApp/LaunchFail value: " << vconfValue;
-#if !defined(WRT_JS_BRINGUP)
VconfHandle("rtc/memory/WebApp/LaunchFail").Set(vconfValue, true);
-#endif
return true;
#endif
return (app_control_send_launch_request(app_control_, nullptr, nullptr) ==
#include "base/files/file_util.h"
#include "base/logging.h"
-#if !defined(WRT_JS_BRINGUP)
#include "tizen_src/chromium_impl/tizen/vconf_handle.h"
-#endif
#include "wrt/src/base/file_utils.h"
#include "wrt/src/common/application_data.h"
#include "wrt/src/common/constants.h"
std::string vconfValue =
"AppID:" + app_id_ + ", appdrm loadlicense is faild";
LOG(ERROR) << "vconf : " << kLaunchFail << " value : " << vconfValue;
-#if !defined(WRT_JS_BRINGUP)
VconfHandle(kLaunchFail).Set(vconfValue, true);
-#endif
return false;
}
LOG(INFO) << "appdrm_load_license() end";
std::string vconfValue = "AppID: " + app_id_ + ", error no: "
+ std::to_string(ret) + ", decrypt is faild";
LOG(ERROR) << "vconf : " << kLaunchFail << " value : " << vconfValue;
-#if !defined(WRT_JS_BRINGUP)
VconfHandle(kLaunchFail).Set(vconfValue, true);
-#endif
}
return DataBuffer();
} else if (length <= 0) {
#include "tizen_src/chromium_impl/content/common/paths_efl.h"
#if !defined(WRT_JS_BRINGUP)
#include "tizen_src/chromium_impl/content/public/browser/certificates_utils.h"
-#include "tizen_src/chromium_impl/tizen/vconf_handle.h"
#endif
+#include "tizen_src/chromium_impl/tizen/vconf_handle.h"
#include "tizen_src/ewk/efl_integration/common/application_type.h"
#if !defined(WRT_JS_BRINGUP)
#include "tizen_src/ewk/efl_integration/ewk_privilege_checker.h"
}
bool ShouldRunClearDeadMount() {
-#if !defined(WRT_JS_BRINGUP)
auto wrtloader_count = VconfHandle(kWrtLoaderCount).Int();
LOG(INFO) << "vconf loader_count is " << wrtloader_count;
if (wrtloader_count < NEED_CHECK_DEADMOUNT) {
return false;
}
VconfHandle(kWrtLoaderCount).Set(0, true);
-#endif
return true;
}
}
void NativeWebRuntimeDelegateTV::PreloadVconfKeys() {
-#if !defined(WRT_JS_BRINGUP)
LOG(INFO) << "PreloadVconfKeys start";
const char* kVconfAccessibilityTts = "db/setting/accessibility/tts";
const char* kVconfHomeAppId = "db/appfw/overlay_home_appid";
VconfHandle(kVconfLowMemory).Int();
VconfHandle(kVconfProxy).Str();
LOG(INFO) << "PreloadVconfKeys end";
-#endif
}
void NativeWebRuntimeDelegateTV::PreloadFMS() {
#include <ui/efl_util.h>
#include "base/logging.h"
-#if !defined(WRT_JS_BRINGUP)
#include "tizen_src/chromium_impl/tizen/vconf_handle.h"
-#endif
#include "wrt/src/common/application_data.h"
namespace wrt {
LOG(ERROR) << "Invalid UG state";
return "UnknownError";
}
-#if !defined(WRT_JS_BRINGUP)
VconfHandle(key).Set(1);
-#endif
return "Success";
}
LOG(ERROR) << "Invalid UG state";
return "UnknownError";
}
-#if !defined(WRT_JS_BRINGUP)
VconfHandle(key).Set(0);
-#endif
return "Success";
}
#include "wrt/src/browser/tv/widget_state.h"
#include "base/logging.h"
-#if !defined(WRT_JS_BRINGUP)
#include "tizen_src/chromium_impl/tizen/vconf_handle.h"
-#endif
#include "wrt/src/browser/native_web_runtime.h"
#include "wrt/src/browser/tv/ambient_mode.h"
widget_status = status;
std::string vconfkey = kPrefixVconfKeyWidgetStatus + widget_app_id;
LOG(ERROR) << "[WidgetStatus] key :" << vconfkey << ", value :" << status;
-#if !defined(WRT_JS_BRINGUP)
VconfHandle(vconfkey).Set(status, true);
VconfHandle(kVconfKeyStatusChange).Set(widget_app_id);
-#endif
NativeWebRuntime::GetInstance().NotifyStatusChanged(status);
}
url.erase(found);
}
-#if !defined(WRT_JS_BRINGUP)
std::string vkey = kPrefixVconfKeyWidgetStatus + widget_app_id + "_URL";
LOG(INFO) << "vconf key before :" << widget_url;
LOG(INFO) << "vconf key after :" << vkey << ", value :" << url;
VconfHandle(vkey).Set(url, true);
-#endif
widget_url = url;
}
#include "gpu/config/gpu_switches.h"
#include "media/base/media_switches.h"
#include "third_party/blink/public/common/page/page_zoom.h"
-#if !defined(WRT_JS_BRINGUP)
#include "tizen_src/chromium_impl/tizen/vconf_handle.h"
-#endif
#include "ui/platform_window/platform_window.h"
#include "wrt/src/base/platform_info.h"
#include "wrt/src/browser/native_web_runtime.h"
}
bool CanSupportLandscapeScale() {
-#if defined(WRT_JS_BRINGUP)
- return false;
-#else
auto is_signage = IsSignageProduct();
if (!is_signage)
return false;
auto is_landscape_scale =
"landscape_scale" == meta_data_info.GetValue(kScreenOrientation);
return is_signage && is_landscape_scale && (rotate_status == 1);
-#endif
}
} // namespace
ecore_evas_aux_hint_add(
GetPlatformCanvas(), "wm.policy.win.transform.mode", "ratiofit");
-#if !defined(WRT_JS_BRINGUP)
auto multi_screen_showed = VconfHandle(kMultiScreenInfoVconfKey).Str();
if (IsMultiScreenShowed(multi_screen_showed)) {
int width = 1920, height = 1080;
GetScreenResolution(width, height);
SetScreenResolution(width * 0.3165, height);
}
-#endif
vconf_notify_key_changed(kMultiScreenInfoVconfKey,
MultiviewStateChangedCb, this);
}
auto* browser_context = WRTBrowserContext::GetInstance();
DCHECK(browser_context);
std::string proxy_info;
-#if !defined(WRT_JS_BRINGUP)
auto& meta_data_info = ApplicationData::GetInstance().meta_data_info();
if (meta_data_info.GetValue(kUseWebappProxy) == "true") {
LOG(INFO) << "use.webapp.proxy is true";
} else {
proxy_info = VconfHandle(kProxyVconfKey).Str();
}
-#endif
if (proxy_info.empty() || proxy_info.find("://") == std::string::npos) {
LOG(INFO) << "proxy address : " << proxy_info;
return;
void WRTNativeWindowTV::EnableVisibilitySetting() {
std::string app_id = ApplicationData::GetInstance().app_id();
-#if !defined(WRT_JS_BRINGUP)
VconfHandle(kMostRecentApp).Set(app_id);
if (channel_changeable_)
: false;
VconfHandle("memory/VDWebApp/partial").Set(opt);
LOG(INFO) << "memory/VDWebApp/partial set as " << opt;
-#endif
if (!alphaset_) {
activateScreenSaver(const_cast<char*>("DEFAULT"),
}
void WRTNativeWindowTV::DisableVisibilitySetting() {
-#if !defined(WRT_JS_BRINGUP)
std::string app_id = ApplicationData::GetInstance().app_id();
std::string most_recent_app = VconfHandle(kMostRecentApp).Str();
"{'app_id': '%s'}", app_id.c_str());
LOG(INFO) << "Set apps_recent_changed as " << json_str;
VconfHandle("memory/eden/apps/apps_recent_changed").Set(json_str);
-#endif
}
void WRTNativeWindowTV::VisibilityChangedAsBackground() {