Merge changes I4c26aea7,I79911434 into pi-dev
* changes: Check mOwnedByTransform to avoid DELSA on SPI Expose add/removeAddress for IpSecInterfaces
This commit is contained in:
committed by
Android (Google) Code Review
commit
4f1703787d
@@ -658,7 +658,8 @@ public final class IpSecManager {
|
|||||||
* @param address the local address for traffic inside the tunnel
|
* @param address the local address for traffic inside the tunnel
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public void addAddress(LinkAddress address) {
|
@SystemApi
|
||||||
|
public void addAddress(LinkAddress address) throws IOException {
|
||||||
try {
|
try {
|
||||||
mService.addAddressToTunnelInterface(mResourceId, address);
|
mService.addAddressToTunnelInterface(mResourceId, address);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
@@ -674,7 +675,8 @@ public final class IpSecManager {
|
|||||||
* @param address to be removed
|
* @param address to be removed
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public void removeAddress(LinkAddress address) {
|
@SystemApi
|
||||||
|
public void removeAddress(LinkAddress address) throws IOException {
|
||||||
try {
|
try {
|
||||||
mService.removeAddressFromTunnelInterface(mResourceId, address);
|
mService.removeAddressFromTunnelInterface(mResourceId, address);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
|
|||||||
@@ -676,10 +676,12 @@ public class IpSecService extends IIpSecService.Stub {
|
|||||||
@Override
|
@Override
|
||||||
public void freeUnderlyingResources() {
|
public void freeUnderlyingResources() {
|
||||||
try {
|
try {
|
||||||
|
if (!mOwnedByTransform) {
|
||||||
mSrvConfig
|
mSrvConfig
|
||||||
.getNetdInstance()
|
.getNetdInstance()
|
||||||
.ipSecDeleteSecurityAssociation(
|
.ipSecDeleteSecurityAssociation(
|
||||||
mResourceId, mSourceAddress, mDestinationAddress, mSpi, 0, 0);
|
mResourceId, mSourceAddress, mDestinationAddress, mSpi, 0, 0);
|
||||||
|
}
|
||||||
} catch (ServiceSpecificException | RemoteException e) {
|
} catch (ServiceSpecificException | RemoteException e) {
|
||||||
Log.e(TAG, "Failed to delete SPI reservation with ID: " + mResourceId, e);
|
Log.e(TAG, "Failed to delete SPI reservation with ID: " + mResourceId, e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user