Enable sensor data injection mode through adb.
Change-Id: I415cf8ff0871fa74babaf9b879c68f210298b472
(cherry picked from commit 841a5926fc9b3f9f0e654ba3aab8e43bea7de7f1)
diff --git a/libs/gui/ISensorServer.cpp b/libs/gui/ISensorServer.cpp
index 5dde9f9..f581b5c 100644
--- a/libs/gui/ISensorServer.cpp
+++ b/libs/gui/ISensorServer.cpp
@@ -77,10 +77,9 @@
return interface_cast<ISensorEventConnection>(reply.readStrongBinder());
}
- virtual status_t enableDataInjection(int enable) {
+ virtual int isDataInjectionEnabled() {
Parcel data, reply;
data.writeInterfaceToken(ISensorServer::getInterfaceDescriptor());
- data.writeInt32(enable);
remote()->transact(ENABLE_DATA_INJECTION, data, &reply);
return reply.readInt32();
}
@@ -121,8 +120,7 @@
}
case ENABLE_DATA_INJECTION: {
CHECK_INTERFACE(ISensorServer, data, reply);
- int32_t enable = data.readInt32();
- status_t ret = enableDataInjection(enable);
+ int32_t ret = isDataInjectionEnabled();
reply->writeInt32(static_cast<int32_t>(ret));
return NO_ERROR;
}