summaryrefslogtreecommitdiff
path: root/android/1.0/Gnss.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'android/1.0/Gnss.cpp')
-rw-r--r--android/1.0/Gnss.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/android/1.0/Gnss.cpp b/android/1.0/Gnss.cpp
index c7fca33..b220908 100644
--- a/android/1.0/Gnss.cpp
+++ b/android/1.0/Gnss.cpp
@@ -44,8 +44,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();
}
}
@@ -77,6 +76,16 @@ Gnss::~Gnss() {
sGnss = nullptr;
}
+void Gnss::handleClientDeath() {
+ getGnssInterface()->resetNetworkInfo();
+ cleanup();
+ if (mApi != nullptr) {
+ mApi->gnssUpdateCallbacks(nullptr, nullptr);
+ }
+ mGnssCbIface = nullptr;
+ mGnssNiCbIface = nullptr;
+}
+
GnssAPIClient* Gnss::getApi() {
if (mApi == nullptr && (mGnssCbIface != nullptr || mGnssNiCbIface != nullptr)) {
mApi = new GnssAPIClient(mGnssCbIface, mGnssNiCbIface);