Merge "Disconnect VPN when the underlying network is lost" am: f55958fcfd am: a03e3f9a75
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2222603 Change-Id: I3bd7d6de0e0825bc1a595418b597458ded626e6f Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -3210,10 +3210,7 @@ public class Vpn {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mSession != null && mMobikeEnabled) {
|
Log.d(TAG, "Schedule a delay handleSessionLost for losing network "
|
||||||
Log.d(
|
|
||||||
TAG,
|
|
||||||
"IKE Session has mobility. Delay handleSessionLost for losing network "
|
|
||||||
+ network
|
+ network
|
||||||
+ " on session with token "
|
+ " on session with token "
|
||||||
+ mCurrentToken);
|
+ mCurrentToken);
|
||||||
@@ -3226,7 +3223,16 @@ public class Vpn {
|
|||||||
mExecutor.schedule(
|
mExecutor.schedule(
|
||||||
() -> {
|
() -> {
|
||||||
if (isActiveToken(token)) {
|
if (isActiveToken(token)) {
|
||||||
handleSessionLost(null /* exception */, network);
|
handleSessionLost(new IkeNetworkLostException(network),
|
||||||
|
network);
|
||||||
|
|
||||||
|
synchronized (Vpn.this) {
|
||||||
|
// Ignore stale runner.
|
||||||
|
if (mVpnRunner != this) return;
|
||||||
|
|
||||||
|
updateState(DetailedState.DISCONNECTED,
|
||||||
|
"Network lost");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Log.d(
|
Log.d(
|
||||||
TAG,
|
TAG,
|
||||||
@@ -3241,10 +3247,7 @@ public class Vpn {
|
|||||||
},
|
},
|
||||||
NETWORK_LOST_TIMEOUT_MS,
|
NETWORK_LOST_TIMEOUT_MS,
|
||||||
TimeUnit.MILLISECONDS);
|
TimeUnit.MILLISECONDS);
|
||||||
} else {
|
|
||||||
Log.d(TAG, "Call handleSessionLost for losing network " + network);
|
|
||||||
handleSessionLost(null /* exception */, network);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void cancelHandleNetworkLostTimeout() {
|
private void cancelHandleNetworkLostTimeout() {
|
||||||
|
|||||||
Reference in New Issue
Block a user