diff options
Diffstat (limited to 'android/2.1/Gnss.cpp')
-rw-r--r-- | android/2.1/Gnss.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/android/2.1/Gnss.cpp b/android/2.1/Gnss.cpp index ec297f9..cbdb5d8 100644 --- a/android/2.1/Gnss.cpp +++ b/android/2.1/Gnss.cpp @@ -87,8 +87,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(); } } @@ -119,6 +118,21 @@ Gnss::~Gnss() { sGnss = nullptr; } +void Gnss::handleClientDeath() { + getGnssInterface()->resetNetworkInfo(); + cleanup(); + if (mApi != nullptr) { + mApi->gnssUpdateCallbacks(nullptr, nullptr); + mApi->gnssUpdateCallbacks_2_0(nullptr); + mApi->gnssUpdateCallbacks_2_1(nullptr); + } + mGnssCbIface = nullptr; + mGnssNiCbIface = nullptr; + mGnssCbIface_1_1 = nullptr; + mGnssCbIface_2_0 = nullptr; + mGnssCbIface_2_1 = nullptr; +} + GnssAPIClient* Gnss::getApi() { if (mApi != nullptr) { return mApi; |