summaryrefslogtreecommitdiff
path: root/android/2.0/GnssGeofencing.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'android/2.0/GnssGeofencing.cpp')
-rw-r--r--android/2.0/GnssGeofencing.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/android/2.0/GnssGeofencing.cpp b/android/2.0/GnssGeofencing.cpp
index 44c514b..8d53c59 100644
--- a/android/2.0/GnssGeofencing.cpp
+++ b/android/2.0/GnssGeofencing.cpp
@@ -36,7 +36,7 @@ void GnssGeofencing::GnssGeofencingDeathRecipient::serviceDied(
__FUNCTION__, static_cast<unsigned long long>(cookie), &who);
auto gnssGeofencing = mGnssGeofencing.promote();
if (gnssGeofencing != nullptr) {
- gnssGeofencing->removeAllGeofences();
+ gnssGeofencing->handleClientDeath();
}
}
@@ -47,6 +47,15 @@ GnssGeofencing::~GnssGeofencing() {
}
}
+void GnssGeofencing::handleClientDeath() {
+
+ removeAllGeofences();
+ if (mApi != nullptr) {
+ mApi->upcateCallback(nullptr);
+ }
+ mGnssGeofencingCbIface = nullptr;
+}
+
// Methods from ::android::hardware::gnss::V1_0::IGnssGeofencing follow.
Return<void> GnssGeofencing::setCallback(const sp<IGnssGeofenceCallback>& callback) {
if (mGnssGeofencingDeathRecipient == nullptr) {