-
Notifications
You must be signed in to change notification settings - Fork 451
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
android: fix Quick Settings tailscale #358
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
agottardo
reviewed
Apr 30, 2024
android/src/main/java/com/tailscale/ipn/ui/notifier/Notifier.kt
Outdated
Show resolved
Hide resolved
I confirmed that this fixes the issue I had with inconsistent state of the quick settings tile after restarting Tailscale. |
barnstar
approved these changes
May 1, 2024
agottardo
approved these changes
May 1, 2024
-Get rid of unused stopVPN() function -Get rid of unused ACTION_STOP_VPN intent handling; this is redundant with DISCONNECT_VPN intent -Tile active state should only depend on ipn state, and not the results of editing the prefs with wantRunning set. It should be active iff ipn.State > Stopped Fixes tailscale/tailscale#11920 Signed-off-by: kari-ts <kari@tailscale.com>
kari-ts
added a commit
that referenced
this pull request
May 8, 2024
#358 updated the Quick Settings tile to only depend on ipn state. This was only partially correct in the sense that we made changes to only check for whether the state was > stopped and not whether Tailscale was on. This checks for two states, whether Tailscale is on, and whether the tile is ready to be used. The former requires ipn state to be >= Starting, and the latter checks whether ipn state is > RequiresMachineAuth. Tile readiness determines whether an intent is to open MainActivity or whether an intent to connect/disconnect VPN is sent. Whether Tailscale is on or off determines whether the tile status is active or not. Updates tailscale/tailscale#11920 Signed-off-by: kari-ts <kari@tailscale.com>
kari-ts
added a commit
that referenced
this pull request
May 8, 2024
#358 updated the Quick Settings tile to only depend on ipn state. This was only partially correct in the sense that we made changes to only check for whether the state was > stopped and not whether Tailscale was on. This checks for two states, whether Tailscale is on, and whether the tile is ready to be used. The former requires ipn state to be >= Starting, and the latter checks whether ipn state is > RequiresMachineAuth. Tile readiness determines whether an intent is to open MainActivity or whether an intent to connect/disconnect VPN is sent. Whether Tailscale is on or off determines whether the tile status is active or not. Updates tailscale/tailscale#11920 Signed-off-by: kari-ts <kari@tailscale.com>
oxtoacart
pushed a commit
that referenced
this pull request
May 9, 2024
#358 updated the Quick Settings tile to only depend on ipn state. This was only partially correct in the sense that we made changes to only check for whether the state was > stopped and not whether Tailscale was on. This checks for two states, whether Tailscale is on, and whether the tile is ready to be used. The former requires ipn state to be >= Starting, and the latter checks whether ipn state is > RequiresMachineAuth. Tile readiness determines whether an intent is to open MainActivity or whether an intent to connect/disconnect VPN is sent. Whether Tailscale is on or off determines whether the tile status is active or not. Updates tailscale/tailscale#11920 Signed-off-by: kari-ts <kari@tailscale.com>
kari-ts
added a commit
that referenced
this pull request
May 9, 2024
#358 updated the Quick Settings tile to only depend on ipn state. This was only partially correct in the sense that we made changes to only check for whether the state was > stopped and not whether Tailscale was on. This checks for two states, whether Tailscale is on, and whether the tile is ready to be used. The former requires ipn state to be >= Starting, and the latter checks whether ipn state is > RequiresMachineAuth. Tile readiness determines whether an intent is to open MainActivity or whether an intent to connect/disconnect VPN is sent. Whether Tailscale is on or off determines whether the tile status is active or not. We also correct states shown on QuickSettings and persistent notification. We lazily initialize App to avoid starting Tailscale when unnecessary - for example, when viewing the QuickSettings tile, there's no need to start Tailscale's backend. Persistently store flag indicating whether VPN can be started by quick settings tile. This allows us to start the VPN from the quick settings tile even when the application was previously stopped. Updates tailscale/tailscale#11920
kari-ts
added a commit
that referenced
this pull request
May 9, 2024
#358 updated the Quick Settings tile to only depend on ipn state. This was only partially correct in the sense that we made changes to only check for whether the state was > stopped and not whether Tailscale was on. This checks for two states, whether Tailscale is on, and whether the tile is ready to be used. The former requires ipn state to be >= Starting, and the latter checks whether ipn state is > RequiresMachineAuth. Tile readiness determines whether an intent is to open MainActivity or whether an intent to connect/disconnect VPN is sent. Whether Tailscale is on or off determines whether the tile status is active or not. We also correct states shown on QuickSettings and persistent notification. We lazily initialize App to avoid starting Tailscale when unnecessary - for example, when viewing the QuickSettings tile, there's no need to start Tailscale's backend. Persistently store flag indicating whether VPN can be started by quick settings tile. This allows us to start the VPN from the quick settings tile even when the application was previously stopped. Updates tailscale/tailscale#11920
kari-ts
added a commit
that referenced
this pull request
May 9, 2024
#358 updated the Quick Settings tile to only depend on ipn state. This was only partially correct in the sense that we made changes to only check for whether the state was > stopped and not whether Tailscale was on. This checks for two states, whether Tailscale is on, and whether the tile is ready to be used. The former requires ipn state to be >= Starting, and the latter checks whether ipn state is > RequiresMachineAuth. Tile readiness determines whether an intent is to open MainActivity or whether an intent to connect/disconnect VPN is sent. Whether Tailscale is on or off determines whether the tile status is active or not. We lazily initialize App to avoid starting Tailscale when unnecessary - for example, when viewing the QuickSettings tile, there's no need to start Tailscale's backend. We also persistently store a flag indicating whether VPN can be started by quick settings tile: this allows us to start the VPN from the quick settings tile even when the application was previously stopped. Updates tailscale/tailscale#11920 Co-authored-by: kari-ts Co-authored-by: oxtoacart
kari-ts
added a commit
that referenced
this pull request
May 9, 2024
#358 updated the Quick Settings tile to only depend on ipn state. This was only partially correct in the sense that we made changes to only check for whether the state was > stopped and not whether Tailscale was on. This checks for two states, whether Tailscale is on, and whether the tile is ready to be used. The former requires ipn state to be >= Starting, and the latter checks whether ipn state is > RequiresMachineAuth. Tile readiness determines whether an intent is to open MainActivity or whether an intent to connect/disconnect VPN is sent. Whether Tailscale is on or off determines whether the tile status is active or not. We lazily initialize App to avoid starting Tailscale when unnecessary - for example, when viewing the QuickSettings tile, there's no need to start Tailscale's backend. We also persistently store a flag indicating whether VPN can be started by quick settings tile: this allows us to start the VPN from the quick settings tile even when the application was previously stopped. Updates tailscale/tailscale#11920 Co-authored-by: kari-ts <kari@tailscale.com> Co-authored-by: Percy Wegmann <percy@tailscale.com>
oxtoacart
added a commit
that referenced
this pull request
May 10, 2024
#358 updated the Quick Settings tile to only depend on ipn state. This was only partially correct in the sense that we made changes to only check for whether the state was > stopped and not whether Tailscale was on. This checks for two states, whether Tailscale is on, and whether the tile is ready to be used. The former requires ipn state to be >= Starting, and the latter checks whether ipn state is > RequiresMachineAuth. Tile readiness determines whether an intent is to open MainActivity or whether an intent to connect/disconnect VPN is sent. Whether Tailscale is on or off determines whether the tile status is active or not. We lazily initialize App to avoid starting Tailscale when unnecessary - for example, when viewing the QuickSettings tile, there's no need to start Tailscale's backend. We also persistently store a flag indicating whether VPN can be started by quick settings tile: this allows us to start the VPN from the quick settings tile even when the application was previously stopped. Updates tailscale/tailscale#11920 Co-authored-by: kari-ts <kari@tailscale.com> Co-authored-by: Percy Wegmann <percy@tailscale.com>
kari-ts
added a commit
that referenced
this pull request
May 10, 2024
* android: fix quick settings tile #358 updated the Quick Settings tile to only depend on ipn state. This was only partially correct in the sense that we made changes to only check for whether the state was > stopped and not whether Tailscale was on. This checks for two states, whether Tailscale is on, and whether the tile is ready to be used. The former requires ipn state to be >= Starting, and the latter checks whether ipn state is > RequiresMachineAuth. Tile readiness determines whether an intent is to open MainActivity or whether an intent to connect/disconnect VPN is sent. Whether Tailscale is on or off determines whether the tile status is active or not. We lazily initialize App to avoid starting Tailscale when unnecessary - for example, when viewing the QuickSettings tile, there's no need to start Tailscale's backend. We also persistently store a flag indicating whether VPN can be started by quick settings tile: this allows us to start the VPN from the quick settings tile even when the application was previously stopped. Updates tailscale/tailscale#11920 Co-authored-by: kari-ts <kari@tailscale.com> Co-authored-by: Percy Wegmann <percy@tailscale.com> * android: simplify IPNService lifecycle Reserves use of IPNReceiver only for external requests to start the VPN. Updates tailscale/corp#19860 Signed-off-by: Percy Wegmann <percy@tailscale.com> * Revert "android: temporarily remove quick settings tile" This reverts commit edb3f5b. Signed-off-by: Percy Wegmann <percy@tailscale.com> --------- Signed-off-by: Percy Wegmann <percy@tailscale.com> Co-authored-by: Percy Wegmann <percy@tailscale.com>
agottardo
pushed a commit
that referenced
this pull request
May 13, 2024
* android: fix quick settings tile #358 updated the Quick Settings tile to only depend on ipn state. This was only partially correct in the sense that we made changes to only check for whether the state was > stopped and not whether Tailscale was on. This checks for two states, whether Tailscale is on, and whether the tile is ready to be used. The former requires ipn state to be >= Starting, and the latter checks whether ipn state is > RequiresMachineAuth. Tile readiness determines whether an intent is to open MainActivity or whether an intent to connect/disconnect VPN is sent. Whether Tailscale is on or off determines whether the tile status is active or not. We lazily initialize App to avoid starting Tailscale when unnecessary - for example, when viewing the QuickSettings tile, there's no need to start Tailscale's backend. We also persistently store a flag indicating whether VPN can be started by quick settings tile: this allows us to start the VPN from the quick settings tile even when the application was previously stopped. Updates tailscale/tailscale#11920 Co-authored-by: kari-ts <kari@tailscale.com> Co-authored-by: Percy Wegmann <percy@tailscale.com> * android: simplify IPNService lifecycle Reserves use of IPNReceiver only for external requests to start the VPN. Updates tailscale/corp#19860 Signed-off-by: Percy Wegmann <percy@tailscale.com> * Revert "android: temporarily remove quick settings tile" This reverts commit edb3f5b. Signed-off-by: Percy Wegmann <percy@tailscale.com> --------- Signed-off-by: Percy Wegmann <percy@tailscale.com> Co-authored-by: Percy Wegmann <percy@tailscale.com> (cherry picked from commit f684bf6)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
-Get rid of unused stopVPN() function
-Get rid of unused ACTION_STOP_VPN intent handling; this is redundant with DISCONNECT_VPN intent -Tile active state should only depend on ipn state, and not the results of editing the prefs with wantRunning set. It should be active iff ipn.State > Stopped
Fixes tailscale/tailscale#11920