Avoid triggering StrictMode when closing a socket.
Originally, we called getsockoptLinger unconditionally, using ENOTSOCK to recognize the non-socket case, but the cost of throwing an exception is so high (both on dalvik and art) that we worked around that by doing an fstat first. This was mostly fine, but fstat calls onReadFromDisk, which isn't true for the socket case (which causes upset for threads that are allowed to touch the network but not allowed to touch disk, which Chrome uses, even though it's not immediately obvious to me why that makes any sense). (cherry-pick of d636777d.) Bug: 4972558 Bug: 12133112 Change-Id: Ic0b89d1f181e436b4f43c1c04c1f706883ab84c0
Loading
Please sign in to comment