diff options
author | Mike Cailean <mcailean@codeaurora.org> | 2019-02-11 09:11:09 -0800 |
---|---|---|
committer | Mike Cailean <mcailean@codeaurora.org> | 2019-03-21 14:57:28 -0700 |
commit | b046241ec2fdc9a48e99face1794046488a8cabe (patch) | |
tree | ccbe677775add604af707618bd76ec5d51e5afc5 /android/2.0/GnssConfiguration.cpp | |
parent | 1839fb1140242da10a6a599e65a7b79836007517 (diff) | |
download | gps-b046241ec2fdc9a48e99face1794046488a8cabe.tar.gz |
Improved Location NI Privacy
Changes to be made starting in Android Q in the way
that Location requests made by Location clients
other than the Android FrameWork (e.g. Network
Initiated AGNSS clients, modem-based clients such
as MDT) are handled
CRs-fixed: 2397454
Change-Id: Ibb5b9429a1ec1e14ee59d89763d8a78607997615
Diffstat (limited to 'android/2.0/GnssConfiguration.cpp')
-rw-r--r-- | android/2.0/GnssConfiguration.cpp | 47 |
1 files changed, 16 insertions, 31 deletions
diff --git a/android/2.0/GnssConfiguration.cpp b/android/2.0/GnssConfiguration.cpp index 93a843a..eb98be1 100644 --- a/android/2.0/GnssConfiguration.cpp +++ b/android/2.0/GnssConfiguration.cpp @@ -175,35 +175,9 @@ Return<bool> GnssConfiguration::setGlonassPositioningProtocol(uint8_t protocol) } Return<bool> GnssConfiguration::setGpsLock(uint8_t lock) { - if (mGnss == nullptr) { - LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); - return false; - } - - GnssConfig config; - memset(&config, 0, sizeof(GnssConfig)); - config.size = sizeof(GnssConfig); - config.flags = GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT; - switch (lock) { - case 0: - config.gpsLock = GNSS_CONFIG_GPS_LOCK_NONE; - break; - case 1: - config.gpsLock = GNSS_CONFIG_GPS_LOCK_MO; - break; - case 2: - config.gpsLock = GNSS_CONFIG_GPS_LOCK_NI; - break; - case 3: - config.gpsLock = GNSS_CONFIG_GPS_LOCK_MO_AND_NI; - break; - default: - LOC_LOGE("%s]: invalid lock: %d.", __FUNCTION__, lock); - return false; - break; - } - - return mGnss->updateConfiguration(config); + /* we no longer set GPS lock here, there is + visibility control for this */ + return true; } Return<bool> GnssConfiguration::setEmergencySuplPdn(bool enabled) { @@ -308,8 +282,19 @@ bool GnssConfiguration::setBlacklistedSource( // Methods from ::android::hardware::gnss::V2_0::IGnssConfiguration follow. Return<bool> GnssConfiguration::setEsExtensionSec(uint32_t emergencyExtensionSeconds) { - //TODO emergencyExtensionSeconds is not supporded in GnssConfig yet - return false; + ENTRY_LOG_CALLFLOW(); + if (mGnss == nullptr) { + LOC_LOGe("mGnss is nullptr"); + return false; + } + + GnssConfig config; + memset(&config, 0, sizeof(GnssConfig)); + config.size = sizeof(GnssConfig); + config.flags = GNSS_CONFIG_FLAGS_EMERGENCY_EXTENSION_SECONDS_BIT; + config.emergencyExtensionSeconds = emergencyExtensionSeconds; + + return mGnss->updateConfiguration(config); } } // namespace implementation |