VPN-7203 - Add a warning when not running with "unristricted" background usage permission#11169
VPN-7203 - Add a warning when not running with "unristricted" background usage permission#11169
Conversation
There was a problem hiding this comment.
I really don't like using the MZInformationCard with a mousearea for this, from a design perspective. Even with tap here I'm not sure it's discoverable, and I'm of the opinion we should keep the info cards read-only. If you want, I'm happy to build an optional button in the info card. Want me to work on that real quick?
If we went that route, I'd suggest the card say Allow Mozilla VPN to run in background to ensure VPN connection is maintained. combined with Allow background permissions for the button. Also, if this is something that will probably happen, I'd suggest we make this an error info card, or something even stronger.
I will never refuse an offer to help me on UI stuff! Please! |
thanks @mcleinman 🥳 |
| _buttonAction: function() { | ||
| MZSettings.hasDismissedBatteryOptimization = true | ||
| BatteryOptimizer.triggerBatteryOptimizationIntent() | ||
| } |
There was a problem hiding this comment.
once we set hasDismissedBatteryOptimization to true, the warning won't reappear, right? (e.g. if the user dismissed the system dialog)
There was a problem hiding this comment.
That is the idea :) - The intention is to give a hint, not to force them to enable this.
|
Why do we want to make this dismissable? If we're pretty confident this is going to hurt the VPN experience, why not leave it there? (This also covers the case where someone taps the button, goes to system page, gets a text or something and goes to deal with it, but then forgets to come back to giving the system permission.) |
mcleinman
left a comment
There was a problem hiding this comment.
Approved, but with the prior comment that we may not want to make this dismissable. That said, won't block on that.
| id: batteryWarningText | ||
| Layout.fillWidth: true | ||
| text: MZI18n.SettingsBatteryOptimizationWarning | ||
| //verticalAlignment: Text.AlignVCenter |
My rationale would be that this actually can hurt your battery lifetime,(i.e keep the deamon alive longer when not connected) and depending on the manufaturer it might not even be needed. I.e my google pixel i never even had to do this and i have weeks of background connectivity. |
So I understand - the issue is that sometimes this causes the VPN to be closed in the background, but sometimes it does nothing harmful at all? And we're trying to find messaging that lets folks know that? If so, perhaps the message should be adjusted to "...in some situations, this causes the VPN to be disconnected. If this is something you've experienced, consider changing this setting..."? (There isn't a way we can track if the daemon has been closed by the OS, right?) |
Wouldn't this be too long for the text box? 😅
There is ApplicationExitInfo - theoretically we could check whether the last exit was not clean and take that as a signal, but then again we'd need to be trusting the manufacturer works per-spec (and does not just simulate a swipe-kill) - where if it would be this would all not be needed as we have the |
Doesn't look like it (that ellipses at the end was how I wrote it):
That seems not worth it. But maybe a slightly longer explanation? |
This patch picks up PR #10897 - and wires up android batteryOptimization status to QML Co-authored-by: im7mortal <5336231+im7mortal@users.noreply.github.com>
Co-authored-by: Francesco Lodolo <flod@lodolo.net>


This adds a warning if the User is running the App not in "unrestricted" background usage mode. - Clicking it will force a system prompt. We will show this warning only until interacted with it once, so users can dismis it.
screen-20260331-190155-1774976507904.mp4