Report 2D speed rather than 3D speed.

According to Android API standard, it should be only the
horizontal speed. Therefore, the speed should be reported
in 2D rather than 3D.

Change-Id: Ie42aa350637b56394869bac0af0207a5aceeede6
CRs-fixed: 745419
This commit is contained in:
Jiafei Wen 2014-11-03 14:27:23 -08:00 committed by Gerrit - the friendly Code Review server
parent 452767c1e2
commit 00fd7bc33b

View file

@ -715,12 +715,10 @@ void LocApiRpc::reportPosition(const rpc_loc_parsed_position_s_type *location_re
} }
// Speed // Speed
if ((location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_HORIZONTAL) && if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_HORIZONTAL)
(location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_VERTICAL))
{ {
location.gpsLocation.flags |= GPS_LOCATION_HAS_SPEED; location.gpsLocation.flags |= GPS_LOCATION_HAS_SPEED;
location.gpsLocation.speed = sqrt(location_report_ptr->speed_horizontal * location_report_ptr->speed_horizontal + location.gpsLocation.speed = location_report_ptr->speed_horizontal;
location_report_ptr->speed_vertical * location_report_ptr->speed_vertical);
} }
// Heading // Heading