Skip to content

Commit 91e3289

Browse files
author
Jeff Brown
committed
Clean up InputChannel file descriptor data type.
File descriptors are ints. Change-Id: Ie36733bf36ddfeaa9a09ef6ebd7bd2f1788f5d27
1 parent 58aedbc commit 91e3289

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

core/jni/android_view_InputChannel.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,9 @@ static void android_view_InputChannel_nativeReadFromParcel(JNIEnv* env, jobject
199199
bool isInitialized = parcel->readInt32();
200200
if (isInitialized) {
201201
String8 name = parcel->readString8();
202-
int32_t rawFd = parcel->readFileDescriptor();
203-
int32_t dupFd = dup(rawFd);
204-
if (rawFd < 0) {
202+
int rawFd = parcel->readFileDescriptor();
203+
int dupFd = dup(rawFd);
204+
if (dupFd < 0) {
205205
ALOGE("Error %d dup channel fd %d.", errno, rawFd);
206206
jniThrowRuntimeException(env,
207207
"Could not read input channel file descriptors from parcel.");

core/jni/android_view_InputEventReceiver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ NativeInputEventReceiver::~NativeInputEventReceiver() {
9393
}
9494

9595
status_t NativeInputEventReceiver::initialize() {
96-
int32_t receiveFd = mInputConsumer.getChannel()->getFd();
96+
int receiveFd = mInputConsumer.getChannel()->getFd();
9797
mLooper->addFd(receiveFd, 0, ALOOPER_EVENT_INPUT, handleReceiveCallback, this);
9898
return OK;
9999
}

include/ui/InputTransport.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class InputChannel : public RefBase {
123123
virtual ~InputChannel();
124124

125125
public:
126-
InputChannel(const String8& name, int32_t fd);
126+
InputChannel(const String8& name, int fd);
127127

128128
/* Creates a pair of input channels.
129129
*
@@ -133,7 +133,7 @@ class InputChannel : public RefBase {
133133
sp<InputChannel>& outServerChannel, sp<InputChannel>& outClientChannel);
134134

135135
inline String8 getName() const { return mName; }
136-
inline int32_t getFd() const { return mFd; }
136+
inline int getFd() const { return mFd; }
137137

138138
/* Sends a message to the other endpoint.
139139
*
@@ -162,7 +162,7 @@ class InputChannel : public RefBase {
162162

163163
private:
164164
String8 mName;
165-
int32_t mFd;
165+
int mFd;
166166
};
167167

168168
/*

services/input/InputDispatcher.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3105,7 +3105,7 @@ status_t InputDispatcher::registerInputChannel(const sp<InputChannel>& inputChan
31053105

31063106
sp<Connection> connection = new Connection(inputChannel, inputWindowHandle, monitor);
31073107

3108-
int32_t fd = inputChannel->getFd();
3108+
int fd = inputChannel->getFd();
31093109
mConnectionsByFd.add(fd, connection);
31103110

31113111
if (monitor) {

0 commit comments

Comments
 (0)