summaryrefslogtreecommitdiffstats
path: root/services/sensorservice
diff options
context:
space:
mode:
authorMark Salyzyn <salyzyn@google.com>2014-06-12 16:13:39 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-06-12 16:13:39 +0000
commitc46422ed2bf2e452d878a45735f4d37917008843 (patch)
tree4f11de6915db5c67f2085d9641b63a102e5c9a3f /services/sensorservice
parenteeb0f39f76a29271c9436157bd84a3a2f0e0f43d (diff)
parent20914f0ad3691d977f61f1d4b92b49535e8f6f33 (diff)
downloadframeworks_native-c46422ed2bf2e452d878a45735f4d37917008843.zip
frameworks_native-c46422ed2bf2e452d878a45735f4d37917008843.tar.gz
frameworks_native-c46422ed2bf2e452d878a45735f4d37917008843.tar.bz2
am 20914f0a: am a4e345e1: Merge "sensorservice: 64-bit compile issues"
* commit '20914f0ad3691d977f61f1d4b92b49535e8f6f33': sensorservice: 64-bit compile issues
Diffstat (limited to 'services/sensorservice')
-rw-r--r--services/sensorservice/SensorDevice.cpp25
-rw-r--r--services/sensorservice/SensorService.cpp12
2 files changed, 20 insertions, 17 deletions
diff --git a/services/sensorservice/SensorDevice.cpp b/services/sensorservice/SensorDevice.cpp
index 01dbdfb..3934509 100644
--- a/services/sensorservice/SensorDevice.cpp
+++ b/services/sensorservice/SensorDevice.cpp
@@ -14,8 +14,9 @@
* limitations under the License.
*/
-#include <stdint.h>
+#include <inttypes.h>
#include <math.h>
+#include <stdint.h>
#include <sys/types.h>
#include <utils/Atomic.h>
@@ -134,11 +135,11 @@ status_t SensorDevice::activate(void* ident, int handle, int enabled)
Info& info( mActivationCount.editValueFor(handle) );
ALOGD_IF(DEBUG_CONNECTIONS,
- "SensorDevice::activate: ident=%p, handle=0x%08x, enabled=%d, count=%d",
+ "SensorDevice::activate: ident=%p, handle=0x%08x, enabled=%d, count=%zu",
ident, handle, enabled, info.batchParams.size());
if (enabled) {
- ALOGD_IF(DEBUG_CONNECTIONS, "enable index=%d", info.batchParams.indexOfKey(ident));
+ ALOGD_IF(DEBUG_CONNECTIONS, "enable index=%zd", info.batchParams.indexOfKey(ident));
if (info.batchParams.indexOfKey(ident) >= 0) {
if (info.batchParams.size() == 1) {
@@ -150,7 +151,7 @@ status_t SensorDevice::activate(void* ident, int handle, int enabled)
ALOGE("\t >>>ERROR: activate called without batch");
}
} else {
- ALOGD_IF(DEBUG_CONNECTIONS, "disable index=%d", info.batchParams.indexOfKey(ident));
+ ALOGD_IF(DEBUG_CONNECTIONS, "disable index=%zd", info.batchParams.indexOfKey(ident));
if (info.removeBatchParamsForIdent(ident) >= 0) {
if (info.batchParams.size() == 0) {
@@ -163,7 +164,7 @@ status_t SensorDevice::activate(void* ident, int handle, int enabled)
// batch_rate and timeout. One of the apps has unregistered for sensor
// events, and the best effort batch parameters might have changed.
ALOGD_IF(DEBUG_CONNECTIONS,
- "\t>>> actuating h/w batch %d %d %lld %lld ", handle,
+ "\t>>> actuating h/w batch %d %d %" PRId64 " %" PRId64, handle,
info.bestBatchParams.flags, info.bestBatchParams.batchDelay,
info.bestBatchParams.batchTimeout);
mSensorDevice->batch(mSensorDevice, handle,info.bestBatchParams.flags,
@@ -191,7 +192,7 @@ status_t SensorDevice::activate(void* ident, int handle, int enabled)
// On older devices which do not support batch, call setDelay().
if (getHalDeviceVersion() < SENSORS_DEVICE_API_VERSION_1_1 && info.batchParams.size() > 0) {
- ALOGD_IF(DEBUG_CONNECTIONS, "\t>>> actuating h/w setDelay %d %lld ", handle,
+ ALOGD_IF(DEBUG_CONNECTIONS, "\t>>> actuating h/w setDelay %d %" PRId64, handle,
info.bestBatchParams.batchDelay);
mSensorDevice->setDelay(
reinterpret_cast<struct sensors_poll_device_t *>(mSensorDevice),
@@ -231,7 +232,7 @@ status_t SensorDevice::batch(void* ident, int handle, int flags, int64_t samplin
}
ALOGD_IF(DEBUG_CONNECTIONS,
- "SensorDevice::batch: ident=%p, handle=0x%08x, flags=%d, period_ns=%lld timeout=%lld",
+ "SensorDevice::batch: ident=%p, handle=0x%08x, flags=%d, period_ns=%" PRId64 " timeout=%" PRId64,
ident, handle, flags, samplingPeriodNs, maxBatchReportLatencyNs);
Mutex::Autolock _l(mLock);
@@ -250,7 +251,8 @@ status_t SensorDevice::batch(void* ident, int handle, int flags, int64_t samplin
info.selectBatchParams();
ALOGD_IF(DEBUG_CONNECTIONS,
- "\t>>> curr_period=%lld min_period=%lld curr_timeout=%lld min_timeout=%lld",
+ "\t>>> curr_period=%" PRId64 " min_period=%" PRId64
+ " curr_timeout=%" PRId64 " min_timeout=%" PRId64,
prevBestBatchParams.batchDelay, info.bestBatchParams.batchDelay,
prevBestBatchParams.batchTimeout, info.bestBatchParams.batchTimeout);
@@ -258,7 +260,7 @@ status_t SensorDevice::batch(void* ident, int handle, int flags, int64_t samplin
// If the min period or min timeout has changed since the last batch call, call batch.
if (prevBestBatchParams != info.bestBatchParams) {
if (halVersion >= SENSORS_DEVICE_API_VERSION_1_1) {
- ALOGD_IF(DEBUG_CONNECTIONS, "\t>>> actuating h/w BATCH %d %d %lld %lld ", handle,
+ ALOGD_IF(DEBUG_CONNECTIONS, "\t>>> actuating h/w BATCH %d %d %" PRId64 " %" PRId64, handle,
info.bestBatchParams.flags, info.bestBatchParams.batchDelay,
info.bestBatchParams.batchTimeout);
err = mSensorDevice->batch(mSensorDevice, handle, info.bestBatchParams.flags,
@@ -270,7 +272,8 @@ status_t SensorDevice::batch(void* ident, int handle, int flags, int64_t samplin
// call setDelay in SensorDevice::activate() method.
}
if (err != NO_ERROR) {
- ALOGE("sensor batch failed %p %d %d %lld %lld err=%s", mSensorDevice, handle,
+ ALOGE("sensor batch failed %p %d %d %" PRId64 " %" PRId64 " err=%s",
+ mSensorDevice, handle,
info.bestBatchParams.flags, info.bestBatchParams.batchDelay,
info.bestBatchParams.batchTimeout, strerror(-err));
info.removeBatchParamsForIdent(ident);
@@ -324,7 +327,7 @@ status_t SensorDevice::Info::setBatchParamsForIdent(void* ident, int flags,
int64_t maxBatchReportLatencyNs) {
ssize_t index = batchParams.indexOfKey(ident);
if (index < 0) {
- ALOGE("Info::setBatchParamsForIdent(ident=%p, period_ns=%lld timeout=%lld) failed (%s)",
+ ALOGE("Info::setBatchParamsForIdent(ident=%p, period_ns=%" PRId64 " timeout=%" PRId64 ") failed (%s)",
ident, samplingPeriodNs, maxBatchReportLatencyNs, strerror(-index));
return BAD_INDEX;
}
diff --git a/services/sensorservice/SensorService.cpp b/services/sensorservice/SensorService.cpp
index 1bee04f..2f6a00b 100644
--- a/services/sensorservice/SensorService.cpp
+++ b/services/sensorservice/SensorService.cpp
@@ -378,7 +378,7 @@ bool SensorService::threadLoop()
for (size_t j=0 ; j<activeVirtualSensorCount ; j++) {
if (count + k >= minBufferSize) {
ALOGE("buffer too small to hold all events: "
- "count=%u, k=%u, size=%u",
+ "count=%zd, k=%zu, size=%zu",
count, k, minBufferSize);
break;
}
@@ -522,11 +522,11 @@ void SensorService::cleanupConnection(SensorEventConnection* c)
Mutex::Autolock _l(mLock);
const wp<SensorEventConnection> connection(c);
size_t size = mActiveSensors.size();
- ALOGD_IF(DEBUG_CONNECTIONS, "%d active sensors", size);
+ ALOGD_IF(DEBUG_CONNECTIONS, "%zu active sensors", size);
for (size_t i=0 ; i<size ; ) {
int handle = mActiveSensors.keyAt(i);
if (c->hasSensor(handle)) {
- ALOGD_IF(DEBUG_CONNECTIONS, "%i: disabling handle=0x%08x", i, handle);
+ ALOGD_IF(DEBUG_CONNECTIONS, "%zu: disabling handle=0x%08x", i, handle);
SensorInterface* sensor = mSensorMap.valueFor( handle );
ALOGE_IF(!sensor, "mSensorMap[handle=0x%08x] is null!", handle);
if (sensor) {
@@ -534,9 +534,9 @@ void SensorService::cleanupConnection(SensorEventConnection* c)
}
}
SensorRecord* rec = mActiveSensors.valueAt(i);
- ALOGE_IF(!rec, "mActiveSensors[%d] is null (handle=0x%08x)!", i, handle);
+ ALOGE_IF(!rec, "mActiveSensors[%zu] is null (handle=0x%08x)!", i, handle);
ALOGD_IF(DEBUG_CONNECTIONS,
- "removing connection %p for sensor[%d].handle=0x%08x",
+ "removing connection %p for sensor[%zu].handle=0x%08x",
c, i, handle);
if (rec && rec->removeConnection(connection)) {
@@ -625,7 +625,7 @@ status_t SensorService::enable(const sp<SensorEventConnection>& connection,
samplingPeriodNs = minDelayNs;
}
- ALOGD_IF(DEBUG_CONNECTIONS, "Calling batch handle==%d flags=%d rate=%lld timeout== %lld",
+ ALOGD_IF(DEBUG_CONNECTIONS, "Calling batch handle==%d flags=%d rate=%" PRId64 " timeout== %" PRId64,
handle, reservedFlags, samplingPeriodNs, maxBatchReportLatencyNs);
status_t err = sensor->batch(connection.get(), handle, reservedFlags, samplingPeriodNs,