Modify poweroff signal handling 81/194981/1 accepted/tizen/unified/20181210.152249 submit/tizen/20181210.053027
authorsinikang <sinikang@samsung.com>
Mon, 10 Dec 2018 04:47:09 +0000 (13:47 +0900)
committersinikang <sinikang@samsung.com>
Mon, 10 Dec 2018 04:47:09 +0000 (13:47 +0900)
 -Poweroff wait process should be executed onlyon mobile and wearable profile.
  In case of dongle type target i.e. TV,
  dongle modem can be poweroff with udev_remove event.

Change-Id: I322c31511e97ab40b776b072380db5205cb222d9

CMakeLists.txt
packaging/tel-plugin-manager.spec
src/manager_modem.c

index 4c35807f12a87ab728917f797d339c16794ae7f6..e92a8c83077b02718579bb4305562d52acb679aa 100644 (file)
@@ -20,6 +20,7 @@ pkg_check_modules(pkgs REQUIRED
        vconf
        openssl
        tfeature
+       capi-system-info
 )
 
 FOREACH(flag ${pkgs_CFLAGS})
index 6e88039626e2ec4727c86059457eaf56009d1307..37818063e95f66fb13900f9d1649eea660d4f030 100644 (file)
@@ -1,6 +1,6 @@
 %define major 0
 %define minor 1
-%define patchlevel 14
+%define patchlevel 15
 
 Name:           tel-plugin-manager
 Version:        %{major}.%{minor}.%{patchlevel}
@@ -20,6 +20,7 @@ BuildRequires:  pkgconfig(openssl)
 BuildRequires:  pkgconfig(tfeature)
 BuildRequires:  pkgconfig(cynara-client)
 BuildRequires:  pkgconfig(cynara-session)
+BuildRequires:  pkgconfig(capi-system-info)
 
 Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
index 9c42cfe6bb173b911d7a0fc8693512e726a70bbc..37c5e6568f521f907a51b14ea684a4d9e5dd6500 100644 (file)
@@ -39,6 +39,7 @@
 #include "tfeature.h"
 
 #include <vconf.h>
+#include <system_info.h>
 
 /*
  * Timeout of 1 second for normal cases, we may have to consider 4 sec for Verizon.
@@ -286,6 +287,9 @@ static void __manager_modem_poweroff_signal_handler(GDBusConnection *connection,
 
 static void __manager_modem_poweroff_subscribe_signal(ModemPrivateInfo *modem_info)
 {
+       int ret;
+       char *profile = NULL;
+
        dbg("enter");
 
        if (G_UNLIKELY(!modem_info)) {
@@ -293,6 +297,21 @@ static void __manager_modem_poweroff_subscribe_signal(ModemPrivateInfo *modem_in
                return;
        }
 
+       /*      Poweroff signal support should be executed only mobile and wearable profile.
+               In case of TV or IoT profile etc... (dongle modem support case),
+               dongle modem can be power off with udev_remove event.  */
+       ret = system_info_get_platform_string("tizen.org/feature/profile", &profile);
+       if (ret != SYSTEM_INFO_ERROR_NONE) {
+               err("system_info_get_platform_string() failed!!! (%d,%s)", ret, get_error_message(ret));
+               return;
+       }
+
+       dbg("profile: %s", profile);
+       if (g_strcmp0(profile, "mobile") && g_strcmp0(profile, "wearable")) {
+               dbg("No need to subscribe poweroff signal handling to deviced");
+               return;
+       }
+
        if (!modem_info->sys_power.conn) {
                GError *error = NULL;