Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2152d88a authored by Yan Yan's avatar Yan Yan
Browse files

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
parent 232000e8
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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);
            }