Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 871c83b2 authored by Jeff Brown's avatar Jeff Brown Committed by Android Git Automerger
Browse files

am d1c48a05: Dispatch multiple touch events in parallel.

* commit 'd1c48a0525d05021036d4b14e937e221c0ae1318':
  Dispatch multiple touch events in parallel.
parents 7874296f cd50850d
Loading
Loading
Loading
Loading
+13 −0
Original line number Original line Diff line number Diff line
@@ -28,6 +28,13 @@


namespace android {
namespace android {


// Socket buffer size.  The default is typically about 128KB, which is much larger than
// we really need.  So we make it smaller.  It just needs to be big enough to hold
// a few dozen large multi-finger motion events in the case where an application gets
// behind processing touches.
static const size_t SOCKET_BUFFER_SIZE = 32 * 1024;


// --- InputMessage ---
// --- InputMessage ---


bool InputMessage::isValid(size_t actualSize) const {
bool InputMessage::isValid(size_t actualSize) const {
@@ -93,6 +100,12 @@ status_t InputChannel::openInputChannelPair(const String8& name,
        return result;
        return result;
    }
    }


    int bufferSize = SOCKET_BUFFER_SIZE;
    setsockopt(sockets[0], SOL_SOCKET, SO_SNDBUF, &bufferSize, sizeof(bufferSize));
    setsockopt(sockets[0], SOL_SOCKET, SO_RCVBUF, &bufferSize, sizeof(bufferSize));
    setsockopt(sockets[1], SOL_SOCKET, SO_SNDBUF, &bufferSize, sizeof(bufferSize));
    setsockopt(sockets[1], SOL_SOCKET, SO_RCVBUF, &bufferSize, sizeof(bufferSize));

    String8 serverChannelName = name;
    String8 serverChannelName = name;
    serverChannelName.append(" (server)");
    serverChannelName.append(" (server)");
    outServerChannel = new InputChannel(serverChannelName, sockets[0]);
    outServerChannel = new InputChannel(serverChannelName, sockets[0]);