Remove active connection tracking.
The dispatcher no longer needs to track which connections are
active except perhaps for diagnostic purposes, so we might as well
remove this code.
This is part of a series of changes to improve input system pipelining.
Bug: 5963420
Change-Id: Ibadc830b7b792a59b9244d0a6e85f320c4947109
diff --git a/services/input/InputDispatcher.cpp b/services/input/InputDispatcher.cpp
index 5811f2e..85bfac4 100644
--- a/services/input/InputDispatcher.cpp
+++ b/services/input/InputDispatcher.cpp
@@ -1737,7 +1737,6 @@
// If the outbound queue was previously empty, start the dispatch cycle going.
if (wasEmpty && !connection->outboundQueue.isEmpty()) {
- activateConnectionLocked(connection.get());
startDispatchCycleLocked(currentTime, connection);
}
}
@@ -1975,9 +1974,6 @@
return;
}
}
-
- // Outbound queue is empty, deactivate the connection.
- deactivateConnectionLocked(connection.get());
}
void InputDispatcher::abortBrokenDispatchCycleLocked(nsecs_t currentTime,
@@ -2010,8 +2006,6 @@
}
delete dispatchEntry;
}
-
- deactivateConnectionLocked(connection);
}
int InputDispatcher::handleReceiveCallback(int fd, int events, void* data) {
@@ -3045,20 +3039,6 @@
dump.appendFormat(INDENT "InboundQueue: length=%u\n", mInboundQueue.count());
- if (!mActiveConnections.isEmpty()) {
- dump.append(INDENT "ActiveConnections:\n");
- for (size_t i = 0; i < mActiveConnections.size(); i++) {
- const Connection* connection = mActiveConnections[i];
- dump.appendFormat(INDENT2 "%d: '%s', status=%s, outboundQueueLength=%u, "
- "inputState.isNeutral=%s\n",
- i, connection->getInputChannelName(), connection->getStatusLabel(),
- connection->outboundQueue.count(),
- toString(connection->inputState.isNeutral()));
- }
- } else {
- dump.append(INDENT "ActiveConnections: <none>\n");
- }
-
if (isAppSwitchPendingLocked()) {
dump.appendFormat(INDENT "AppSwitch: pending, due in %01.1fms\n",
(mAppSwitchDueTime - now()) / 1000000.0);
@@ -3167,24 +3147,6 @@
return -1;
}
-void InputDispatcher::activateConnectionLocked(Connection* connection) {
- for (size_t i = 0; i < mActiveConnections.size(); i++) {
- if (mActiveConnections.itemAt(i) == connection) {
- return;
- }
- }
- mActiveConnections.add(connection);
-}
-
-void InputDispatcher::deactivateConnectionLocked(Connection* connection) {
- for (size_t i = 0; i < mActiveConnections.size(); i++) {
- if (mActiveConnections.itemAt(i) == connection) {
- mActiveConnections.removeAt(i);
- return;
- }
- }
-}
-
void InputDispatcher::onDispatchCycleStartedLocked(
nsecs_t currentTime, const sp<Connection>& connection) {
}
diff --git a/services/input/InputDispatcher.h b/services/input/InputDispatcher.h
index 6d9dc47..5b7f95e 100644
--- a/services/input/InputDispatcher.h
+++ b/services/input/InputDispatcher.h
@@ -864,12 +864,6 @@
ssize_t getConnectionIndexLocked(const sp<InputChannel>& inputChannel);
- // Active connections are connections that have a non-empty outbound queue.
- // We don't use a ref-counted pointer here because we explicitly abort connections
- // during unregistration which causes the connection's outbound queue to be cleared
- // and the connection itself to be deactivated.
- Vector<Connection*> mActiveConnections;
-
// Input channels that will receive a copy of all input events.
Vector<sp<InputChannel> > mMonitoringChannels;