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

Commit a3814554 authored by Lifu Tang's avatar Lifu Tang Committed by Android (Google) Code Review
Browse files

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

parents e1b51715 8b7ad976
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,