aurum: Fix root permission not require in host 39/264839/6 submit/tizen/20211007.062212
authorWoochanlee <wc0917.lee@samsung.com>
Fri, 1 Oct 2021 02:13:27 +0000 (11:13 +0900)
committerWoochanlee <wc0917.lee@samsung.com>
Thu, 7 Oct 2021 06:19:26 +0000 (15:19 +0900)
1. bootrap service app add in system
2. touch force enable by vconf API
3. Use sync API to avoid winfo command in host

Change-Id: I72afd5f48677d5be7c4cc3114a8231c0d3950a67

libaurum/src/Impl/TizenDeviceImpl.cc
org.tizen.aurum-bootstrap/meson.build
org.tizen.aurum-bootstrap/src/BootstrapServer.cc
packaging/aurum.spec
protocol/resources/python/mobile/mobileSetup.py
protocol/resources/python/tv/tvSetup.py

index 96846e1705e54ef093705c76e4f33d7b4e90971c..d966fc07c480470bc7b69a27706036f50fc687d3 100644 (file)
@@ -23,9 +23,9 @@ TizenDeviceImpl::TizenDeviceImpl()
 {
     LOGI("device implementation init");
     TizenDeviceImpl *obj = static_cast<TizenDeviceImpl *>(this);
-    obj->mFakeTouchHandle = efl_util_input_initialize_generator(EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN);
+    obj->mFakeTouchHandle = efl_util_input_initialize_generator_with_sync(EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN, NULL);
     obj->mFakeKeyboardHandle =
-       efl_util_input_initialize_generator(EFL_UTIL_INPUT_DEVTYPE_KEYBOARD);
+       efl_util_input_initialize_generator_with_sync(EFL_UTIL_INPUT_DEVTYPE_KEYBOARD, NULL);
 
     int width = 0;
     int height = 0;
index 8bb2b35cf2bf6c922d33c15fea5a8cb0900299cb..e27c68a29d39c3199d917ab5f91825b14a87548a 100644 (file)
@@ -56,6 +56,7 @@ bootstrap_svr_dep += [
    dependency('capi-appfw-service-application'),
    dependency('capi-system-system-settings'),
    dependency('capi-base-utils-i18n'),
+   dependency('vconf'),
 ]
 endif
 
index 0ae861e967cf8e2ee1eb87ad30657da945a8934a..28b144a55ceda6f7857d8405d60fb855155b49dd 100644 (file)
@@ -1,13 +1,13 @@
 #include <iostream>
-#include <glib.h>
-#include "bootstrap.h"
-
 #include <service_app.h>
-
 #include <gio/gio.h>
 #include <grpcpp/grpcpp.h>
 #include <aurum.grpc.pb.h>
+#include <glib.h>
+#include <vconf.h>
+#include <system_info.h>
 
+#include "bootstrap.h"
 #include "AurumServiceImpl.h"
 #include "config.h"
 
@@ -15,14 +15,43 @@ using namespace grpc;
 
 typedef struct _ServiceContext {
     std::unique_ptr<Server> server;
+    bool forceTouchEnabled;
 } ServiceContext;
 
+static void _vconf_force_enable_touch_set(void *data, bool enable)
+{
+    ServiceContext *ctx = (ServiceContext *)data;
+    int ret;
+
+    if (ctx->forceTouchEnabled == enable) return;
+
+    ret = vconf_set_bool("memory/window_system/input/force_enable_touch", enable);
+    if (ret != VCONF_OK) {
+        LOGE("Fail to set touch enable via vconf");
+        return;
+    }
+
+    ctx->forceTouchEnabled = enable;
+}
+
 static bool _service_app_create(void *data)
 {
     ServiceContext *ctx = (ServiceContext *)data;
     std::string binding("0.0.0.0:50051");
     aurumServiceImpl service;
     ServerBuilder builder;
+    char *value;
+    int ret;
+
+    ctx->forceTouchEnabled = false;
+    ret = system_info_get_platform_string("http://tizen.org/feature/profile", &value);
+    if (ret != SYSTEM_INFO_ERROR_NONE) LOGE("Fail to get system profile infomation");
+    else {
+        if (!strncmp("tv", value, 2))
+            _vconf_force_enable_touch_set(ctx, true);
+
+        free(value);
+    }
 
     LOGI("[T] Server Listening on %s", binding.c_str());
     builder.AddListeningPort(binding, grpc::InsecureServerCredentials());
@@ -36,6 +65,9 @@ static bool _service_app_create(void *data)
 static void _service_app_terminate(void *data)
 {
     ServiceContext *ctx = (ServiceContext *)data;
+
+    if (ctx->forceTouchEnabled)
+        _vconf_force_enable_touch_set(ctx, false);
     ctx->server->Shutdown();
 }
 
index 181fddb32a4f1e2273369fbc5f48274beb0b1d1b..73a6a954bf00892a37e33968d38bac35ed22a2a1 100644 (file)
@@ -29,6 +29,7 @@ BuildRequires: pkgconfig(capi-system-device)
 BuildRequires: pkgconfig(libtzplatform-config)
 BuildRequires: pkgconfig(capi-system-system-settings)
 BuildRequires: pkgconfig(capi-base-utils-i18n)
+BuildRequires: pkgconfig(vconf)
 
 %if 0%{?gendoc:1}
 BuildRequires:  doxygen
@@ -38,18 +39,10 @@ BuildRequires:  doxygen
 BuildRequires:  lcov
 %endif
 
-%if "%{?profile}" == "tv"
-  %define __hash_signing 0
-%else
-  %define __hash_signing 1
-%endif
-
-%if 0%{?__hash_signing}
 BuildRequires:  hash-signer
 %if 0%{?sec_product_feature_profile_wearable}
 Requires(post): signing-client
 %endif
-%endif
 
 %description
 aurum is a project for testing ui.
@@ -152,13 +145,11 @@ ninja \
 
 %install
 
-%if 0%{?__hash_signing}
 %define tizen_sign 1
 %define tizen_sign_base /usr/apps/org.tizen.aurum-bootstrap
 %define tizen_sign_level platform
 %define tizen_author_sign 1
 %define tizen_dist_sign 1
-%endif
 
 export DESTDIR=%{buildroot}
 ninja -C gbsbuild install
index ca22373697fa2689fc8ea88c26755ed1e0176d2d..8df3cbe1bea4fa840100f45fbb31a117cca4911b 100644 (file)
@@ -9,7 +9,6 @@ def run_command(command):
     output = stream.read()
 
 # Start scrip here
-run_command("sdb root on")
 run_command("sdb forward tcp:50051 tcp:50051")
 run_command("sdb shell app_launcher -s org.tizen.aurum-bootstrap")
 # Wait 1 sec till bootstrap launched
index a888f4894518e2c873990c084d00d73d028652c6..8df3cbe1bea4fa840100f45fbb31a117cca4911b 100644 (file)
@@ -9,13 +9,6 @@ def run_command(command):
     output = stream.read()
 
 # Start scrip here
-run_command("sdb root on")
-# To run bootstrap as command
-run_command("sdb shell tpk-backend -y org.tizen.aurum-bootstrap --preload")
-# TV need to enable touch
-run_command("sdb shell vconftool set -f -t bool memory/window_system/input/force_enable_touch 1")
-# Dut to input generator issue, temporarily do below command
-run_command("sdb shell winfo -init_device --type=touch")
 run_command("sdb forward tcp:50051 tcp:50051")
 run_command("sdb shell app_launcher -s org.tizen.aurum-bootstrap")
 # Wait 1 sec till bootstrap launched