#include <vconf.h>
#include <vconf-keys.h>
#include <dlog.h>
+#include <dd-display.h>
#include <glib.h>
#include <glib-object.h>
return;
}
+static void display_mode_changed_cb(keynode_t *key, void *data)
+{
+ gps_failure_reason_t reason_code = GPS_FAILURE_CAUSE_NORMAL;
+
+ int lcd_mode = 0;
+ setting_get_int(VCONFKEY_PM_STATE, &lcd_mode);
+
+ gboolean status = hal_location_request(GPS_ACTION_SEND_PARAMS, &lcd_mode, &reason_code);
+
+ if (status == FALSE) {
+ LOG_GPS(DBG_ERR, "Main: sending GPS_ACTION_START_FACTTEST Fail !");
+ return;
+ }
+
+ status = hal_location_request(GPS_INDI_SUPL_VERIFICATION, NULL, &reason_code);
+
+ if (status == FALSE)
+ {
+ LOG_GPS(DBG_ERR, "Main: sending GPS_INDI_SUPL_VERIFICATION Fail !");
+ return;
+ }
+}
+
+static void replay_mode_changed_cb(keynode_t *key, void *data)
+{
+ gps_failure_reason_t reason_code = GPS_FAILURE_CAUSE_NORMAL;
+
+ int replay_mode = 0;
+ setting_get_int(VCONFKEY_LOCATION_REPLAY_MODE, &replay_mode);
+
+ gboolean status = hal_location_request(GPS_ACTION_START_FACTTEST, &replay_mode, &reason_code);
+
+ if (status == FALSE) {
+ LOG_GPS(DBG_ERR, "Main: sending GPS_ACTION_START_FACTTEST Fail !");
+ return;
+ }
+
+ status = hal_location_request(GPS_ACTION_STOP_FACTTEST, NULL, &reason_code);
+
+ if (status == FALSE)
+ {
+ LOG_GPS(DBG_ERR, "Main: sending GPS_ACTION_STOP_FACTTEST Fail !");
+ return;
+ }
+}
+
static int _gps_server_get_gps_state()
{
int val;
LOG_GPS(DBG_LOW, "plugin_module_load failed %d", ret);
return FALSE;
}
+
+ setting_notify_key_changed(VCONFKEY_PM_STATE, display_mode_changed_cb, NULL);
+ setting_notify_key_changed(VCONFKEY_LOCATION_REPLAY_MODE, replay_mode_changed_cb, NULL);
+
+ char* str = NULL;
+ str = setting_get_string(VCONFKEY_LOCATION_NMEA_FILE_NAME);
+
+ if(str == NULL)
+ {
+ LOG_GPS(DBG_ERR, "nmea file name returned null");
+ return FALSE;
+ }
+
+ status = hal_location_request(GPS_INDI_SUPL_DNSQUERY, &str, &reason_code);
+
+ if(str)
+ {
+ free(str);
+ str = NULL;
+ }
+
+ if (status == FALSE) {
+ LOG_GPS(DBG_ERR, "Main: sending GPS_INDI_SUPL_DNSQUERY Fail !");
+ return FALSE;
+ }
+
+ int replay_mode = 0;
+ setting_get_int(VCONFKEY_LOCATION_REPLAY_MODE, &replay_mode);
+
+ status = hal_location_request(GPS_ACTION_START_FACTTEST, &replay_mode, &reason_code);
+
+ if (status == FALSE) {
+ LOG_GPS(DBG_ERR, "Main: sending GPS_ACTION_START_FACTTEST Fail !");
+ return FALSE;
+ }
+
+ int lcd_mode = 0;
+ setting_get_int(VCONFKEY_PM_STATE, &lcd_mode);
+
+ status = hal_location_request(GPS_ACTION_SEND_PARAMS, &lcd_mode, &reason_code);
+
+ if (status == FALSE) {
+ LOG_GPS(DBG_ERR, "Main: sending GPS_ACTION_START_FACTTEST Fail !");
+ return FALSE;
+ }
+
+ //display_lock from lbs-server-plugin-replay
+ display_lock_state(LCD_OFF, STAY_CUR_STATE, 0);
+ LOG_GPS(LOG_DEBUG, "display_lock_state(LCD_OFF, STAY_CUR_STATE, 0);");
+
status = hal_location_request(GPS_ACTION_START_SESSION, &gps_start_data, &reason_code);
if (status == FALSE) {
LOG_GPS(DBG_LOW, "plugin_module_load failed %d", ret);
return 0;
}
+ setting_ignore_key_changed(VCONFKEY_LOCATION_REPLAY_MODE, replay_mode_changed_cb);
+
+ // display_unlock_state from lbs-server-plugin-replay
+ display_unlock_state(LCD_OFF, PM_RESET_TIMER);
+ LOG_GPS(DBG_LOW, "display_unlock_state(LCD_OFF, PM_RESET_TIMER);");
+
status = hal_location_request(GPS_ACTION_STOP_SESSION, NULL, &reason_code);
if (status) {
LOG_GPS(DBG_LOW, "plugin_module_load failed %d", ret);
return FALSE;
}
+
+ //display_lock_state from lbs-server-plugin-replay
+ display_lock_state(LCD_OFF, STAY_CUR_STATE, 0);
+ LOG_GPS(LOG_DEBUG, "display_lock_state(LCD_OFF, STAY_CUR_STATE, 0);");
+
status = hal_location_request(GPS_ACTION_START_BATCH, &gps_start_data, &reason_code);
if (status == FALSE) {
if( ret < 0){
LOG_GPS(DBG_LOW, "plugin_module_load failed %d", ret);
return 0;
- }
+ }
+
+ // display_unlock_state from lbs-server-plugin-replay
+ display_unlock_state(LCD_OFF, PM_RESET_TIMER);
+ LOG_GPS(DBG_LOW, "display_unlock_state(LCD_OFF, PM_RESET_TIMER);");
+
status = hal_location_request(GPS_ACTION_STOP_BATCH, &gps_start_data, &reason_code);
if (status == TRUE && session_status == 0) {
server->session_state = GPS_SESSION_STOPPING;