OSDN Git Service

Rework Exception Handling for IpSecManager
authorNathan Harold <nharold@google.com>
Tue, 3 Apr 2018 23:13:19 +0000 (16:13 -0700)
committerNathan Harold <nharold@google.com>
Fri, 8 Jun 2018 01:42:52 +0000 (18:42 -0700)
commit144ce0a2485b061b4ae9090b2b9f558e6e3d0e04
tree62f03d461907508f347fe00c56e5dc4abd5afa2c
parentfdda5697d7ccc61b5692a8b2e5116afcb4921c09
Rework Exception Handling for IpSecManager

In order to properly support EOPNOTSUPP this CL
applies a consistent approach to handling Exceptions.
Hereafter, all exceptions that aren't of a special
method-specific type (such as SpiUnavailableException)
will all be returned to the calling process unchanged.
At the API call site, the ServiceSpecificException,
which is really an Errno, will be inspected and either
converted to an unchecked exception for types we know,
or it will be converted to an IOException in cases where
that method can return a checked exception. In cases
where we do not expect an errno, we will simply throw
a generic RuntimeException. This means all API calls
will now properly throw UnsupportedOperationException
and may be CTS tested accordingly.

Bug: 72420898
Test: runtest frameworks-net
Merged-In: I4a00e221618896223fcdb4b4279fb14cd14e34d8
Change-Id: I4a00e221618896223fcdb4b4279fb14cd14e34d8
(cherry picked from commit ddeb90aa9db108d4a2e5aadc778a726b65e5c921)
core/java/android/net/IpSecManager.java
core/java/android/net/IpSecTransform.java
services/core/java/com/android/server/IpSecService.java