From c5e32296bcc6d8f8f6f05c9810c4013a209fe970 Mon Sep 17 00:00:00 2001 From: JooHark Park Date: Mon, 22 Apr 2013 22:43:15 +0900 Subject: [PATCH] [Internal: merge private->RSA , Patch create momanager.db] ===================================== [Problem] - [Cause] - [Solution] - merge private->RSA - Patch create momanager.db ===================================== Change-Id: I1259c9a75ad8e4dec1ea0bd6225e17b2b7458720 --- AUTHORS | 2 +- debian/changelog | 15 + gbs_build.sh | 17 - include/common/dm_common_def.h | 8 +- include/common/util/util.h | 3 +- include/mo-handler/dm_mo_common_internal.h | 1 + oma-dm-agent.manifest | 12 +- oma-dm-cfg/ddf/slp/slp_lawmo_pcw_ddf.xml | 1601 ++++++++++---------- oma-dm-cfg/delta_size/max_size.txt | 2 +- oma-dm-cfg/fw-init/omadm_fw_config.xml | 4 +- oma-dm-cfg/ipc/noticonfig_omadm | 3 +- packaging/oma-dm-agent.spec | 30 +- src/agent/common/dm-status/oma_dm_status_db.c | 2 +- .../common/dm-status/oma_dm_status_db_handler.c | 8 + src/agent/common/dm_common.c | 9 +- src/agent/common/util/util.c | 31 +- src/agent/dm-engine/bootstrap/factory_bootstrap.c | 2 + src/agent/dm-engine/dm_common_engine.c | 184 ++- src/agent/dm-engine/fumo/fumo_account.c | 6 +- src/agent/dm-engine/fumo/fumo_engine.c | 25 +- .../dm_platform_event_handler.c | 19 + src/agent/framework/task/oma_dm_task_spec.c | 3 +- src/agent/framework/ui-event-handler/ipc_agent.c | 86 +- .../dm-phase-handler/dm_phase_handler.c | 53 +- .../slp-device-dm/src/plugin_slp_device_ctrl.c | 154 +- .../slp-device-dm/src/plugin_slp_device_info.c | 14 +- 26 files changed, 1379 insertions(+), 915 deletions(-) delete mode 100755 gbs_build.sh mode change 100644 => 100755 oma-dm-cfg/delta_size/max_size.txt mode change 100644 => 100755 src/agent/common/dm-status/oma_dm_status_db.c mode change 100644 => 100755 src/agent/common/util/util.c mode change 100644 => 100755 src/agent/dm-engine/fumo/fumo_account.c diff --git a/AUTHORS b/AUTHORS index b5328d5..df26a95 100755 --- a/AUTHORS +++ b/AUTHORS @@ -1,4 +1,4 @@ WooJin Yun JooHark Park -SangHyuk Ko +SangHyuk Ko JunHyung Park diff --git a/debian/changelog b/debian/changelog index 55a3dee..1241dcc 100755 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,18 @@ +ioma-dm-agent (0.1.67) unstable; urgency=low + + * [SR:oma-dm-agent_0.1.67] SR Release + * oma-dm-agent luanch logic changed + * FOTA production IOT 015 017 patch. + * FOTA user cancel 401 report patch + * DB path changed(/opt/dbspace -> /opt/usr/dbspace/) + * Message forwarding feature added + * Mobile tracking patch + * FOTA UA success 200 , fail 410 reporting + * Git: framework/system/oma-dm-agent + * Tag: oma-dm-agent_0.1.67 + + -- Junhyung Park Thu, 18 Apr 2013 19:30:00 +0900 + oma-dm-agent (0.1.66) unstable; urgency=low * [SR:oma-dm-agent_0.1.66] SR Release diff --git a/gbs_build.sh b/gbs_build.sh deleted file mode 100755 index 516e1ea..0000000 --- a/gbs_build.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -#sdb -d shell rm /root/app/*.rpm - -rm -rf /home/juhaki/gbs-build-pkg/*.rpm - -gbs -d -v build -A armv7l --include-all - -cp -rf /home/juhaki/GBS-ROOT/local/scratch.armv7l.0/.build.packages/RPMS/armv7l/*.rpm /home/juhaki/gbs-build-pkg/ - -#sdb -d push /home/juhaki/gbs-build-pkg /root/app/ - -#sdb -d shell change-booting-mode.sh --update - -#sdb -d shell rpm -Uvh --force --nodeps /root/*.rpm - - diff --git a/include/common/dm_common_def.h b/include/common/dm_common_def.h index a7fd4fa..6e0bd86 100755 --- a/include/common/dm_common_def.h +++ b/include/common/dm_common_def.h @@ -58,10 +58,10 @@ /* #define OMA_DM_FUMO_APPID "xxxxxxxxxx" -#define OMA_DM_FUMO_APPSECRETID "rLIrPQYjzNOgkSU6gQME+b2J8Ro=" +#define OMA_DM_FUMO_APPSECRETID "xxxxxxxxxxxxxxxxxxxxxxxxxxxx" -#define OMA_DM_LAWMO_APPID "ed7b8510eb22050e" -#define OMA_DM_LAWMO_APPSECRETID "OHlxuLBrlM25AQlN6ZN05GFowk8=" +#define OMA_DM_LAWMO_APPID "xxxxxxxxxxxxxxxx" +#define OMA_DM_LAWMO_APPSECRETID "xxxxxxxxxxxxxxxxxxxxxxxxxxxx" */ /* @@ -111,7 +111,7 @@ #define LAWMO_TRACKING_START_ALARM "lawmo_tracking_start_alarm" #define IPC_DS "/tmp/agent_fw_event_omads" -#define FOTA_DELTA_INTERNAL_STORAGE "/opt/data/fota" +#define FOTA_DELTA_INTERNAL_STORAGE "/opt/usr/data/fota" #define FOTA_DELTA_SD_INTERNAL_STORAGE "/opt/media" #define FOTA_DELTA_SD_EXTERNAL_STORAGE "/opt/storage/sdcard" diff --git a/include/common/util/util.h b/include/common/util/util.h index ad341f5..a4596eb 100755 --- a/include/common/util/util.h +++ b/include/common/util/util.h @@ -131,6 +131,7 @@ int launch_oma_dm_fumo_ui(); * @param[in] noti type ( user interaction, imformative, background ) * @param[in] session id * @param[in] server id + * @param[in] triger type ( push , polling ) * * @return 1 success * 0 error @@ -147,7 +148,7 @@ int launch_oma_dm_fumo_ui(); * @code * @endcode */ -int launch_om_dm_fumo_noti_ui(int noti_data, char *session_id, char *server_id); +int launch_om_dm_fumo_noti_ui(int noti_data, char *session_id, char *server_id, int triger_type); /** * @par Description: API to launch oma dm alert ui diff --git a/include/mo-handler/dm_mo_common_internal.h b/include/mo-handler/dm_mo_common_internal.h index 2492ad1..5a757a9 100755 --- a/include/mo-handler/dm_mo_common_internal.h +++ b/include/mo-handler/dm_mo_common_internal.h @@ -39,6 +39,7 @@ #define DM_DMACC_MSCTESTSERVER "./DMAcc/MSCTestserver" #define DM_DMACC_GCF "./DMAcc/gcf" +#define DM_FUMO_STATE "./FUMO/State" #define DM_FUMO_DOWNLOAD_OP "/Download" #define DM_FUMO_UPDATE_OP "/Update" #define DM_FUMO_DOWNLOADAND_UPDATE_OP "/DownloadAndUpdate" diff --git a/oma-dm-agent.manifest b/oma-dm-agent.manifest index 8902f0e..18b6165 100755 --- a/oma-dm-agent.manifest +++ b/oma-dm-agent.manifest @@ -30,12 +30,12 @@ - - - - - - + + + + + + diff --git a/oma-dm-cfg/ddf/slp/slp_lawmo_pcw_ddf.xml b/oma-dm-cfg/ddf/slp/slp_lawmo_pcw_ddf.xml index 3d6f7ac..156c69d 100755 --- a/oma-dm-cfg/ddf/slp/slp_lawmo_pcw_ddf.xml +++ b/oma-dm-cfg/ddf/slp/slp_lawmo_pcw_ddf.xml @@ -42,668 +42,172 @@ null - - LAWMO + + MobileTraking + + + + + + + + + + + MobileTraking Node(Placeholder) + + null + + + + GPS + - - + + - - + + + + + + GPS Informations + + null + + + + isValid + + + + + + + + - + - LWAMO Service(Placeholder) - - null + Availability of GPS Information + + text/plain - + + + + latitude + + + + + + + + + + + + GPS Value(Latitude) + + text/plain + + + + + longitude + + + + + + + + + + + + GPS Value(Longitude) + + text/plain + + + + + horizontalUncertainty + + + + + + + + + + + + GPS Value(HorizontalUncertainty) + + text/plain + + + + + verticalUncertainty + + + + + + + + + + + + GPS Value(VerticalUncertainty) + + text/plain + + + + + Date + + + + + + + + + + + + GPS Value(Date) + + text/plain + + + + - OSP - - + NonGPS + + - - + + - - - - - OSP Server(Placeholder) - - null - - - - Ext - - - - - - - - - - - - Extend Node(Placeholder) - - null - - - - AMT - - - - - - - - - - - - AMT Check Node(Placeholder) - - null - - - - Status - - - - - - - - - - - Current AMT Status Information - - text/plain - - - - - - LockMyPhone - - - - - - - - - - - - LockMyPhone Servie Node(Placeholder) - - null - - - - Messages - - - - - - - - - - - - LockMyPhone When Message Display - - text/plain - - - - - - CallRestriction - - - - - - - - - - - CallRestriction Node(Placeholder) - - null - - - - PhoneNumber - - - - - - - - - - - - LockMyPhone When Message Display - - text/plain - - - - - - Password - - - - - - - - - - - - UnLock The Device - - text/plain - - - - - RingMyPhone - - - - - - - - - - - RingMyPhone Service Node(Placeholder) - - null - - - - Operations - - - - - - - - - - - Operations Node(Placeholder) - - null - - - - Start - - - - - - - - - - - RingMyPhone Service Start - - urn:oma:at:lawmo:1.0:OperationComplete - - - - - Stop - - - - - - - - - - - RingMyPhone Service Stop - - urn:oma:at:lawmo:1.0:OperationComplete - - - - - - Status - - - - - - - - - - - Current RingMyPhone Status Information - - text/plain - - - - - - - AvailableWipeList - - - - - - - - - - - AvailableWipeList Node(Placeholder) - - null - - - - External - - - - - - - - - - - External Memory Node(Placeholder) - - null - - - - ToBeWiped - - - - - - - - - - - - External Memory Wipe Execution Value - - text/plain - - - - - - SIM - - - - - - - - - - - SIM Memory Node(Placeholder) - - null - - - - ToBeWiped - - - - - - - - - - - - SIM Memory Wipe Execution Value - - text/plain - - - - - - - State - - - - - - - - - - - Lawmo State - - text/plain - - - - - Operations - - - - - - - - - - - Operations Node(Placeholder) - - null - - - - Wipe - - - - - - - - - - - Execution External Memory Data Wipe - - urn:oma:at:lawmo:1.0:OperationComplete - - - - - FullyLock - - - - - - - - - - - Fullylock Device - - urn:oma:at:lawmo:1.0:OperationComplete - - - - - PartiallyLock - - - - - - - - - - - PartiallyLock Device - - urn:oma:at:lawmo:1.0:OperationComplete - - - - - UnLock - - - - - - - - - - - UnLock Device - - urn:oma:at:lawmo:1.0:OperationComplete - - - - - FactoryReset - - - - - - - - - - - FactoryReset Device - - urn:oma:at:lawmo:1.0:OperationComplete - - - - - - - - MobileTraking - - - - - - - - - - - - MobileTraking Node(Placeholder) - - null - - - - GPS - - - - - - - - - - - - GPS Informations - - null - - - - isValid - - - - - - - - - - - - Availability of GPS Information - - text/plain - - - - - latitude - - - - - - - - - - - - GPS Value(Latitude) - - text/plain - - - - - longitude - - - - - - - - - - - - GPS Value(Longitude) - - text/plain - - - - - horizontalUncertainty - - - - - - - - - - - - GPS Value(HorizontalUncertainty) - - text/plain - - - - - verticalUncertainty - - - - - - - - - - - - GPS Value(VerticalUncertainty) - - text/plain - - - - - Date - - - - - - - - - - - - GPS Value(Date) - - text/plain - - - - - - NonGPS - - - - - - - - - - - - NonGPS Informations - + + + + + NonGPS Informations + null @@ -803,7 +307,7 @@ - + Operation @@ -856,138 +360,524 @@ - - Stop + + + + + LAWMO + + + + + + + + + + + + LWAMO Service(Placeholder) + + null + + + + OSP - + + + + + + + + + + OSP Server(Placeholder) + + null + + + + Ext + + + + + + + + + + + + Extend Node(Placeholder) + + null + + + + AMT + + + + + + + + + + + + AMT Check Node(Placeholder) + + null + + + + Status + + + + + + + + + + + Current AMT Status Information + + text/plain + + + + + + LockMyPhone + + + + + + + + + + + + LockMyPhone Servie Node(Placeholder) + + null + + + + Messages + + + + + + + + + + + + LockMyPhone When Message Display + + text/plain + + + + + + CallRestriction + + + + + + + + + + + CallRestriction Node(Placeholder) + + null + + + + PhoneNumber + + + + + + + + + + + + LockMyPhone When Message Display + + text/plain + + + + + + Password + + + + + + + + + + + + UnLock The Device + + text/plain + + + + + RingMyPhone + + + + + + + + + + + RingMyPhone Service Node(Placeholder) + + null + + + + Operations + + + + + + + + + + + Operations Node(Placeholder) + + null + + + + Start + + + + + + + + + + + RingMyPhone Service Start + + urn:oma:at:lawmo:1.0:OperationComplete + + + + + Stop + + + + + + + + + + + RingMyPhone Service Stop + + urn:oma:at:lawmo:1.0:OperationComplete + + + + + + Status + + + + + + + + + + + Current RingMyPhone Status Information + + text/plain + + + + + Messages + + + + + + + + + + + + Current RingMyPhone Message Information + + text/plain + + + + + + + AvailableWipeList + + + - + - Stop Get My Location Service + AvailableWipeList Node(Placeholder) - urn:oma:at:lawmo:1.0:OperationComplete + null - - - Tracking + + External + + + + + + + + + + + External Memory Node(Placeholder) + + null + + + + ToBeWiped + + + + + + + + + + + + External Memory Wipe Execution Value + + text/plain + + + + + + SIM + + + + + + + + + + + SIM Memory Node(Placeholder) + + null + + + + ToBeWiped + + + + + + + + + + + + SIM Memory Wipe Execution Value + + text/plain + + + + + + + State - - - - - - - - - - Tracking Get My Location Service - - urn:oma:at:lawmo:1.0:OperationComplete - - - - - - Status - - - - - - - - - - - Status of MobileTraking Service - - text/plain - - - - - Policy - - - - - - - - - - - - Policy Node(Placeholder) - - null - - - - StartDate - - - - - - - - - - - - Tracking Value(Start Date) - - text/plain - - - - - EndDate - - - - - - - - - - - - Tracking Value(End Date) - - text/plain - - - - - Interval - - - - - - - - - - - - Tracking Value(Interval Time) - - text/plain - - - + + + + + + + + + + Lawmo State + + text/plain + + + + + Operations + + + + + + + + + + + Operations Node(Placeholder) + + null + + + + Wipe + + + + + + + + + + + Execution External Memory Data Wipe + + urn:oma:at:lawmo:1.0:OperationComplete + + + + + FullyLock + + + + + + + + + + + Fullylock Device + + urn:oma:at:lawmo:1.0:OperationComplete + + + + + PartiallyLock + + + + + + + + + + + PartiallyLock Device + + urn:oma:at:lawmo:1.0:OperationComplete + + + + + UnLock + + + + + + + + + + + UnLock Device + + urn:oma:at:lawmo:1.0:OperationComplete + + + + + FactoryReset + + + + + + + + + + + FactoryReset Device + + urn:oma:at:lawmo:1.0:OperationComplete + + + + - + Forwarding @@ -1383,7 +1273,174 @@ - + + MobileTracking + + + + + + + + + + + + MobileTraking Node(Placeholder) + + null + + + + + Operations + + + + + + + + + + + Operaion Node(Placeholder) + + null + + + + Stop + + + + + + + + + + + Stop Get My Location Service + + urn:oma:at:lawmo:1.0:OperationComplete + + + + + Tracking + + + + + + + + + + + Tracking Get My Location Service + + urn:oma:at:lawmo:1.0:OperationComplete + + + + + + Status + + + + + + + + + + + Status of MobileTraking Service + + text/plain + + + + + Policy + + + + + + + + + + + + Policy Node(Placeholder) + + null + + + + StartDate + + + + + + + + + + + + Tracking Value(Start Date) + + text/plain + + + + + EndDate + + + + + + + + + + + + Tracking Value(End Date) + + text/plain + + + + + Interval + + + + + + + + + + + + Tracking Value(Interval Time) + + text/plain + + + + + diff --git a/oma-dm-cfg/delta_size/max_size.txt b/oma-dm-cfg/delta_size/max_size.txt old mode 100644 new mode 100755 index 354b252..f29ac39 --- a/oma-dm-cfg/delta_size/max_size.txt +++ b/oma-dm-cfg/delta_size/max_size.txt @@ -1 +1 @@ -500000 +52428800 diff --git a/oma-dm-cfg/fw-init/omadm_fw_config.xml b/oma-dm-cfg/fw-init/omadm_fw_config.xml index 4cfaeee..cfbe8bc 100755 --- a/oma-dm-cfg/fw-init/omadm_fw_config.xml +++ b/oma-dm-cfg/fw-init/omadm_fw_config.xml @@ -23,7 +23,7 @@ 5 - /opt/dbspace/.omadmagent.db + /opt/usr/dbspace/.omadmagent.db 1 @@ -132,7 +132,7 @@ - /opt/dbspace/.momanager.db + /opt/usr/dbspace/.momanager.db 2 diff --git a/oma-dm-cfg/ipc/noticonfig_omadm b/oma-dm-cfg/ipc/noticonfig_omadm index 6c8ed95..deee3a0 100755 --- a/oma-dm-cfg/ipc/noticonfig_omadm +++ b/oma-dm-cfg/ipc/noticonfig_omadm @@ -11,5 +11,6 @@ 11, 0, 3, 30, NOTI_ALERT_CONFIRMATION 12, 0, 3, 30, NOTI_ALERT_INPUTEXT 13, 0, 3, 30, NOTI_ALERT_SINGLE_CHOICE -14, 0, 3, 30, NOTI_ALERT_MULTIPLE_CHOICE15, 0, 0, 30, NOTI_POLL_INTERACTION +14, 0, 3, 30, NOTI_ALERT_MULTIPLE_CHOICE +15, 0, 0, 30, NOTI_POLL_INTERACTION 16, 0, 0, 30, NOTI_UPDATE_RESULT diff --git a/packaging/oma-dm-agent.spec b/packaging/oma-dm-agent.spec index b1c078c..35c9d30 100755 --- a/packaging/oma-dm-agent.spec +++ b/packaging/oma-dm-agent.spec @@ -1,6 +1,6 @@ Name: oma-dm-agent Summary: oma-dm-agent daemon for FOTA,DM,CP,FMM Service -Version: 0.1.66 +Version: 0.1.67 Release: 1 Group: TO_BE/FILLED_IN License: Apache License, Version 2.0 @@ -67,14 +67,14 @@ make %{?jobs:-j%jobs} %install rm -rf %{buildroot} -if [ ! -d %{buildroot}/opt/dbspace ] +if [ ! -d %{buildroot}/opt/usr/dbspace ] then - mkdir -p %{buildroot}/opt/dbspace + mkdir -p %{buildroot}/opt/usr/dbspace fi -sqlite3 %{buildroot}/opt/dbspace/.dm_service.db "PRAGMA journal_mode = PERSIST; create table a(a); drop table a;" > /dev/null -sqlite3 %{buildroot}/opt/dbspace/.omadmagent.db "PRAGMA journal_mode = PERSIST; create table a(a); drop table a;" > /dev/null -sqlite3 %{buildroot}/opt/dbspace/.momanager.db "PRAGMA journal_mode = PERSIST; create table a(a); drop table a;" > /dev/null +sqlite3 %{buildroot}/opt/usr/dbspace/.dm_service.db "PRAGMA journal_mode = PERSIST; create table a(a); drop table a;" > /dev/null +sqlite3 %{buildroot}/opt/usr/dbspace/.omadmagent.db "PRAGMA journal_mode = PERSIST; create table a(a); drop table a;" > /dev/null +sqlite3 %{buildroot}/opt/usr/dbspace/.momanager.db "PRAGMA journal_mode = PERSIST; create table a(a); drop table a;" > /dev/null %make_install @@ -117,20 +117,20 @@ rm -f /tmp/agent_fw_noti_reply_omadm* rm -f /etc/rc.d/rc3.d/S91oma-dm-agent rm -f /etc/rc.d/rc5.d/S91oma-dm-agent -rm -f /opt/dbspace/.dm_service.db /opt/dbspace/.dm_service.db-journal -rm -f /opt/dbspace/.omadmagent.db /opt/dbspace/.omadmagent.db-journal -rm -f /opt/dbspace/.momanager.db /opt/dbspace/.momanager.db-journal +rm -f /opt/usr/dbspace/.dm_service.db /opt/usr/dbspace/.dm_service.db-journal +rm -f /opt/usr/dbspace/.omadmagent.db /opt/usr/dbspace/.omadmagent.db-journal +rm -f /opt/usr/dbspace/.momanager.db /opt/usr/dbspace/.momanager.db-journal rm -rf /usr/share/oma-dm-cfg %files -%attr(600,root,root) /opt/dbspace/.dm_service.db -%attr(600,root,root) /opt/dbspace/.dm_service.db-journal -%attr(600,root,root) /opt/dbspace/.omadmagent.db -%attr(600,root,root) /opt/dbspace/.omadmagent.db-journal -%attr(600,root,root) /opt/dbspace/.momanager.db -%attr(600,root,root) /opt/dbspace/.momanager.db-journal +%attr(600,root,root) /opt/usr/dbspace/.dm_service.db +%attr(600,root,root) /opt/usr/dbspace/.dm_service.db-journal +%attr(600,root,root) /opt/usr/dbspace/.omadmagent.db +%attr(600,root,root) /opt/usr/dbspace/.omadmagent.db-journal +%attr(600,root,root) /opt/usr/dbspace/.momanager.db +%attr(600,root,root) /opt/usr/dbspace/.momanager.db-journal %manifest oma-dm-agent.manifest %defattr(-,root,root,-) diff --git a/src/agent/common/dm-status/oma_dm_status_db.c b/src/agent/common/dm-status/oma_dm_status_db.c old mode 100644 new mode 100755 index d63f22f..c50db1b --- a/src/agent/common/dm-status/oma_dm_status_db.c +++ b/src/agent/common/dm-status/oma_dm_status_db.c @@ -77,7 +77,7 @@ DM_ERROR dm_open_agent(DB_HANDLER ** db_handler) char *errMsg = 0; if (*db_handler == NULL) { - ret = sqlite3_open("/opt/dbspace/.dm_service.db", db_handler); + ret = sqlite3_open("/opt/usr/dbspace/.dm_service.db", db_handler); if (ret != SQLITE_OK) goto FINISH; diff --git a/src/agent/common/dm-status/oma_dm_status_db_handler.c b/src/agent/common/dm-status/oma_dm_status_db_handler.c index 5c6ef4b..0878a0d 100755 --- a/src/agent/common/dm-status/oma_dm_status_db_handler.c +++ b/src/agent/common/dm-status/oma_dm_status_db_handler.c @@ -328,6 +328,12 @@ DM_ERROR Update_Engine_Status_Column(int engine_id, ENGINE_STATUS_VALUE engine_s _EXTERN_FUNC_EXIT; return DM_ERR_UNKNOWN; } + + _DEBUG_INFO("engine_status_value[%d]",engine_status_value); + if( engine_status_value == VALUE_RESULT_STATUS) { + _DEBUG_INFO("value [%d]", *(int*)value); + } + _EXTERN_FUNC_EXIT; return dm_update_engine_status_column(db_handler, engine_id, engine_status_value, value); } @@ -416,9 +422,11 @@ DM_ERROR _add_agent_handler(unsigned int key, DB_HANDLER * pHandler) __print_agentDBHashTableLog(); #endif pthread_mutex_unlock(pDBHandlerMgr->db_handlerTable_mutex); +/* pKey_copy will be free from _remove_agent_handler function. if(pKey_copy != NULL) { free(pKey_copy); } +*/ _INNER_FUNC_EXIT; return ret; diff --git a/src/agent/common/dm_common.c b/src/agent/common/dm_common.c index c073202..e16175d 100755 --- a/src/agent/common/dm_common.c +++ b/src/agent/common/dm_common.c @@ -117,7 +117,7 @@ DM_ERROR init_dm() _DEBUG_INFO("success register wap push : %d ", ret); } - +/* ret = register_fumo_ip_push(); if (ret == -1) { _DEBUG_INFO("fail register fumo ip push : %d ", ret); @@ -133,14 +133,15 @@ DM_ERROR init_dm() // _DEBUG_INFO("success register fota account : %d ", ret); //} } - +*/ +/* ret = register_lawmo_samsung_account(); if (ret == -1) { _DEBUG_INFO("fail register fmm server : %d ", ret); } else { _DEBUG_INFO("success register fmm server : %d ", ret); } - +*/ ret = register_telephony(); if (ret == -1) { _DEBUG_INFO("fail register telephony : %d ", ret); @@ -1294,6 +1295,8 @@ DM_ERROR compare_memory_space(char *memory_type, long double file_size) return DM_OVER_MEMORY_ERROR; } + //_DEBUG_INFO("below return value is test code"); // for memory not enough - testing + //return DM_OVER_MEMORY_ERROR; // for memory not enough - testing _EXTERN_FUNC_EXIT; return DM_OK; diff --git a/src/agent/common/util/util.c b/src/agent/common/util/util.c old mode 100644 new mode 100755 index 0623576..c62f435 --- a/src/agent/common/util/util.c +++ b/src/agent/common/util/util.c @@ -116,43 +116,53 @@ int launch_oma_dm_fumo_ui() return 1; } -int launch_om_dm_fumo_noti_ui(int noti_data, char *session_id, char *server_id) +int launch_om_dm_fumo_noti_ui(int noti_data, char *session_id, char *server_id, int triger_type) { _EXTERN_FUNC_ENTER; int result = 0; - _DEBUG_INFO("\n---------------------------------------------------: %d\n", result); - _DEBUG_INFO("\n is launch oma noti dm ui ? : %d\n", result); - result = aul_app_is_running(OMA_DM_FUMO_NOTI_UI_PKG); - _DEBUG_INFO("\n Is launch oma noti dm ui , result : %d\n", result); - _DEBUG_INFO("\n---------------------------------------------------: %d\n", result); + _DEBUG_INFO("---------------------------------------------------: %d", result); + //_DEBUG_INFO(" is launch oma noti dm ui ? : %d", result); + //result = aul_app_is_running(OMA_DM_FUMO_NOTI_UI_PKG); + _DEBUG_INFO(" Is launch oma noti dm ui , result : %d", result); + _DEBUG_INFO("---------------------------------------------------: %d", result); + _DEBUG_INFO(" triger_type [%d]", triger_type); if (result == 0) { char *noti_type = NULL; noti_type = g_strdup_printf("%d", noti_data); + char *str_triger_type = NULL; + str_triger_type = g_strdup_printf("%d", triger_type); bundle *pBundle = NULL; pBundle = bundle_create(); if (pBundle == NULL) { _DEBUG_INFO("bundle_create fail\n"); + str_free(¬i_type); + str_free(&str_triger_type); _EXTERN_FUNC_EXIT; return 0; } result = bundle_add(pBundle, "FOTA_NOTI", noti_type); - result = bundle_add(pBundle, "FOTA_SESSIONID", session_id); - result = bundle_add(pBundle, "FOTA_SERVERID", server_id); - if (session_id == NULL) { /*if engine stoped by battery off or other exceptions */ result = bundle_add(pBundle, "FOTA_SESSIONID", "1111"); + } else { + result = bundle_add(pBundle, "FOTA_SESSIONID", session_id); } if (server_id == NULL) { result = bundle_add(pBundle, "FOTA_SERVERID", "1111"); + } else { + result = bundle_add(pBundle, "FOTA_SERVERID", server_id); } + result = bundle_add(pBundle, "FOTA_TRIGERTYPE", str_triger_type); + if (result == -1) { _DEBUG_INFO("bundle_add fail\n"); bundle_free(pBundle); + str_free(¬i_type); + str_free(&str_triger_type); _EXTERN_FUNC_EXIT; return 0; } @@ -162,11 +172,14 @@ int launch_om_dm_fumo_noti_ui(int noti_data, char *session_id, char *server_id) if (result == -1) { bundle_free(pBundle); + str_free(¬i_type); + str_free(&str_triger_type); _EXTERN_FUNC_EXIT; return 0; } str_free(¬i_type); + str_free(&str_triger_type); bundle_free(pBundle); sleep(2); } else { diff --git a/src/agent/dm-engine/bootstrap/factory_bootstrap.c b/src/agent/dm-engine/bootstrap/factory_bootstrap.c index 7633b6d..daec555 100755 --- a/src/agent/dm-engine/bootstrap/factory_bootstrap.c +++ b/src/agent/dm-engine/bootstrap/factory_bootstrap.c @@ -103,6 +103,8 @@ DM_ERROR factory_bootstrap(SERVICE_SERVER_TYPE server_type) char *required_contents = NULL; int is_exist = 0; + _DEBUG_INFO("server_type : [%d]", server_type); + switch (server_type) { case SAMSUNG_FUMO_TYPE: { diff --git a/src/agent/dm-engine/dm_common_engine.c b/src/agent/dm-engine/dm_common_engine.c index 3bd711a..dc87eeb 100755 --- a/src/agent/dm-engine/dm_common_engine.c +++ b/src/agent/dm-engine/dm_common_engine.c @@ -145,7 +145,72 @@ void init_Dm_Engine() reset_devinfo(); reset_devdetail(); + + _EXTERN_FUNC_EXIT; +} + +DM_ERROR engine_replace_start(char *server_id, char *full_path, ENGINE_ID * service_engine_id, int *resultCode, Item * item) +{ + _EXTERN_FUNC_ENTER; + + DM_ERROR ret = DM_OK; + + if (server_id == NULL || full_path == NULL) { + //(*resultCode) = CLIENT_ERROR; + ret = COMMON_ERR_IS_NULL; + goto error; + } + + sync_agent_dm_mo_error_e err_code = SYNC_AGENT_DM_MO_SUCCESS; + sync_agent_dm_mo_type_e mo_type; + char *value = NULL; + + err_code = sync_agent_get_mo_type(full_path, &mo_type); + _DEBUG_INFO("get mo type result : %d", err_code); + + (*resultCode) = DM_OK; + + _DEBUG_INFO(" ------------------------------------------------------------------------------------------------------------------------------------- "); + _DEBUG_INFO(" mo_type : %d , server id : %s , full_path : %s ", mo_type, server_id, full_path ); + _DEBUG_INFO(" ------------------------------------------------------------------------------------------------------------------------------------- "); + + switch (mo_type) { + case SYNC_AGENT_DM_MO_TYPE_FUMO: + _DEBUG_INFO("---------------------------------------------------------------- fumo engine ready for replace cmd --------------------------------------------------------------------- "); + if (item->private.data != NULL) { + value = item->private.data; + _DEBUG_INFO("replace value : %s", value); + ret = fumo_replace(full_path, value, (FUMO_Error *)resultCode); + if(ret !=DM_OK) { + (*resultCode) = DM_ERR_COMMAND_NOT_ALLOWED; + goto error; + } + } + break; + case SYNC_AGENT_DM_MO_TYPE_LAWMO: + _DEBUG_INFO("---------------------------------------------------------------- lawmo engine ready for replace cmd --------------------------------------------------------------------- "); + ret = DM_OK; //lawmo_replace(full_path, value, (LAWMO_Result_code *) resultCode, CHECK_OPERATION); + if(ret !=DM_OK) + goto error; + break; + default: + //(*resultCode) = CLIENT_ERROR; + _DEBUG_INFO(" not existed engine for replace cmd \n"); + break; + } + + + + _DEBUG_INFO("====================result code : %d====================\n", *resultCode); + _DEBUG_INFO(" end!! resut code : %d\n", *resultCode); _EXTERN_FUNC_EXIT; + return ret; + error: + + _DEBUG_INFO("====================result code : %d====================\n", *resultCode); + _DEBUG_INFO(" error end %d result code : %d", ret, *resultCode); + _EXTERN_FUNC_EXIT; + return ret; } DM_ERROR engine_start(char *server_id, char *full_path, char *correlator, ENGINE_ID * service_engine_id, int *resultCode) @@ -291,16 +356,21 @@ DM_ERROR service_engine_start(ENGINE_ID service_engine_id, DM_ERROR * service_re _DEBUG_INFO("correlator : %s", correlator); } - _DEBUG_INFO("service status : %d", service_status->engine_status); + _DEBUG_INFO("service engine_status : %d", service_status->engine_status); + _DEBUG_INFO("service result_status : %d", service_status->result_status); switch (service_engine_id) { case FUMO_SERVICE_ENGINE: _DEBUG_INFO(" service_status->download_click [%d] ", service_status->download_click); - _DEBUG_INFO(" fumo exec"); - ret = fumo_exec(full_path, correlator, (FUMO_Error *) (&engine_return)); + if( (service_status->result_status == FUMO_USER_CANCELLED) || (service_status->result_status == FUMO_DOWNLOAD_FAILS_DUE_TO_DEVICE_OUT_OF_MEMORY) ) { + _DEBUG_INFO("fota result user_cancelled or not_enough_space report -- fumo exec is not execution"); + } else { + _DEBUG_INFO(" fumo exec"); + ret = fumo_exec(full_path, correlator, (FUMO_Error *) (&engine_return)); + } _DEBUG_INFO("fumo ret : %d", ret); *service_ret = ret; - if (ret != DM_OK && ret != DM_ERR_USER_CANDELLED && ret != DM_ERR_REMINDER_INTERVAL /*|| ret != DM_ERR_DEVICE_ABORTED */ ) + if (ret != DM_OK && ret != DM_ERR_USER_CANDELLED && ret != DM_ERR_REMINDER_INTERVAL && ret != DM_OVER_MEMORY_ERROR /*|| ret != DM_ERR_DEVICE_ABORTED */ ) goto error; break; case LAWMO_SERVICE_ENGINE: @@ -335,28 +405,37 @@ DM_ERROR service_engine_start(ENGINE_ID service_engine_id, DM_ERROR * service_re /*engine status generic alert status */ service_engine_status = DM_GENERICALERT_ING; ret = Update_Engine_Status_Column(service_engine_id, VALUE_ENGINE_STATUS, &service_engine_status); - _DEBUG_INFO("service engine status generic alert"); - - - ret = Update_Engine_Status_Column(service_engine_id, VALUE_RESULT_STATUS, &engine_return); - _DEBUG_INFO("service engine status generic alert status : %d", engine_return); + _DEBUG_INFO("ret [%d] : service engine status generic alert", ret); + + if( (service_status->result_status == FUMO_USER_CANCELLED) || (service_status->result_status == FUMO_DOWNLOAD_FAILS_DUE_TO_DEVICE_OUT_OF_MEMORY) ) { + _DEBUG_INFO("-- fota result user_cancelled or not_enough_space report -- "); + } else { + ret = Update_Engine_Status_Column(service_engine_id, VALUE_RESULT_STATUS, &engine_return); + _DEBUG_INFO("ret [%d] : service engine status generic alert status : %d", ret, engine_return); + if(engine_return == FUMO_DOWNLOAD_FAILS_DUE_TO_DEVICE_OUT_OF_MEMORY) { + _DEBUG_INFO("service_status->result_status [%d] will be updated to engine_return[%d]", service_status->result_status, engine_return); + service_status->result_status = engine_return; + } + } /* adding alert for fota result start : _generate_generic_alert*/ - if( (after_service_status->download_click == RESUME_STATUS_INSTALL) && (service_engine_id == FUMO_SERVICE_ENGINE) ) { + if( (after_service_status->download_click == RESUME_STATUS_INSTALL) && (service_engine_id == FUMO_SERVICE_ENGINE) ) { + // fota UA success or failed. _DEBUG_INFO("fota result report"); int isFinish = 0; void *session = NULL; - //int common_status = DM_IDLE; - //ret = genericalert_operation(engine_return, server_id, service_engine_id); ret = genericalert_operation(&session, &isFinish, service_engine_id); - _DEBUG_INFO("isFinish [%d]", isFinish); + _DEBUG_INFO("ret [%d] , isFinish [%d]", ret, isFinish); + + set_engine_status_idle(FUMO_SERVICE_ENGINE); + Delete_Engine_Status(FUMO_SERVICE_ENGINE); + _DEBUG_INFO("Delete fumo service engine"); + ret = set_current_fumo_state(DM_FUMO_STATE, IDLE_START); + _DEBUG_INFO("set_current_fumo_state ret [%d] ", ret); + if(ret != DM_OK) { goto error; } - set_engine_status_idle(service_engine_id); - - Delete_Engine_Status(service_engine_id); - _DEBUG_INFO("Delete fumo service engine"); //_DEBUG_INFO("isFinish [%d]", isFinish); //if(!isFinish) { @@ -370,8 +449,53 @@ DM_ERROR service_engine_start(ENGINE_ID service_engine_id, DM_ERROR * service_re _DEBUG_INFO("management_phase is DM_OK"); } } + } else { + if( ( (service_status->result_status == FUMO_USER_CANCELLED) || (service_status->result_status == FUMO_DOWNLOAD_FAILS_DUE_TO_DEVICE_OUT_OF_MEMORY) ) + && (service_engine_id == FUMO_SERVICE_ENGINE) ) { + _DEBUG_INFO("fota result user_cancelled or not_enough_space report"); + int isFinish = 0; + void *session = NULL; + ret = genericalert_operation(&session, &isFinish, service_engine_id); + _DEBUG_INFO("ret [%d] , isFinish [%d]", ret, isFinish); + + set_engine_status_idle(FUMO_SERVICE_ENGINE); + Delete_Engine_Status(FUMO_SERVICE_ENGINE); + _DEBUG_INFO("Delete fumo service engine"); + ret = set_current_fumo_state(DM_FUMO_STATE, IDLE_START); + _DEBUG_INFO("set_current_fumo_state ret [%d] ", ret); + + if(ret != DM_OK) { + goto error; + } + } } /* adding alert for fota result end */ + }else { + // download completed -> later -> user canceled. + if( (service_status->result_status == FUMO_USER_CANCELLED) || (service_status->result_status == FUMO_DOWNLOAD_FAILS_DUE_TO_DEVICE_OUT_OF_MEMORY) ) { + _DEBUG_INFO("fota result user_cancelled or not_enough_space report"); + int isFinish = 0; + void *session = NULL; + + service_engine_status = DM_GENERICALERT_ING; + ret = Update_Engine_Status_Column(service_engine_id, VALUE_ENGINE_STATUS, &service_engine_status); + _DEBUG_INFO("ret [%d] : service engine status generic alert", ret); + + ret = genericalert_operation(&session, &isFinish, service_engine_id); + _DEBUG_INFO("ret [%d] , isFinish [%d]", ret, isFinish); + + set_engine_status_idle(FUMO_SERVICE_ENGINE); + Delete_Engine_Status(FUMO_SERVICE_ENGINE); + _DEBUG_INFO("Delete fumo service engine"); + ret = set_current_fumo_state(DM_FUMO_STATE, IDLE_START); + _DEBUG_INFO("set_current_fumo_state ret [%d] ", ret); + + if(ret != DM_OK) { + goto error; + } + + } + } str_free(&full_path); @@ -386,6 +510,25 @@ DM_ERROR service_engine_start(ENGINE_ID service_engine_id, DM_ERROR * service_re } } else { + + if( (service_status->result_status == FUMO_USER_CANCELLED) || (service_status->result_status == FUMO_DOWNLOAD_FAILS_DUE_TO_DEVICE_OUT_OF_MEMORY) ) { + _DEBUG_INFO("fota result user_cancelled report"); + int isFinish = 0; + void *session = NULL; + ret = genericalert_operation(&session, &isFinish, service_engine_id); + _DEBUG_INFO("ret [%d] , isFinish [%d]", ret, isFinish); + + set_engine_status_idle(service_engine_id); + Delete_Engine_Status(service_engine_id); + _DEBUG_INFO("Delete fumo service engine"); + ret = set_current_fumo_state(DM_FUMO_STATE, IDLE_START); + _DEBUG_INFO("set_current_fumo_state ret [%d] ", ret); + + if(ret != DM_OK) { + goto error; + } + } + if (service_status != NULL) { Free_Memory_Engine_Status(&service_status, 1); } @@ -498,7 +641,7 @@ DM_ERROR dm_common_operation(Event_Contents * pEvent_data) ENGINE_ID service_engine_id = NO_SERVICE_ENGINE; char *session_id = NULL; char *server_id = NULL; - int session_type; + int session_type = UI_EVENT; ret = get_server_info(pEvent_data, &server_id, &session_id, &session_type); if (ret != DM_OK) { @@ -510,6 +653,7 @@ DM_ERROR dm_common_operation(Event_Contents * pEvent_data) } else { _DEBUG_INFO("session_id is NULL"); } + _DEBUG_INFO("session_type [%d]", session_type); get_service_engine_id(&service_engine_id, pEvent_data->ui_mode); @@ -635,9 +779,11 @@ DM_ERROR genericalert_operation(void **session, int *isFinish, ENGINE_ID service _DEBUG_INFO(" update engine status : %d \n", ret); str_free(&pServer_id); + }else { + _DEBUG_INFO("non generic alert"); } } else { - _DEBUG_INFO("non generic alert"); + _DEBUG_INFO("IsExist_Engine_id(%d) value is not 1", service_engine_id); } if (status != NULL) { diff --git a/src/agent/dm-engine/fumo/fumo_account.c b/src/agent/dm-engine/fumo/fumo_account.c old mode 100644 new mode 100755 index c18bf24..9201fb9 --- a/src/agent/dm-engine/fumo/fumo_account.c +++ b/src/agent/dm-engine/fumo/fumo_account.c @@ -58,11 +58,11 @@ int register_fota_account() break; } count++; - } while (err == SYNC_AGENT_DM_MO_FAIL && count < 3); + } while (err == SYNC_AGENT_DM_MO_FAIL && count < 2); if (err == SYNC_AGENT_DM_MO_FAIL) { - ret = set_account_registration_alarm(FUMO_ACCOUNT_ALARM, FUMO_ACCOUNT_ALARM_TYPE); - _DEBUG_INFO("add fota account registration alarm : %d ", ret); + //ret = set_account_registration_alarm(FUMO_ACCOUNT_ALARM, FUMO_ACCOUNT_ALARM_TYPE); + //_DEBUG_INFO("add fota account registration alarm : %d ", ret); ret = 0; } else { ret = set_config_int(FUMO_ACCOUNT_FLAG_TYPE, FUMO_ACCOUNT_FLAG, 1, FUMO_ENGINE, 0); diff --git a/src/agent/dm-engine/fumo/fumo_engine.c b/src/agent/dm-engine/fumo/fumo_engine.c index 1efbcee..a0b6986 100755 --- a/src/agent/dm-engine/fumo/fumo_engine.c +++ b/src/agent/dm-engine/fumo/fumo_engine.c @@ -569,14 +569,18 @@ static DM_ERROR _firmware_download(char *server_url, MEMORY_TYPE * memory_type, ret = __check_memory(file_size, memory_type); //ret = DM_OVER_MEMORY_ERROR; // for memory not enough - UI testing if (ret != DM_OK) { + /* noti_res = noti_memory_full((int)file_size); if (noti_res == RESPONSE_TYPE_OK) { _DEBUG_TRACE("memory full popup success"); } else { _DEBUG_TRACE("memory full popup fail"); } + */ + _DEBUG_INFO("memory full failed"); download_status = DM_ERR_INSUFFICIENT_MEMORY; - *fumo_return = FUMO_USER_CANCELLED; + //*fumo_return = FUMO_USER_CANCELLED; + *fumo_return = FUMO_DOWNLOAD_FAILS_DUE_TO_DEVICE_OUT_OF_MEMORY; //ret = DM_OK; goto error; } @@ -1289,13 +1293,15 @@ static DM_ERROR __check_memory(long double file_size, MEMORY_TYPE * is_internal_ if (ret != DM_OK) { ret = existed_sd_card_memory(&existed_sd); + _DEBUG_INFO("ret [%d], existed_sd [%d]", ret, existed_sd); if (existed_sd == 0 || ret != DM_OK) { /* ui ->not existed sd card or make folder error */ - ipc_ret = noti_over_max_file_size((int)file_size); + //ipc_ret = noti_over_max_file_size((int)file_size); + ipc_ret = noti_memory_full((int)file_size); if (ipc_ret == RESPONSE_TYPE_OK) { - _DEBUG_VERBOSE("file size over the memory"); + _DEBUG_INFO("file size over the memory"); } else { - _DEBUG_VERBOSE("file size over the memory ipc fail"); + _DEBUG_INFO("file size over the memory ipc fail"); } _INNER_FUNC_EXIT; return DM_OVER_MEMORY_ERROR; @@ -1309,20 +1315,21 @@ static DM_ERROR __check_memory(long double file_size, MEMORY_TYPE * is_internal_ ret = compare_memory_space(FOTA_DELTA_SD_EXTERNAL_STORAGE, need_size); if (ret == DM_MEMORY_ERROR) { /* ui -> sd_card full */ - ipc_ret = noti_over_max_file_size((int)file_size); + //ipc_ret = noti_over_max_file_size((int)file_size); + ipc_ret = noti_memory_full((int)file_size); if (ipc_ret == RESPONSE_TYPE_OK) { - _DEBUG_VERBOSE("file size over the memory"); + _DEBUG_INFO("file size over the memory"); } else { - _DEBUG_VERBOSE("file size over the memory ipc fail"); + _DEBUG_INFO("file size over the memory ipc fail"); } _INNER_FUNC_EXIT; return DM_OVER_MEMORY_ERROR; } else { - _DEBUG_VERBOSE("save in sd memory card"); + _DEBUG_INFO("save in sd memory card"); } } else { - _DEBUG_VERBOSE("memory full ipc fail"); + _DEBUG_INFO("memory full ipc fail"); _INNER_FUNC_EXIT; return DM_OVER_MEMORY_ERROR; } diff --git a/src/agent/framework/platform-event-handler/dm_platform_event_handler.c b/src/agent/framework/platform-event-handler/dm_platform_event_handler.c index 1c42c24..bd06d58 100755 --- a/src/agent/framework/platform-event-handler/dm_platform_event_handler.c +++ b/src/agent/framework/platform-event-handler/dm_platform_event_handler.c @@ -49,6 +49,8 @@ static DM_ERROR _fumo_interval_alarm(int item_id); static DM_ERROR _fumo_account_registration_alarm(int item_id); static DM_ERROR _lawmo_account_registration_alarm(int item_id); +//static DM_ERROR _fota_polling_alarm(int item_id); +//static DM_ERROR _lawmo_mobile_tracking_start(int item_id); static DM_ERROR _send_event_ds(char *event_msg); static int _dm_notification_operation(const char *out_message, unsigned int outlen); @@ -897,7 +899,24 @@ static DM_ERROR _lawmo_account_registration_alarm(int item_id) _INNER_FUNC_EXIT; return ret; } +/* +static DM_ERROR _fota_polling_alarm(int item_id) +{ + _INNER_FUNC_ENTER; + + DM_ERROR ret = DM_OK; + _INNER_FUNC_EXIT; + return ret; +} +static DM_ERROR _lawmo_mobile_tracking_start(int item_id) +{ + _INNER_FUNC_ENTER; + DM_ERROR ret = DM_OK; + _INNER_FUNC_EXIT; + return ret; +} +*/ static DM_ERROR _send_event_ds(char *event_msg) { _INNER_FUNC_ENTER; diff --git a/src/agent/framework/task/oma_dm_task_spec.c b/src/agent/framework/task/oma_dm_task_spec.c index 144dac8..09010d9 100755 --- a/src/agent/framework/task/oma_dm_task_spec.c +++ b/src/agent/framework/task/oma_dm_task_spec.c @@ -532,6 +532,7 @@ static sync_agent_ec_task_error_e _start_dm_fumo_ui_process(unsigned int param_c _DEBUG_TRACE("-----------------------------------%s---------------------------------------", pEvent_data->session_id); _DEBUG_TRACE("-----------------------------------%s---------------------------------------", pEvent_data->server_id); + _DEBUG_TRACE("Event_type = %d", pEvent_data->type); _DEBUG_TRACE("noti type id= %d", pEvent_data->noti_type); _DEBUG_TRACE("session id= %s", pEvent_data->session_id); @@ -544,7 +545,7 @@ static sync_agent_ec_task_error_e _start_dm_fumo_ui_process(unsigned int param_c value = status->engine_status; if (value != DM_BEFORE_BOOTSTRAP) { - ret = launch_om_dm_fumo_noti_ui(pEvent_data->noti_type, pEvent_data->session_id, pEvent_data->server_id); + ret = launch_om_dm_fumo_noti_ui(pEvent_data->noti_type, pEvent_data->session_id, pEvent_data->server_id, pEvent_data->type); if (ret == 0) { _DEBUG_TRACE("ui launch fail"); } diff --git a/src/agent/framework/ui-event-handler/ipc_agent.c b/src/agent/framework/ui-event-handler/ipc_agent.c index b80fa1f..5f670f8 100755 --- a/src/agent/framework/ui-event-handler/ipc_agent.c +++ b/src/agent/framework/ui-event-handler/ipc_agent.c @@ -137,42 +137,42 @@ static int __launch_ui(char *ui_mode, int noti_type) if (strcmp(ui_mode, OMADM_FUMO_UI_TYPE) == 0) { ui_ret = launch_oma_dm_fumo_ui(); - _DEBUG_VERBOSE("fumo ui : %d", ui_ret); + _DEBUG_INFO("fumo ui : %d", ui_ret); } else if (strcmp(ui_mode, OMADM_FUMO_NOTI_UI_TYPE) == 0) { DM_ERROR ret_poll = DM_OK; char *server_id = NULL; ret_poll = get_Serverid(SAMSUNG_FUMO_TYPE, &server_id); if (ret_poll!= DM_OK || server_id == NULL) { - ui_ret = launch_om_dm_fumo_noti_ui(NOTI_TYPE_USERINTERACTION, NULL, NULL); + ui_ret = launch_om_dm_fumo_noti_ui(NOTI_TYPE_USERINTERACTION, NULL, NULL, POLL_EVENT); } else { - ui_ret = launch_om_dm_fumo_noti_ui(NOTI_TYPE_USERINTERACTION, NULL, server_id); + ui_ret = launch_om_dm_fumo_noti_ui(NOTI_TYPE_USERINTERACTION, NULL, server_id, POLL_EVENT); free(server_id); } - _DEBUG_VERBOSE("noti ui : %d", ui_ret); + _DEBUG_INFO("noti ui : %d", ui_ret); } else if (strcmp(ui_mode, OMADM_FUMO_BACKGROUND_UI_TYPE) == 0) { if (noti_type == NOTI_INSTALL) { - ui_ret = launch_om_dm_fumo_noti_ui(NOTI_TYPE_BACKGRUOUND, NULL, NULL); - _DEBUG_VERBOSE("noti ui : %d", ui_ret); + ui_ret = launch_om_dm_fumo_noti_ui(NOTI_TYPE_BACKGRUOUND, NULL, NULL, 0); + _DEBUG_INFO("noti ui : %d", ui_ret); } - _DEBUG_VERBOSE("background ui"); + _DEBUG_INFO("background ui"); _INNER_FUNC_EXIT; return 0; } else if (strcmp(ui_mode, OMADM_ALERT_UI_TYPE) == 0) { ui_ret = launch_om_dm_fumo_alert_ui(); - _DEBUG_VERBOSE("alert ui : %d", ui_ret); + _DEBUG_INFO("alert ui : %d", ui_ret); } else { _INNER_FUNC_EXIT; return -1; } if (ui_ret == 0) { - _DEBUG_VERBOSE("UI launch fail"); + _DEBUG_INFO("UI launch fail"); _INNER_FUNC_EXIT; return -1; } } else { - _DEBUG_VERBOSE("ERROR UI MODE NULL"); + _DEBUG_INFO("ERROR UI MODE NULL"); _INNER_FUNC_EXIT; return -1; } @@ -272,63 +272,71 @@ static int __event_callback_software_update(sync_agent_event_data_s * request, s char *session_id = NULL; char *fota_ui_type = NULL; char *server_id = NULL; + Event_Type triger_type = POLL_EVENT; int task_id = 0; SERVICE_SERVER_TYPE server_type = SAMSUNG_FUMO_TYPE; OPER_MODE operationMode = OPER_UNKNOWN; NotI_Type noti_type = NOTI_TYPE_NOT_SPECIFIED; sync_agent_get_event_data_param_int(request, (int*) &ui_type); - _DEBUG_VERBOSE("UI TYPE : %d\n", ui_type); + _DEBUG_INFO("UI TYPE : %d\n", ui_type); switch (ui_type) { case FOTA_COMMON_UI: - _DEBUG_VERBOSE("common ui"); + _DEBUG_INFO("common ui"); fota_ui_type = OMADM_FUMO_UI_TYPE; sync_agent_get_event_data_param_int(request, &task_id); - _DEBUG_VERBOSE("get task id : %d", task_id); + _DEBUG_INFO("get task id : %d", task_id); sync_agent_get_event_data_param_int(request, (int*) &server_type); + triger_type = UI_EVENT; ret = get_Serverid(server_type, &server_id); //ret =get_Serverid(SAMSUNG_FUMO_TYPE , &server_id); //ret =get_Serverid(GCF_TYPE , &server_id); - _DEBUG_VERBOSE("get server id : %s : %d", server_id, ret); + _DEBUG_INFO("get server id : %s : %d", server_id, ret); operationMode = OPER_USER_INITIATION; break; case FOTA_NOTI_UI: - _DEBUG_VERBOSE("noti ui"); + _DEBUG_INFO("noti ui"); fota_ui_type = OMADM_FUMO_NOTI_UI_TYPE; sync_agent_get_event_data_param_str(request, &session_id); sync_agent_get_event_data_param_str(request, &server_id); - _DEBUG_VERBOSE("get session id : %s", session_id); - _DEBUG_VERBOSE("get server id : %s", server_id); + sync_agent_get_event_data_param_int(request,(int*) &triger_type); + _DEBUG_INFO("get session id : %s", session_id); + _DEBUG_INFO("get server id : %s", server_id); + _DEBUG_INFO("get triger_type : %d", triger_type); + operationMode = OPER_SERVER_INITIATION_FROM_IP; break; case FOTA_BACKGROUND_UI: - _DEBUG_VERBOSE("background ui"); + _DEBUG_INFO("background ui"); break; case ADMIN_UI: - _DEBUG_VERBOSE("admin ui"); + _DEBUG_INFO("admin ui"); fota_ui_type = OMADM_ADMIN_UI_TYPE; sync_agent_get_event_data_param_int(request, (int*) &server_type); ret = get_Serverid(server_type, &server_id); - _DEBUG_VERBOSE("get server id : %s : %d", server_id, ret); + _DEBUG_INFO("get server id : %s : %d", server_id, ret); operationMode = OPER_USER_INITIATION; break; case CP_UI: - _DEBUG_VERBOSE("cp ui"); + _DEBUG_INFO("cp ui"); break; default: - _DEBUG_VERBOSE("not use ui"); + _DEBUG_INFO("not use ui"); break; } if (server_id != NULL) { - _DEBUG_VERBOSE("fumo server id = %s", server_id); + _DEBUG_INFO("fumo server id = %s", server_id); Event_Contents *ev_data = (Event_Contents *) calloc(1, sizeof(Event_Contents)); if (ev_data == NULL) { - _DEBUG_VERBOSE("alloc fail"); + _DEBUG_INFO("alloc fail"); goto error; } - ev_data->type = UI_EVENT; + //ev_data->type = UI_EVENT; + //ev_data->type = IP_PUSH_EVENT; + ev_data->type = triger_type; + _DEBUG_INFO("get triger_type : %d", triger_type); if (session_id != NULL) ev_data->session_id = strdup(session_id); if (server_id != NULL) { @@ -418,28 +426,30 @@ static int __event_callback_download(sync_agent_event_data_s * request, sync_age RESUME_STATUS download_clicked = 0; sync_agent_get_event_data_param_int(request, &response_type); - _DEBUG_VERBOSE("DOWNLOAD BUTTON TYPE : %d\n", response_type); + _DEBUG_INFO("DOWNLOAD BUTTON TYPE : %d\n", response_type); ret = DB_Open(); - _DEBUG_VERBOSE("db open : %d", ret); + _DEBUG_INFO("db open : %d", ret); if (response_type == RESPONSE_TYPE_OK) { /*download button clicked */ download_clicked = RESUME_STATUS_DOWNLOAD; ret = Update_Engine_Status_Column(FUMO_SERVICE_ENGINE, VALUE_DOWNLOAD_CLICK, &download_clicked); - _DEBUG_VERBOSE("update engine status clolumn download click : %d", ret); + _DEBUG_INFO("update engine status clolumn download click : %d", ret); } else if (RESPONSE_TYPE_CANCEL) { /*later button clicked */ download_clicked = RESUME_STATUS_DOWNLOAD_LATER; ret = Update_Engine_Status_Column(FUMO_SERVICE_ENGINE, VALUE_DOWNLOAD_CLICK, &download_clicked); - _DEBUG_VERBOSE("update engine status clolumn download click : %d", ret); + _DEBUG_INFO("update engine status clolumn download click : %d", ret); } DB_Close(); - ret = fumo_serviceEngine_task_request(); - if (ret != DM_OK) { - goto error; + if (response_type == RESPONSE_TYPE_OK) { + ret = fumo_serviceEngine_task_request(); + if (ret != DM_OK) { + goto error; + } } //2012.11.20 sync_agent_append_event_data_param(response, SYNC_AGENT_EVENT_PARAM_TYPE_INTEGER, &ev_response); @@ -556,6 +566,18 @@ static int __event_callback_set_interval(sync_agent_event_data_s * request, sync goto error; } */ + ret = DB_Open(); + _DEBUG_INFO("db open : %d", ret); + + int engine_return = FUMO_USER_CANCELLED;// 401; + ret = Update_Engine_Status_Column(FUMO_SERVICE_ENGINE, VALUE_RESULT_STATUS, &engine_return); + _DEBUG_INFO("ret[%d] service engine status generic alert status : %d", ret, engine_return); + DB_Close(); + + ret = fumo_serviceEngine_task_request(); + if (ret != DM_OK) { + goto error; + } _DEBUG_INFO("fumo schedule cancel : %d \n", ret); } diff --git a/src/agent/serviceadapter/dm-phase-handler/dm_phase_handler.c b/src/agent/serviceadapter/dm-phase-handler/dm_phase_handler.c index e75e252..91dd194 100755 --- a/src/agent/serviceadapter/dm-phase-handler/dm_phase_handler.c +++ b/src/agent/serviceadapter/dm-phase-handler/dm_phase_handler.c @@ -242,12 +242,61 @@ static DM_ERROR _generate_setupphase_msg(Session ** session, char *pServer_id, c /* create generic alert for polling & user init */ - //Command *pAlertDownloadUpdateCommand = NULL; - //Item *pItem = NULL; + Command *pAlertDownloadUpdateCommand = NULL; + Item *pItem = NULL; char *rSourceUrl = NULL; char *format = NULL; char *contenttype = NULL; char *data = NULL; + if(strcmp(pServer_id,"xxxxxxxxxx") == 0 ) { // xxxxxxxxxx is Server_id for Production FOTA server. + switch (session_type) { + case 0: //IP_PUSH_EVENT + case 1: //WAP_PUSH_EVENT + break; + case 2: //UI_EVENT + { + ret = create_alert_cmd((*session), DM_ALERT_GENERIC_ALERT, &pAlertDownloadUpdateCommand); + if (ret != DM_OK) + goto error; + rSourceUrl = strdup("./FUMO/DownloadAndUpdate"); + format = strdup("chr"); + //contenttype = strdup("org.openmobilealliance.dm.firmwareupdate.devicerequest"); + contenttype = strdup("org.openmobilealliance.dm.firmwareupdate.userrequest"); + data = g_strdup_printf("%d", 0); + unsigned int size = 0; + unsigned int moredata = 0; + //ret = set_correlator(&pAlertDownloadUpdateCommand, pCorrelator); + ret = construct_Item(rSourceUrl, format, contenttype, data, size, moredata, &pItem); + pAlertDownloadUpdateCommand->private.alert.items = g_list_append(pAlertDownloadUpdateCommand->private.alert.items, pItem); + putCmdIntoList(&commands, &commands_last, pAlertDownloadUpdateCommand); + } + break; + case 3: //SERVER_BOOTSTRAP_EVENT + break; + case 4: //POLL_EVENT + { + ret = create_alert_cmd((*session), DM_ALERT_GENERIC_ALERT, &pAlertDownloadUpdateCommand); + if (ret != DM_OK) + goto error; + rSourceUrl = strdup("./FUMO/DownloadAndUpdate"); + format = strdup("chr"); + contenttype = strdup("org.openmobilealliance.dm.firmwareupdate.devicerequest"); + data = g_strdup_printf("%d", 0); + unsigned int size = 0; + unsigned int moredata = 0; + //ret = set_correlator(&pAlertDownloadUpdateCommand, pCorrelator); + ret = construct_Item(rSourceUrl, format, contenttype, data, size, moredata, &pItem); + pAlertDownloadUpdateCommand->private.alert.items = g_list_append(pAlertDownloadUpdateCommand->private.alert.items, pItem); + putCmdIntoList(&commands, &commands_last, pAlertDownloadUpdateCommand); + } + break; + default: + break; + } + } + + + /*create SyncML */ SyncML *pSyncML = NULL; ret = create_syncml(pSyncHdr, NULL, commands, isFinal, &pSyncML); diff --git a/src/plugins/dm-private/slp-device-dm/src/plugin_slp_device_ctrl.c b/src/plugins/dm-private/slp-device-dm/src/plugin_slp_device_ctrl.c index a856d2b..45df53a 100755 --- a/src/plugins/dm-private/slp-device-dm/src/plugin_slp_device_ctrl.c +++ b/src/plugins/dm-private/slp-device-dm/src/plugin_slp_device_ctrl.c @@ -36,7 +36,10 @@ #define LOG_TAG "PLUGIN_DEVICE_SLP_DM" #endif -#define RB_ERR_CODE_MAX_COUNT 16 +#define UA_RESULT_KEY "db/SyncML/oma-dm-service/UAresult" + +//#define RB_ERR_CODE_MAX_COUNT 16 +#define RB_ERR_CODE_MAX_COUNT 7 typedef struct _type_Redbend_OMADM_Table { int result_code; @@ -46,6 +49,7 @@ typedef struct _type_Redbend_OMADM_Table { } type_redbend_omadm_table_s; type_redbend_omadm_table_s redbend_omadm_table[RB_ERR_CODE_MAX_COUNT] = { +/* {200, "Successful", "0", "S_RB_SUCCESS"}, {410, "Firmware Update Failed", "1", "E_RB_*"}, // juhaki.park {402, "Corrupted Firmware Update Package", "8000000D", "E_RB_PKG_CORRUPTED"}, @@ -62,6 +66,14 @@ type_redbend_omadm_table_s redbend_omadm_table[RB_ERR_CODE_MAX_COUNT] = { {405, "Firmware Update Package Not Acceptable", "8000000E", "E_RB_PKG_NOT_AUTHORIZED"}, {410, "Firmware Update Failed", "**", "E_RB_*"}, {502, "Firmware update fails due to device out of memory", "8000001E", "E_RB_NOT_ENOUGH_RAM"}, +*/ + {200, "Successful", "0", "S_RB_SUCCESS"}, + {410, "Firmware Update Failed", "FDBC", "E_RB_Bootloader_update_error"}, // juhaki.park + {410, "Firmware Update Failed", "fdbc", "E_RB_Bootloader_update_error"}, // juhaki.park + {410, "Firmware Update Failed", "FDBD", "E_RB_Boot_partition_update_error"}, // juhaki.park + {410, "Firmware Update Failed", "fdbd", "E_RB_Boot_partition_update_error"}, // juhaki.park + {410, "Firmware Update Failed", "FDBE", "E_RB_Platform_update_error"}, // juhaki.park + {410, "Firmware Update Failed", "fdbe", "E_RB_Platform_update_error"}, // juhaki.park /*{0, NULL, NULL, NULL},*/ }; @@ -71,7 +83,7 @@ static int _system_command(const char *command); /*static int __return_pkgmgr_cb(pkg_request_id req_id, const char *pkg_type, const char *pkg_name, const char *key, const char *val, const void *pmsg, void *data);*/ int slp_device_ctrl_set_fota_flag() -{ +{ // return value : success[0] faile[1] _EXTERN_FUNC_ENTER; /* @@ -82,17 +94,120 @@ int slp_device_ctrl_set_fota_flag() ("/bin/change-booting-mode.sh --fota /opt/data/fota"); */ - _DEBUG_INFO("/bin/change-booting-mode.sh --fota /opt/data/fota/save \n"); + int ret = _system_command("/bin/sync"); + _DEBUG_INFO("disk sync - ret : [%d]", ret); + + _DEBUG_INFO("/bin/change-booting-mode.sh --fota /opt/usr/data/fota/save \n"); + ret = system("/bin/change-booting-mode.sh --fota /opt/usr/data/fota/save"); + _DEBUG_INFO("change-booting-mode.sh ret : [%d]", ret); + + _EXTERN_FUNC_EXIT; + return 0; + +/* int ret = _system_command("/bin/change-booting-mode.sh --fota /opt/data/fota/save"); + _DEBUG_INFO("change-booting-mode.sh ret : [%d]", ret); + if (ret != -1) { + _DEBUG_ERROR("error : %d", ret); + + if(ret == 256) { + ret = _system_command("reboot fota"); + if(ret != -1) { + _EXTERN_FUNC_EXIT; + return 1; + } else { + _EXTERN_FUNC_EXIT; + return 0; + } + } + _EXTERN_FUNC_EXIT; return 1; } else { _EXTERN_FUNC_EXIT; return 0; } -/*error: - return 0;*/ +error: + return 0; +*/ +} + +void slp_device_ctrl_get_fota_fail_ua_result(char * str_UA_file_position) +{ + _EXTERN_FUNC_ENTER; + FILE *file_des; + long lSize = 0; + size_t result; + char file_path[128] = {0,}; + snprintf(file_path,128, "%s/cause", /*FOTA_SAVE_DIR*/ "/opt/usr/data/fota/save"); + file_des = fopen(file_path, "rb"); + if (file_des == NULL) { + _DEBUG_INFO("fopen fail - cause file \n"); + _EXTERN_FUNC_EXIT; + return; + } + fseek(file_des, 0, SEEK_END); + lSize = ftell(file_des); + if (lSize < 0) { + _DEBUG_INFO("ftell nagative return "); + if (file_des != NULL) + fclose(file_des); + _EXTERN_FUNC_EXIT; + return; + } + rewind(file_des); + char *str_result = NULL; + str_result = (char *)calloc(1, lSize + 1); + if (str_result == NULL) { + if (file_des != NULL) + fclose(file_des); + _DEBUG_INFO("malloc fail \n"); + _EXTERN_FUNC_EXIT; + return; + } + memset(str_result, 0x0, lSize+1); // PREVENT + + result = fread(str_result, 1, lSize, file_des); + if ((result != lSize) || (str_result == NULL)) { + if (file_des != NULL) + fclose(file_des); + _DEBUG_INFO("read fail or str_result == NULL \n"); + + if (str_result != NULL) + free(str_result); + + _EXTERN_FUNC_EXIT; + return; + } + if (str_result[lSize - 1] == '\n') + str_result[lSize - 1] = 0; + + if(lSize > 0) { + int vconf_result = 0; + char str_ua_result[128] = {0,}; + if(str_UA_file_position == NULL) { + snprintf(str_ua_result,128,"NoData-%s", str_result); + } else { + snprintf(str_ua_result,128,"%s-%s", str_UA_file_position, str_result); + } + vconf_result = vconf_set_str(UA_RESULT_KEY, str_ua_result); + if(vconf_result == 0) { + _DEBUG_VERBOSE("vconf_set_str() success %s [%s]!!", UA_RESULT_KEY, str_ua_result); + } else { + _DEBUG_VERBOSE("vconf_set_str() %s failed !!", UA_RESULT_KEY); + } + } + + _DEBUG_INFO("str_result [%s] \n", str_result); + + if (str_result != NULL) + free(str_result); + + if (file_des != NULL) + fclose(file_des); + + _EXTERN_FUNC_EXIT; } int slp_device_ctrl_get_fota_update_result() @@ -103,7 +218,11 @@ int slp_device_ctrl_get_fota_update_result() FILE *file_des; long lSize = 0; /*prevent */ size_t result; - file_des = fopen("/opt/result", "rb"); + //file_des = fopen("/opt/result", "rb"); + char file_path[128] = {0,}; + snprintf(file_path,128, "%s/result", /*FOTA_SAVE_DIR*/ "/opt/usr/data/fota/save"); + file_des = fopen(file_path, "rb"); + int j = 0; bool match_found = false; if (file_des == NULL) { @@ -113,7 +232,7 @@ int slp_device_ctrl_get_fota_update_result() } fseek(file_des, 0, SEEK_END); lSize = ftell(file_des); - if (lSize < 0) { + if (lSize <= 0) { _DEBUG_INFO("ftell nagative return "); if (file_des != NULL) fclose(file_des); @@ -129,10 +248,10 @@ int slp_device_ctrl_get_fota_update_result() _DEBUG_INFO("malloc fail \n"); _EXTERN_FUNC_EXIT; return 400; - } else { - memset(str_result, 0, lSize+1); } + memset(str_result, 0x0, lSize+1); // PREVENT + result = fread(str_result, 1, lSize, file_des); if ((result != lSize) || (str_result == NULL)) { if (file_des != NULL) @@ -153,7 +272,20 @@ int slp_device_ctrl_get_fota_update_result() if ((strcmp(str_result, redbend_omadm_table[j].result_redbend) == 0)) { update_result = redbend_omadm_table[j].result_code; match_found = true; - _DEBUG_INFO("Redbend[%s] \n", redbend_omadm_table[j].str_redbend); + _DEBUG_INFO("Result info [%s] \n", redbend_omadm_table[j].str_redbend); + + if(update_result != 200) { + slp_device_ctrl_get_fota_fail_ua_result(redbend_omadm_table[j].str_redbend); + } else { + int vconf_result = 0; + vconf_result = vconf_set_str(UA_RESULT_KEY, redbend_omadm_table[j].str_redbend); + if(vconf_result == 0) { + _DEBUG_VERBOSE("vconf_set_str() success %s [%s]!!", UA_RESULT_KEY, redbend_omadm_table[j].str_redbend); + } else { + _DEBUG_VERBOSE("vconf_set_str() %s failed !!", UA_RESULT_KEY); + } + } + break; /* If existing error code, break-out from the for-loop. */ } } @@ -277,10 +409,12 @@ static int _system_command(const char *command) do { if (waitpid(pid, &status, 0) == -1) { if (errno != EINTR) { + _INNER_FUNC_EXIT; return -1; } } else { + _DEBUG_ERROR("error : status [%d]", status); _INNER_FUNC_EXIT; return status; } diff --git a/src/plugins/dm-private/slp-device-dm/src/plugin_slp_device_info.c b/src/plugins/dm-private/slp-device-dm/src/plugin_slp_device_info.c index ab5b33a..c3cfa60 100755 --- a/src/plugins/dm-private/slp-device-dm/src/plugin_slp_device_info.c +++ b/src/plugins/dm-private/slp-device-dm/src/plugin_slp_device_info.c @@ -36,7 +36,6 @@ #define LOG_TAG "PLUGIN_DEVICE_SLP_DM" #endif -#define _D_MSC_FIRMWARE_MAXSTRING_ 40 #define _D_SIZE_64_ 64 #define _D_SIZE_128_ 128 @@ -45,8 +44,10 @@ #define OPCO "UK" -#define FOTA_DOWNLOAD_DIR "/opt/data/fota/download" -#define FOTA_SAVE_DIR "/opt/data/fota/save" +//#define FOTA_DOWNLOAD_DIR "/opt/data/fota/download" +//#define FOTA_SAVE_DIR "/opt/data/fota/save" +#define FOTA_DOWNLOAD_DIR "/opt/usr/data/fota/download" +#define FOTA_SAVE_DIR "/opt/usr/data/fota/save" #define FOTA_SD_DOWNLOAD_DIR "/opt/storage/sdcard/data/fota/download" #define FOTA_SD_SAVE_DIR "/opt/storage/sdcard/data/fota/save" @@ -94,7 +95,7 @@ char *slp_device_info_get_kernel_version() _DEBUG_INFO("uname failed - kernel_version [%s]", kernel_version); _EXTERN_FUNC_EXIT; - return kernel_version; + return kernel_version; } snprintf(kernel_version, _D_SIZE_128_ - 1, "%s.%s", "K", buf.release); @@ -323,7 +324,7 @@ char *slp_device_info_get_imsi_info() _EXTERN_FUNC_ENTER; _DEBUG_INFO("Start !!"); - +/* TelSimImsiInfo_t sim_imsi_info; int err_code = -1; @@ -368,6 +369,7 @@ char *slp_device_info_get_imsi_info() return 0; } } - +*/ + return strdup("MccMncMsin"); _EXTERN_FUNC_EXIT; } -- 2.7.4