From b0474e78df2a778c42c6746da815f397bb2df374 Mon Sep 17 00:00:00 2001 From: Sasha Levitskiy Date: Sat, 2 May 2015 21:03:44 -0700 Subject: [PATCH] SensorServiceTest: Fix build, warnings. Change-Id: I3ed5247d3eb6c43d185049cf9011c2ee01b5662e Signed-off-by: Sasha Levitskiy --- services/sensorservice/tests/sensorservicetest.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/services/sensorservice/tests/sensorservicetest.cpp b/services/sensorservice/tests/sensorservicetest.cpp index 1025fa83f..cfdf6a38e 100644 --- a/services/sensorservice/tests/sensorservicetest.cpp +++ b/services/sensorservice/tests/sensorservicetest.cpp @@ -14,6 +14,7 @@ * limitations under the License. */ +#include #include #include #include @@ -25,7 +26,7 @@ using namespace android; static nsecs_t sStartTime = 0; -int receiver(int fd, int events, void* data) +int receiver(__unused int fd, __unused int events, void* data) { sp q((SensorEventQueue*)data); ssize_t n; @@ -44,7 +45,7 @@ int receiver(int fd, int events, void* data) oldTimeStamp = buffer[i].timestamp; if (buffer[i].type == Sensor::TYPE_ACCELEROMETER) { - printf("%lld\t%8f\t%8f\t%8f\t%f\n", + printf("%" PRId64 "\t%8f\t%8f\t%8f\t%f\n", buffer[i].timestamp, buffer[i].data[0], buffer[i].data[1], buffer[i].data[2], 1.0/t); @@ -59,9 +60,9 @@ int receiver(int fd, int events, void* data) } -int main(int argc, char** argv) +int main() { - SensorManager& mgr(SensorManager::getInstance()); + SensorManager mgr(String16("Sensor Service Test")); Sensor const* const* list; ssize_t count = mgr.getSensorList(&list);