Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VPN-6629: Fix debug daemon timer on Android #9951

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

mcleinman
Copy link
Collaborator

Description

There is a debug setting for short session timers - sending pings every 3 minutes when a VPN session is active, rather than the typical every 3 hours.

History of this:

  • It was initially written as a lazy var, which caused a crash in some situations. (VPN-6629)
  • It was then updated to not be lazy, but that caused the value to always default to false - as the mConfig wasn't saved when the computed var was trying to use it. (VPN-5766 - Fix CountdownTimer generation timing #8555)

In this PR, I change the timer to use onTick for debug timer pings. I had initially tried to just move the timer setup work to right before the timer is started, as then we'd have mConfig already set. However, that requires being on a UI thread (it's a CountDownTimer thing). I'm confident there is a way to do this, but I'm not an expert on Android - and I spent a while testing stuff out to get this UI thread from a background daemon, getting nothing working. This alternative way of handling it should suffice, and tests okay for both the debug option being active and not active.

Reference

VPN-6629

Checklist

  • My code follows the style guidelines for this project
  • I have not added any packages that contain high risk or unknown licenses (GPL, LGPL, MPL, etc. consult with DevOps if in question)
  • I have performed a self review of my own code
  • I have commented my code PARTICULARLY in hard to understand areas
  • I have added thorough tests where needed

Copy link
Member

@lesleyjanenorton lesleyjanenorton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mcleinman mcleinman merged commit e776db6 into main Oct 14, 2024
114 checks passed
@mcleinman mcleinman deleted the vpn-6629-fix-short-daemon-timer-android branch October 14, 2024 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants