Skip to content

Commit

Permalink
VPN-6710 fix Android time (#10242)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcleinman authored Feb 3, 2025
1 parent 0dfdf15 commit a6d10d5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@ class VPNService : android.net.VpnService() {
set(value: Int) {
field = value
if (value > -1) {
mConnectionTime = System.currentTimeMillis()
if (!isAppChangingServers) {
// Don't reset the timer on a server switch
mConnectionTime = System.currentTimeMillis()
}
Log.i(tag, "Dispatch Daemon State -> connected")
mBinder.dispatchEvent(
CoreBinder.EVENTS.connected,
Expand Down
4 changes: 3 additions & 1 deletion src/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,9 @@ bool Controller::activate(const ServerData& serverData,
// https://github.com/mozilla-mobile/mozilla-vpn-client/pull/9639, and caused
// a bug on iOS where server switches stopped working. See more details in
// VPN-6495.
#ifndef MZ_IOS
// On Android, we need to skip this so that the client knows it is a
// server switch when appropriate.
#ifndef MZ_MOBILE
if (initiator != ExtensionUser) {
setState(StateConnecting);
}
Expand Down

0 comments on commit a6d10d5

Please sign in to comment.