VPN: Explicitly handle IAE from updating underlying network

IpSecTunnelInterface#setUnderlyingNetwork will throw IAE when the
underlying network is not functional and has null LinkProperties.
This commit updates IKEv2 VPN to explicitly handle this exception.

Bug: 240112879
Test: VpnTest, VpnManagerTest, VpnManagerServiceTest, Ikev2VpnTest
Change-Id: I962ee07a5b0e38a07653c25349e41ae47623e7f6
This commit is contained in:
Yan Yan
2023-06-27 23:27:53 +00:00
parent 232000e8b8
commit 2152d88a16

View File

@@ -3343,7 +3343,7 @@ public class Vpn {
// Transforms do not need to be persisted; the IkeSession will keep
// them alive for us
mIpSecManager.applyTunnelModeTransform(mTunnelIface, direction, transform);
} catch (IOException e) {
} catch (IOException | IllegalArgumentException e) {
Log.d(TAG, "Transform application failed for token " + token, e);
onSessionLost(token, e);
}
@@ -3437,7 +3437,7 @@ public class Vpn {
mTunnelIface, IpSecManager.DIRECTION_IN, inTransform);
mIpSecManager.applyTunnelModeTransform(
mTunnelIface, IpSecManager.DIRECTION_OUT, outTransform);
} catch (IOException e) {
} catch (IOException | IllegalArgumentException e) {
Log.d(TAG, "Transform application failed for token " + token, e);
onSessionLost(token, e);
}