diff options
author | Kevin Tang <zhikait@codeaurora.org> | 2018-08-14 16:38:57 -0700 |
---|---|---|
committer | Kevin Tang <zhikait@codeaurora.org> | 2018-08-14 21:35:21 -0700 |
commit | a030bf9baac9f77a2645c11e76eff69e7cb515e0 (patch) | |
tree | 6978a66e5be77680818062154595821edfad6dcd /android | |
parent | 329de0d44f2d7bb123cd391c007a8d807798600c (diff) | |
download | gps-a030bf9baac9f77a2645c11e76eff69e7cb515e0.tar.gz |
GNSS_NI_RESPONSE_IGNORE handling
GNSS_NI_RESPONSE_IGNORE inaverdently mapped to NO_RESPONSE,
which is a different reponse code. The two should be handled
differently.
Bug: 111770241
CRs-Fixed: 2296845
Change-Id: If2697f51c07a0272841709bfca247daaa4e963b6
Diffstat (limited to 'android')
-rw-r--r-- | android/location_api/GnssAPIClient.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/android/location_api/GnssAPIClient.cpp b/android/location_api/GnssAPIClient.cpp index a6e941e..cec5145 100644 --- a/android/location_api/GnssAPIClient.cpp +++ b/android/location_api/GnssAPIClient.cpp @@ -198,17 +198,22 @@ void GnssAPIClient::gnssNiRespond(int32_t notifId, IGnssNiCallback::GnssUserResponseType userResponse) { LOC_LOGD("%s]: (%d %d)", __FUNCTION__, notifId, static_cast<int>(userResponse)); - GnssNiResponse data = GNSS_NI_RESPONSE_IGNORE; - if (userResponse == IGnssNiCallback::GnssUserResponseType::RESPONSE_ACCEPT) + GnssNiResponse data; + switch (userResponse) { + case IGnssNiCallback::GnssUserResponseType::RESPONSE_ACCEPT: data = GNSS_NI_RESPONSE_ACCEPT; - else if (userResponse == IGnssNiCallback::GnssUserResponseType::RESPONSE_DENY) + break; + case IGnssNiCallback::GnssUserResponseType::RESPONSE_DENY: data = GNSS_NI_RESPONSE_DENY; - else if (userResponse == IGnssNiCallback::GnssUserResponseType::RESPONSE_NORESP) + break; + case IGnssNiCallback::GnssUserResponseType::RESPONSE_NORESP: data = GNSS_NI_RESPONSE_NO_RESPONSE; - else { - LOC_LOGD("%s]: invalid GnssUserResponseType: %d", __FUNCTION__, (int)userResponse); - return; + break; + default: + data = GNSS_NI_RESPONSE_IGNORE; + break; } + locAPIGnssNiResponse(notifId, data); } |