summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/core/java/com/android/server/location/GeofenceProxy.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/location/GeofenceProxy.java b/services/core/java/com/android/server/location/GeofenceProxy.java
index ca4f7fee494a..38c7d491f706 100644
--- a/services/core/java/com/android/server/location/GeofenceProxy.java
+++ b/services/core/java/com/android/server/location/GeofenceProxy.java
@@ -113,8 +113,12 @@ public final class GeofenceProxy {
IGeofenceHardware geofenceHardware = IGeofenceHardware.Stub.asInterface(service);
try {
- geofenceHardware.setGpsGeofenceHardware(mGpsGeofenceHardware);
- geofenceHardware.setFusedGeofenceHardware(mFusedGeofenceHardware);
+ if (mGpsGeofenceHardware != null) {
+ geofenceHardware.setGpsGeofenceHardware(mGpsGeofenceHardware);
+ }
+ if (mFusedGeofenceHardware != null) {
+ geofenceHardware.setFusedGeofenceHardware(mFusedGeofenceHardware);
+ }
mGeofenceHardware = geofenceHardware;
mServiceWatcher.runOnBinder(mUpdateGeofenceHardware);