summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsbrissen <sbrissen@hotmail.com>2015-03-27 13:23:58 (GMT)
committersbrissen <sbrissen@hotmail.com>2015-03-27 13:23:58 (GMT)
commitf7c887c8a2e8def624ede3d393fdda644e21fbe6 (patch)
tree8f11d8e24de1adffed062deab8411ff2ca209b48
parent3182bdfba841da29ebc66001ff019a0ec6cfb0c7 (diff)
downloaddevice_samsung_smdk4412-qcom-common-f7c887c8a2e8def624ede3d393fdda644e21fbe6.zip
device_samsung_smdk4412-qcom-common-f7c887c8a2e8def624ede3d393fdda644e21fbe6.tar.gz
device_samsung_smdk4412-qcom-common-f7c887c8a2e8def624ede3d393fdda644e21fbe6.tar.bz2
smdk4412-qcom: add GPS set privacy
Change-Id: Id14d15e511503214f14f7001c37413b3a2a6e22d
-rw-r--r--gps/loc_api/libloc_api_50001/loc_eng.cpp58
1 files changed, 58 insertions, 0 deletions
diff --git a/gps/loc_api/libloc_api_50001/loc_eng.cpp b/gps/loc_api/libloc_api_50001/loc_eng.cpp
index f801909..6eae7fe 100644
--- a/gps/loc_api/libloc_api_50001/loc_eng.cpp
+++ b/gps/loc_api/libloc_api_50001/loc_eng.cpp
@@ -188,6 +188,8 @@ static void loc_eng_process_conn_request(loc_eng_data_s_type &loc_eng_data,
static void loc_eng_agps_close_status(loc_eng_data_s_type &loc_eng_data, int is_succ);
static void loc_eng_handle_engine_down(loc_eng_data_s_type &loc_eng_data) ;
static void loc_eng_handle_engine_up(loc_eng_data_s_type &loc_eng_data) ;
+static int loc_eng_set_privacy(loc_eng_data_s_type &loc_eng_data,
+ int8_t privacy_setting);
static int loc_eng_start_handler(loc_eng_data_s_type &loc_eng_data);
static int loc_eng_stop_handler(loc_eng_data_s_type &loc_eng_data);
@@ -460,6 +462,27 @@ struct LocEngAGlonassProtocol : public LocMsg {
}
};
+// case LOC_ENG_MSG_PRIVACY:
+struct LocEngSecPrivacyLock : public LocMsg {
+ LocEngAdapter* mAdapter;
+ const int mPrivacySetting;
+ inline LocEngSecPrivacyLock(LocEngAdapter* adapter,
+ int8_t privacy_setting) :
+ LocMsg(), mAdapter(adapter), mPrivacySetting(privacy_setting)
+ {
+ locallog();
+ }
+ inline virtual void proc() const {
+ mAdapter->setGpsLock(mPrivacySetting);
+ }
+ inline void locallog() const {
+ LOC_LOGV("PrivacyLock: %d", mPrivacySetting);
+ }
+ inline virtual void log() const {
+ locallog();
+ }
+};
+
// case LOC_ENG_MSG_SUPL_VERSION:
struct LocEngSuplVer : public LocMsg {
LocEngAdapter* mAdapter;
@@ -1529,6 +1552,10 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks,
return ret_val;
}
+ if (NULL != loc_eng_data.adapter) {
+ loc_eng_set_privacy(loc_eng_data, 1);
+ }
+
STATE_CHECK((NULL == loc_eng_data.adapter),
"instance already initialized", return 0);
@@ -1575,6 +1602,8 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks,
loc_eng_data.adapter);
loc_eng_data.adapter->sendMsg(new LocEngInit(&loc_eng_data));
+ loc_eng_set_privacy(loc_eng_data, 1);
+
EXIT_LOG(%d, ret_val);
return ret_val;
}
@@ -1674,6 +1703,8 @@ void loc_eng_cleanup(loc_eng_data_s_type &loc_eng_data)
loc_eng_stop(loc_eng_data);
}
+ loc_eng_set_privacy(loc_eng_data, 4);
+
#if 0 // can't afford to actually clean up, for many reason.
LOC_LOGD("loc_eng_init: client opened. close it now.");
@@ -2634,3 +2665,30 @@ int loc_eng_read_config(void)
EXIT_LOG(%d, 0);
return 0;
}
+
+/*===========================================================================
+FUNCTION loc_eng_set_privacy
+
+DESCRIPTION
+ Sets the privacy lock setting (Values for lock
+ 1 = Do not lock any position sessions -GPS ON
+ 2 = Lock MI position sessions -?
+ 3 = Lock MT position sessions -?
+ 4 = Lock all position sessions -GPS OFF)
+DEPENDENCIES
+ None
+RETURN VALUE
+ 0: success
+SIDE EFFECTS
+ N/A
+===========================================================================*/
+static int loc_eng_set_privacy(loc_eng_data_s_type &loc_eng_data,
+ int8_t privacy_setting)
+{
+ ENTRY_LOG();
+ INIT_CHECK(loc_eng_data.adapter, return -1);
+ LocEngAdapter* adapter = loc_eng_data.adapter;
+ adapter->sendMsg(new LocEngSecPrivacyLock(adapter, privacy_setting));
+ EXIT_LOG(%d, 0);
+ return 0;
+} \ No newline at end of file