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

Commit 78bdfbba 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

am: ffc60f50

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

Change-Id: I69f9c44526cd8ef5d38f17e282bb99fd8180efbc
parents d67b3397 ffc60f50
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,