summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Tang <zhikait@codeaurora.org>2017-09-08 10:59:25 -0700
committerWyatt Riley <wyattriley@google.com>2017-09-11 15:23:48 -0700
commit4e4f65545e58fdb21f838038eb55056872f1f796 (patch)
tree6f5052aff1a618244d630bc6b89b67c26eac4948
parentf03009f6561c041842dc381853b6d72406416aae (diff)
downloadgps-4e4f65545e58fdb21f838038eb55056872f1f796.tar.gz
fixing conn disconnect handling from GnssLocationProvider
The type needs to maintain as signed, in case some value may come across as negative, even though the storage size may vary, from 8-bit to 32-bit, for example. Bug: 65164961 CRs-Fixed: 2106350 Test: Airplane mode TTFF, per bug Change-Id: Ieb3fb4b6f8415444bbe192a7875093f86a9c3068
-rw-r--r--msm8996/loc_api/libloc_api_50001/loc.cpp5
-rw-r--r--msm8998/android/AGnssRil.cpp6
2 files changed, 5 insertions, 6 deletions
diff --git a/msm8996/loc_api/libloc_api_50001/loc.cpp b/msm8996/loc_api/libloc_api_50001/loc.cpp
index 99548c6..4970915 100644
--- a/msm8996/loc_api/libloc_api_50001/loc.cpp
+++ b/msm8996/loc_api/libloc_api_50001/loc.cpp
@@ -170,7 +170,7 @@ static inline void closeSocket(const int socketFd) {
}
}
-static inline bool sendConnectionEvent(const bool connected, const uint8_t type) {
+static inline bool sendConnectionEvent(const bool connected, const int8_t type) {
int socketFd = createSocket();
if (socketFd < 0) {
LOC_LOGe("XTRA unreachable. sending failed.");
@@ -1063,8 +1063,7 @@ static void loc_agps_ril_ni_message(uint8_t *msg, size_t len) {}
static void loc_agps_ril_update_network_state(int connected, int type, int roaming, const char* extra_info) {
ENTRY_LOG();
// for XTRA
- sendConnectionEvent((connected != 0) ? true : false,
- (uint8_t)type);
+ sendConnectionEvent((connected != 0) ? true : false, type);
EXIT_LOG(%s, VOID_RET);
}
diff --git a/msm8998/android/AGnssRil.cpp b/msm8998/android/AGnssRil.cpp
index b19f55f..f3bbe7c 100644
--- a/msm8998/android/AGnssRil.cpp
+++ b/msm8998/android/AGnssRil.cpp
@@ -37,7 +37,7 @@ namespace gnss {
namespace V1_0 {
namespace implementation {
-static bool sendConnectionEvent(const bool connected, const uint8_t type);
+static bool sendConnectionEvent(const bool connected, const int8_t type);
AGnssRil::AGnssRil(Gnss* gnss) : mGnss(gnss) {
ENTRY_LOG_CALLFLOW();
@@ -51,7 +51,7 @@ Return<bool> AGnssRil::updateNetworkState(bool connected, NetworkType type, bool
ENTRY_LOG_CALLFLOW();
// for XTRA
- sendConnectionEvent(connected, (uint8_t)type);
+ sendConnectionEvent(connected, (int8_t)type);
return true;
}
@@ -88,7 +88,7 @@ static inline void closeSocket(const int socketFd) {
}
}
-static inline bool sendConnectionEvent(const bool connected, const uint8_t type) {
+static inline bool sendConnectionEvent(const bool connected, const int8_t type) {
int socketFd = createSocket();
if (socketFd < 0) {
LOC_LOGe("XTRA unreachable. sending failed.");