Commit 1aea5662 authored by Yi Kong's avatar Yi Kong
Browse files

Move AbstractPlainDatagramSocketImpl#dataAvailable away from JNI

and remove clinit code, made possible from removing dependency on JNI.

IoBridge#available has two differences from raw ioctl. Firstly, if value
from ioctl is negative, it returns 0 instead of original value. This is
a safer behaviour since negative return is treated as error and zero
has no behavioural difference for DatagramSocket. Secondly, it does not
throw if errorno == ENOTTY, but socket fds always support FIONREAD. Thus
the code maintains original behaviour.

Bug: 28609551
Test: CtsLibcoreTestCases
Change-Id: Ib378c416f1e44b675490e8459f7c9f436ba8e62d
parent e9b3abc6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment