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
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 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_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 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 @@
ENTRY_LOG_CALLFLOW();
// for XTRA
- sendConnectionEvent(connected, (uint8_t)type);
+ sendConnectionEvent(connected, (int8_t)type);
return true;
}
@@ -88,7 +88,7 @@
}
}
-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.");