Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4cb11b83 authored by Ben Lin's avatar Ben Lin
Browse files

Add null checks for {Gps, Fused}GeofencedHardware.

These two variables are @Nullable and can be passed in as null in
GeofenceProxy's constructor.

Bug: 122475887
Test: Run on a device with no GPS support, no more crash.
Change-Id: I2455e30d10d9bd8ce667ee16bb7b99ec357aad46
parent eb77f51b
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -113,8 +113,12 @@ public final class GeofenceProxy {
            IGeofenceHardware geofenceHardware = IGeofenceHardware.Stub.asInterface(service);

            try {
                if (mGpsGeofenceHardware != null) {
                    geofenceHardware.setGpsGeofenceHardware(mGpsGeofenceHardware);
                }
                if (mFusedGeofenceHardware != null) {
                    geofenceHardware.setFusedGeofenceHardware(mFusedGeofenceHardware);
                }

                mGeofenceHardware = geofenceHardware;
                mServiceWatcher.runOnBinder(mUpdateGeofenceHardware);