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

Commit ffc60f50 authored by Lifu Tang's avatar Lifu Tang Committed by android-build-merger
Browse files

Merge "Added defensive code to prevent system crash" into nyc-dev

am: a3814554

* commit 'a3814554':
  Added defensive code to prevent system crash

Change-Id: I97dd4a994c86bf9bc845de08a8ff9c303bb86240
parents 428b8827 a3814554
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -661,6 +661,16 @@ static void GeofenceMonitorStatusCallback(
    TranslateToObject(lastLocation, locationObject);
  }

  // sCallbacksObject is created when FlpHardwareProvider on Java side is
  // initialized. Sometimes the hardware may call this function before the Java
  // side is ready. In order to prevent the system crash, check whether
  // sCallbacksObj has been created. If not, simply ignore this event from
  // hardware.
  if (sCallbacksObj == NULL) {
    ALOGE("FlpHardwareProvider hasn't been initialized.");
    return;
  }

  sCallbackEnv->CallVoidMethod(
      sCallbacksObj,
      sOnGeofenceMonitorStatus,