OSDN Git Service

Prevent Closure of Underlying Socket FDs
authorNathan Harold <nharold@google.com>
Tue, 16 Jan 2018 20:08:43 +0000 (12:08 -0800)
committerNathan Harold <nharold@google.com>
Wed, 17 Jan 2018 05:30:20 +0000 (21:30 -0800)
commitb548d251b7995a5b76e495978b61ad6c3c4183d1
tree42d9ce03555cb955193ab442881247260ded89a6
parent5676f5fdae9a3aee8cf2cecef7502bfcc3bf49cb
Prevent Closure of Underlying Socket FDs

The version of applyTransportModeTransform() and
removeTransportModeTransform() that accepted
Socket and DatagramSocket were closing the underlying
FDs upon return. It's unclear whether this is due to
a behavior change elsewhere in ParcelFileDescriptor,
but either way, converting to using getFileDescriptor$
and then calling dup() explicitly rather than relying
on ParcelFileDescriptor seems like a better idea anyway.

Bug: 72047396
Test: CTS - IpSecManagerTest.testCreateTransform()
Change-Id: Ia2f02564e1289f25bf113dbb861fcfd2240537a7
core/java/android/net/IpSecManager.java