summaryrefslogtreecommitdiff
path: root/android/1.1/GnssBatching.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'android/1.1/GnssBatching.cpp')
-rw-r--r--android/1.1/GnssBatching.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/android/1.1/GnssBatching.cpp b/android/1.1/GnssBatching.cpp
index b78e3b3..90362da 100644
--- a/android/1.1/GnssBatching.cpp
+++ b/android/1.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,14 @@ GnssBatching::~GnssBatching() {
}
}
+GnssBatching::handleClientDeath() {
+ stop();
+ cleanup();
+ if (mApi != nullptr) {
+ mApi->gnssUpdateCallbacks(nullptr);
+ }
+ mGnssBatchingCbIface = nullptr;
+}
// Methods from ::android::hardware::gnss::V1_0::IGnssBatching follow.
Return<bool> GnssBatching::init(const sp<IGnssBatchingCallback>& callback) {