Merge "Added defensive code to prevent system crash" into nyc-dev
am: a381455
* commit 'a381455472a814c8dbd98fcb4312f46ed1373c88':
Added defensive code to prevent system crash
Change-Id: I97dd4a994c86bf9bc845de08a8ff9c303bb86240
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user