diff options
Diffstat (limited to 'android/1.1/Gnss.cpp')
-rw-r--r-- | android/1.1/Gnss.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/android/1.1/Gnss.cpp b/android/1.1/Gnss.cpp index 39e7128..e67d877 100644 --- a/android/1.1/Gnss.cpp +++ b/android/1.1/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(); } } @@ -118,6 +117,17 @@ Gnss::~Gnss() { sGnss = nullptr; } +void Gnss::handleClientDeath() { + getGnssInterface()->resetNetworkInfo(); + cleanup(); + if (mApi != nullptr) { + mApi->gnssUpdateCallbacks(nullptr, nullptr); + } + mGnssCbIface = nullptr; + mGnssNiCbIface = nullptr; + mGnssCbIface_1_1 = nullptr; +} + GnssAPIClient* Gnss::getApi() { if (mApi == nullptr && (mGnssCbIface != nullptr || mGnssNiCbIface != nullptr)) { mApi = new GnssAPIClient(mGnssCbIface, mGnssNiCbIface); |