diff options
author | Jeff Brown <jeffbrown@google.com> | 2013-04-04 22:45:12 -0700 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2013-04-04 22:45:12 -0700 |
commit | 1951ce86c21445ac191e4d2d95233f4f5c096b56 (patch) | |
tree | 8c68eb0fe87565bcdaf7cd8bd2a56a03319bede5 /include/androidfw | |
parent | 41c076715da58990dc9b0be749bba28fc75d3b78 (diff) | |
download | frameworks_base-1951ce86c21445ac191e4d2d95233f4f5c096b56.zip frameworks_base-1951ce86c21445ac191e4d2d95233f4f5c096b56.tar.gz frameworks_base-1951ce86c21445ac191e4d2d95233f4f5c096b56.tar.bz2 |
Correctly manage the lifecycle of IME InputChannels.
InputChannels are normally duplicated when sent to a remote process
over Binder but this does not happen if the recipient is running within
the system server process. This causes problems for KeyGuard because the
InputMethodManagerService may accidentally dispose the channel
that KeyGuard is using.
Fixed the lifecycle of InputChannels that are managed by the IME
framework. We now return a duplicate of the channel to the application
and then take care to dispose of the duplicate when necessary.
In particular, InputBindResult disposes its InputChannel automatically
when returned through Binder (using PARCELABLE_WRITE_RETURN_VALUE).
Bug: 8493879
Change-Id: I08ec3d13268c76f3b56706b4523508bcefa3be79
Diffstat (limited to 'include/androidfw')
-rw-r--r-- | include/androidfw/InputTransport.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/androidfw/InputTransport.h b/include/androidfw/InputTransport.h index 5706bce..8712995 100644 --- a/include/androidfw/InputTransport.h +++ b/include/androidfw/InputTransport.h @@ -168,6 +168,9 @@ public: */ status_t receiveMessage(InputMessage* msg); + /* Returns a new object that has a duplicate of this channel's fd. */ + sp<InputChannel> dup() const; + private: String8 mName; int mFd; |