Merge "Added defensive code to prevent system crash" into nyc-dev
This commit is contained in:
@@ -661,6 +661,16 @@ static void GeofenceMonitorStatusCallback(
|
|||||||
TranslateToObject(lastLocation, locationObject);
|
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(
|
sCallbackEnv->CallVoidMethod(
|
||||||
sCallbacksObj,
|
sCallbacksObj,
|
||||||
sOnGeofenceMonitorStatus,
|
sOnGeofenceMonitorStatus,
|
||||||
|
|||||||
Reference in New Issue
Block a user