Skip to content

Commit 6b06e2a

Browse files
committed
Reuse VPN teardown for upgrade reset
1 parent 59dfa70 commit 6b06e2a

1 file changed

Lines changed: 1 addition & 15 deletions

File tree

android/app/src/main/kotlin/org/getlantern/lantern/service/LanternVpnService.kt

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -434,21 +434,7 @@ class LanternVpnService :
434434
if (!consumeUpgradeResetMarker()) return
435435

436436
AppLogger.i(TAG, "App APK updated; resetting VPN state before first tunnel start")
437-
closeTunInterface()
438-
runCatching {
439-
if (Mobile.isRadianceConnected()) {
440-
Mobile.stopVPN()
441-
AppLogger.d(TAG, "stopVPN completed for app-upgrade reset")
442-
} else {
443-
AppLogger.d(TAG, "Skipping app-upgrade stopVPN - Radiance IPC not running")
444-
}
445-
}.onFailure { e ->
446-
AppLogger.e(TAG, "stopVPN failed during app-upgrade reset", e)
447-
}
448-
449-
runCatching { DefaultNetworkMonitor.stop() }
450-
.onFailure { e -> AppLogger.e(TAG, "DefaultNetworkMonitor.stop() failed during app-upgrade reset", e) }
451-
437+
stopVPNTunnel()
452438
VpnStatusManager.postVPNStatus(VPNStatus.Disconnected)
453439
delay(UPGRADE_RESET_SETTLE_MS)
454440
}

0 commit comments

Comments
 (0)