From 6dfe2d78f5a624637d6801cbe0feb6560654aadf Mon Sep 17 00:00:00 2001
From: pwasowski2 <38784511+pwasowski2@users.noreply.github.com>
Date: Tue, 11 May 2021 03:50:55 +0200
Subject: [PATCH] [HapticFeedback] Implement vibrate() (#75)
* [HapticFeedback] Implement vibrate()
[Before] HapticFeedback.vibrate() was not implemented
[After] The code below will cause a short vibration:
HapticFeedback.vibrate()
Signed-off-by: Pawel Wasowski
* Make HapticFeedback.vibrate's dependencies dependent on profile
HapticFeedback.vibrate will only work on mobile and wearable profiles so
its dependencies should only be included in builds for these devices.
Signed-off-by: Pawel Wasowski
* Make FeedbackManager a singleton
* [HapticFeedback.vibrate] Minfor fixes
- use the proper "MOBILE_PROFILE" and "WEARABLE_PROFILE" names instead of
"MOBILE" and "WEARABLE"
- reorder lines in BUILD.gn
Signed-off-by: Pawel Wasowski
* Refactor implementation of HapticFeedback.vibrate() and BUILD.gn
Signed-off-by: Pawel Wasowski
* [HapticFeedback] Refactor FeedbackManager
Signed-off-by: Pawel Wasowski
* [HapticFeedback] Use FT_LOGE for all error logs
---
shell/platform/tizen/BUILD.gn | 18 ++
.../tizen/channels/platform_channel.cc | 175 +++++++++++++++++-
2 files changed, 192 insertions(+), 1 deletion(-)
diff --git a/shell/platform/tizen/BUILD.gn b/shell/platform/tizen/BUILD.gn
index d0321482c6751..ae49587d59f18 100644
--- a/shell/platform/tizen/BUILD.gn
+++ b/shell/platform/tizen/BUILD.gn
@@ -52,8 +52,10 @@ config("tizen_rootstrap_include_dirs") {
"$custom_sysroot/usr/include/emile-1",
"$custom_sysroot/usr/include/eo-1",
"$custom_sysroot/usr/include/evas-1",
+ "$custom_sysroot/usr/include/feedback",
"$custom_sysroot/usr/include/system",
"$custom_sysroot/usr/include/wayland-extension",
+
# For Evas_GL.
"$custom_sysroot/usr/include/ecore-con-1",
"$custom_sysroot/usr/include/ecore-file-1",
@@ -77,6 +79,8 @@ config("tizen_rootstrap_include_dirs") {
template("embedder_for_profile") {
forward_variables_from(invoker, [ "use_evas_gl_renderer" ])
+ profile = target_name
+
if (!defined(use_evas_gl_renderer)) {
use_evas_gl_renderer = false
}
@@ -121,6 +125,20 @@ template("embedder_for_profile") {
"wayland-client",
]
+ if (profile == "mobile") {
+ libs += [
+ "capi-base-common",
+ "feedback",
+ ]
+ }
+
+ if (profile == "wearable") {
+ libs += [
+ "capi-base-common",
+ "feedback",
+ ]
+ }
+
defines = invoker.defines
if (use_evas_gl_renderer) {
diff --git a/shell/platform/tizen/channels/platform_channel.cc b/shell/platform/tizen/channels/platform_channel.cc
index ccc330d6a09f9..172bd4a942610 100644
--- a/shell/platform/tizen/channels/platform_channel.cc
+++ b/shell/platform/tizen/channels/platform_channel.cc
@@ -5,6 +5,7 @@
#include "platform_channel.h"
#include
+#include
#include