Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added condition check for calling Telephony platformQuery API

 :Release Notes:
 Check added for Telephony platformQuery API in Activity Manager

 :Detailed Notes:

 :Testing Performed:
 Compiled locally and tested in device

 :QA Notes:

 :Issues Addressed:
 [GF-36693] Fix activitymanager calls to LS2

 Open-webOS-DCO-1.0-Signed-off-by: Yasaswini A Y <yasaswini.ay@lge.com>

Change-Id: I7a9711ea0caadf9a82610c176e288342116b6e61
Reviewed-on: https://g2g.palm.com/3423
Reviewed-by: Build Verification
Tested-by: Yasaswini AY <yasaswini.ay@lge.com>
Reviewed-by: Shrinivas Kulkarni <shrinivas.kulkarni@lge.com>
Reviewed-by: Roger Stringer <roger.stringer@lge.com>
  • Loading branch information...
commit a5e812091ef19b2c8d6a0b29d5bcd47def9665d4 1 parent d528753
@YasaswiniAY YasaswiniAY authored RS102839 committed
Showing with 45 additions and 4 deletions.
  1. +5 −0 CMakeLists.txt
  2. +40 −4 src/ServiceApp.cpp
View
5 CMakeLists.txt
@@ -48,6 +48,10 @@ pkg_check_modules(PMLOG REQUIRED PmLogLib)
include_directories(${PMLOG_INCLUDE_DIRS})
webos_add_compiler_flags(ALL ${PMLOG_CFLAGS_OTHER})
+#-- check for NYX
+pkg_check_modules(NYXLIB REQUIRED nyx)
+include_directories(${NYXLIB_INCLUDE_DIRS})
+webos_add_compiler_flags(ALL ${NYXLIB_CFLAGS_OTHER})
# There is a call to system("initctl ...") in ServiceApp.cpp which is compiled in for
# all implementations except WEBOS_TARGET_MACHINE_IMPL_SIMULATOR
webos_machine_impl_dep()
@@ -71,6 +75,7 @@ target_link_libraries(activitymanager
${OPENSSL_LDFLAGS}
${LS2_LDFLAGS}
${PMLOG_LDFLAGS}
+ ${NYXLIB_LDFLAGS}
)
webos_build_daemon()
View
44 src/ServiceApp.cpp
@@ -35,6 +35,8 @@
#include "ResourceManager.h"
#include "ControlGroupManager.h"
#include "LunaBusProxy.h"
+#include <nyx/nyx_client.h>
+#include <glib.h>
#ifdef ACTIVITYMANAGER_DEVELOPER_METHODS
#include "DevelCategory.h"
@@ -117,7 +119,38 @@ ActivityManagerApp::ActivityManagerApp()
ActivityManagerApp::~ActivityManagerApp()
{
}
-
+static bool read_modem_present()
+{
+ // read the modem present using Nyx
+ nyx_error_t error = NYX_ERROR_GENERIC;
+ nyx_device_handle_t device = NULL;
+ const char *modem_present;
+ bool ismodem_present=true;
+
+ error = nyx_init();
+ if (NYX_ERROR_NONE == error)
+ {
+ error = nyx_device_open(NYX_DEVICE_DEVICE_INFO, "Main", &device);
+
+ if (NYX_ERROR_NONE == error & NULL != device)
+ {
+ error = nyx_device_info_query(device, NYX_DEVICE_INFO_MODEM_PRESENT, &modem_present);
+
+ if (NYX_ERROR_NONE == error)
+ {
+ if(g_strcmp0(modem_present,"N")==0)
+ {
+ ismodem_present=false;
+ }
+
+ }
+
+ nyx_device_close(device);
+ }
+ nyx_deinit();
+ }
+ return ismodem_present;
+}
MojErr ActivityManagerApp::open()
{
MojLogTrace(s_log);
@@ -180,9 +213,12 @@ MojErr ActivityManagerApp::open()
boost::make_shared<SystemManagerProxy>(&m_client, m_am);
m_requirementManager->AddManager(smp);
- boost::shared_ptr<TelephonyProxy> tp =
- boost::make_shared<TelephonyProxy>(&m_client);
- m_requirementManager->AddManager(tp);
+ if(read_modem_present())
+ {
+ boost::shared_ptr<TelephonyProxy> tp =
+ boost::make_shared<TelephonyProxy>(&m_client);
+ m_requirementManager->AddManager(tp);
+ }
#endif
} catch (...) {
return MojErrNoMem;
Please sign in to comment.
Something went wrong with that request. Please try again.