summaryrefslogtreecommitdiff
path: root/android/2.0/Gnss.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'android/2.0/Gnss.cpp')
-rw-r--r--android/2.0/Gnss.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/android/2.0/Gnss.cpp b/android/2.0/Gnss.cpp
index 48afc1e..dfdbe1b 100644
--- a/android/2.0/Gnss.cpp
+++ b/android/2.0/Gnss.cpp
@@ -85,8 +85,7 @@ void Gnss::GnssDeathRecipient::serviceDied(uint64_t cookie, const wp<IBase>& who
__FUNCTION__, static_cast<unsigned long long>(cookie), &who);
auto gnss = mGnss.promote();
if (gnss != nullptr) {
- gnss->getGnssInterface()->resetNetworkInfo();
- gnss->cleanup();
+ gnss->handleClientDeath();
}
}
@@ -117,6 +116,19 @@ Gnss::~Gnss() {
sGnss = nullptr;
}
+void Gnss::handleClientDeath() {
+ getGnssInterface()->resetNetworkInfo();
+ cleanup();
+ if (mApi != nullptr) {
+ mApi->gnssUpdateCallbacks(nullptr, nullptr);
+ mApi->gnssUpdateCallbacks_2_0(nullptr);
+ }
+ mGnssCbIface = nullptr;
+ mGnssNiCbIface = nullptr;
+ mGnssCbIface_1_1 = nullptr;
+ mGnssCbIface_2_0 = nullptr;
+}
+
GnssAPIClient* Gnss::getApi() {
if (mApi != nullptr) {
return mApi;