diff options
Diffstat (limited to 'android/2.1/GnssBatching.cpp')
-rw-r--r-- | android/2.1/GnssBatching.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/android/2.1/GnssBatching.cpp b/android/2.1/GnssBatching.cpp index 1165bd8..a5513a6 100644 --- a/android/2.1/GnssBatching.cpp +++ b/android/2.1/GnssBatching.cpp @@ -36,8 +36,7 @@ void GnssBatching::GnssBatchingDeathRecipient::serviceDied( __FUNCTION__, static_cast<unsigned long long>(cookie), &who); auto gnssBatching = mGnssBatching.promote(); if (gnssBatching != nullptr) { - gnssBatching->stop(); - gnssBatching->cleanup(); + gnssBatching->handleClientDeath(); } } @@ -48,6 +47,17 @@ GnssBatching::~GnssBatching() { } } +void GnssBatching::handleClientDeath() { + + stop(); + cleanup(); + if (mApi != nullptr) { + mApi->gnssUpdateCallbacks_2_0(nullptr); + mApi->gnssUpdateCallbacks(nullptr); + } + mGnssBatchingCbIface_2_0 = nullptr; + mGnssBatchingCbIface = nullptr; +} // Methods from ::android::hardware::gnss::V1_0::IGnssBatching follow. Return<bool> GnssBatching::init(const sp<V1_0::IGnssBatchingCallback>& callback) { |