diff options
author | Mathias Agopian <mathias@google.com> | 2012-08-12 19:37:16 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2012-08-13 02:46:05 -0700 |
commit | 8683fca395d01734ec7946e9f0595ec5d7b754c6 (patch) | |
tree | fe3f6b92245be46902760c129e395c94589b9895 /libs/gui/ISensorServer.cpp | |
parent | e57f292595bec48f65c8088b00ff6beea01217e9 (diff) | |
download | frameworks_native-8683fca395d01734ec7946e9f0595ec5d7b754c6.zip frameworks_native-8683fca395d01734ec7946e9f0595ec5d7b754c6.tar.gz frameworks_native-8683fca395d01734ec7946e9f0595ec5d7b754c6.tar.bz2 |
improve [un]marshalling of non-binder objects
this change introduces a new class LightFlattenable<> which is
a protocol to flatten simple objects that don't require
binders or file descriptors; the benefit of this protocol is that
it doesn't require the objects to have a virtual table and give us
a consitant way of doing this.
we also introduce an implementation of this protocol for
POD structures, LightFlattenablePod<>.
Parcel has been update to handle this protocol automatically.
Sensor, Rect, Point and Region now use this new protocol.
Change-Id: Icb3ce7fa1d785249eb666f39c2129f2fc143ea4a
Diffstat (limited to 'libs/gui/ISensorServer.cpp')
-rw-r--r-- | libs/gui/ISensorServer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/gui/ISensorServer.cpp b/libs/gui/ISensorServer.cpp index 7111092..0b76f37 100644 --- a/libs/gui/ISensorServer.cpp +++ b/libs/gui/ISensorServer.cpp @@ -55,7 +55,7 @@ public: int32_t n = reply.readInt32(); v.setCapacity(n); while (n--) { - reply.read(static_cast<Flattenable&>(s)); + reply.read(s); v.add(s); } return v; @@ -84,7 +84,7 @@ status_t BnSensorServer::onTransact( size_t n = v.size(); reply->writeInt32(n); for (size_t i=0 ; i<n ; i++) { - reply->write(static_cast<const Flattenable&>(v[i])); + reply->write(v[i]); } return NO_ERROR; } break; |