summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorAravind Akella <aakella@google.com>2014-07-25 18:04:57 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-07-24 15:37:54 +0000
commitc268068c55afaaa441fda903b1b84a5b5c8a0a01 (patch)
tree0d95a1dd42efb6f46afe49d8e4d5734ffe90ea0c /libs
parent2295687487a0f2cc3e77915d5b0fe794d3af4d20 (diff)
parent56ae42613c91f6a6fb0dc3f626daa24666fd18c2 (diff)
downloadframeworks_native-c268068c55afaaa441fda903b1b84a5b5c8a0a01.zip
frameworks_native-c268068c55afaaa441fda903b1b84a5b5c8a0a01.tar.gz
frameworks_native-c268068c55afaaa441fda903b1b84a5b5c8a0a01.tar.bz2
Merge "SensorService performance improvements." into lmp-dev
Diffstat (limited to 'libs')
-rw-r--r--libs/gui/BitTube.cpp5
-rw-r--r--libs/gui/ISensorEventConnection.cpp15
-rw-r--r--libs/gui/SensorEventQueue.cpp10
3 files changed, 15 insertions, 15 deletions
diff --git a/libs/gui/BitTube.cpp b/libs/gui/BitTube.cpp
index 0282834..3ed1f37 100644
--- a/libs/gui/BitTube.cpp
+++ b/libs/gui/BitTube.cpp
@@ -99,6 +99,11 @@ int BitTube::getFd() const
return mReceiveFd;
}
+int BitTube::getSendFd() const
+{
+ return mSendFd;
+}
+
ssize_t BitTube::write(void const* vaddr, size_t size)
{
ssize_t err, len;
diff --git a/libs/gui/ISensorEventConnection.cpp b/libs/gui/ISensorEventConnection.cpp
index 8f88141..28fcb53 100644
--- a/libs/gui/ISensorEventConnection.cpp
+++ b/libs/gui/ISensorEventConnection.cpp
@@ -34,8 +34,7 @@ enum {
GET_SENSOR_CHANNEL = IBinder::FIRST_CALL_TRANSACTION,
ENABLE_DISABLE,
SET_EVENT_RATE,
- FLUSH_SENSOR,
- DECREASE_WAKE_LOCK_REFCOUNT
+ FLUSH_SENSOR
};
class BpSensorEventConnection : public BpInterface<ISensorEventConnection>
@@ -84,13 +83,6 @@ public:
remote()->transact(FLUSH_SENSOR, data, &reply);
return reply.readInt32();
}
-
- virtual void decreaseWakeLockRefCount() {
- Parcel data, reply;
- data.writeInterfaceToken(ISensorEventConnection::getInterfaceDescriptor());
- remote()->transact(DECREASE_WAKE_LOCK_REFCOUNT, data, &reply, IBinder::FLAG_ONEWAY);
- return;
- }
};
IMPLEMENT_META_INTERFACE(SensorEventConnection, "android.gui.SensorEventConnection");
@@ -133,11 +125,6 @@ status_t BnSensorEventConnection::onTransact(
reply->writeInt32(result);
return NO_ERROR;
} break;
- case DECREASE_WAKE_LOCK_REFCOUNT: {
- CHECK_INTERFACE(ISensorEventConnection, data, reply);
- decreaseWakeLockRefCount();
- return NO_ERROR;
- } break;
}
return BBinder::onTransact(code, data, reply, flags);
}
diff --git a/libs/gui/SensorEventQueue.cpp b/libs/gui/SensorEventQueue.cpp
index c2eaf4e..842502d 100644
--- a/libs/gui/SensorEventQueue.cpp
+++ b/libs/gui/SensorEventQueue.cpp
@@ -18,6 +18,7 @@
#include <stdint.h>
#include <sys/types.h>
+#include <sys/socket.h>
#include <utils/Errors.h>
#include <utils/RefBase.h>
@@ -147,7 +148,14 @@ status_t SensorEventQueue::setEventRate(Sensor const* sensor, nsecs_t ns) const
void SensorEventQueue::sendAck(const ASensorEvent* events, int count) {
for (int i = 0; i < count; ++i) {
if (events[i].flags & WAKE_UP_SENSOR_EVENT_NEEDS_ACK) {
- mSensorEventConnection->decreaseWakeLockRefCount();
+ // Send just a byte of data to acknowledge for the wake up sensor events
+ // received
+ char buf = '1';
+ ssize_t size = ::send(mSensorChannel->getFd(), &buf, sizeof(buf),
+ MSG_DONTWAIT | MSG_NOSIGNAL);
+ if (size < 0) {
+ ALOGE("sendAck failure %d", size);
+ }
}
}
return;