summaryrefslogtreecommitdiffstats
path: root/libs/gui/ISensorServer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/gui/ISensorServer.cpp')
-rw-r--r--libs/gui/ISensorServer.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/libs/gui/ISensorServer.cpp b/libs/gui/ISensorServer.cpp
index 0b76f37..8e09e7c 100644
--- a/libs/gui/ISensorServer.cpp
+++ b/libs/gui/ISensorServer.cpp
@@ -45,6 +45,8 @@ public:
{
}
+ virtual ~BpSensorServer();
+
virtual Vector<Sensor> getSensorList()
{
Parcel data, reply;
@@ -52,7 +54,7 @@ public:
remote()->transact(GET_SENSOR_LIST, data, &reply);
Sensor s;
Vector<Sensor> v;
- int32_t n = reply.readInt32();
+ uint32_t n = reply.readUint32();
v.setCapacity(n);
while (n--) {
reply.read(s);
@@ -70,6 +72,10 @@ public:
}
};
+// Out-of-line virtual method definition to trigger vtable emission in this
+// translation unit (see clang warning -Wweak-vtables)
+BpSensorServer::~BpSensorServer() {}
+
IMPLEMENT_META_INTERFACE(SensorServer, "android.gui.SensorServer");
// ----------------------------------------------------------------------
@@ -82,18 +88,18 @@ status_t BnSensorServer::onTransact(
CHECK_INTERFACE(ISensorServer, data, reply);
Vector<Sensor> v(getSensorList());
size_t n = v.size();
- reply->writeInt32(n);
- for (size_t i=0 ; i<n ; i++) {
+ reply->writeUint32(static_cast<uint32_t>(n));
+ for (size_t i = 0; i < n; i++) {
reply->write(v[i]);
}
return NO_ERROR;
- } break;
+ }
case CREATE_SENSOR_EVENT_CONNECTION: {
CHECK_INTERFACE(ISensorServer, data, reply);
sp<ISensorEventConnection> connection(createSensorEventConnection());
- reply->writeStrongBinder(connection->asBinder());
+ reply->writeStrongBinder(IInterface::asBinder(connection));
return NO_ERROR;
- } break;
+ }
}
return BBinder::onTransact(code, data, reply, flags);
}