Commit Graph

609 Commits (release-branch/1.90)

Author SHA1 Message Date
kari-ts ebbc1b2f49
android: add logging to see what's spamming editPrefs (#586)
Updates tailscale/tailscale#14125

Signed-off-by: kari-ts <kari@tailscale.com>
12 months ago
kari-ts db6f9fe5c0
android: synchronize ipn state and UI (#585)
Pass in intended state to toggleVpn and keep track of progress to avoid redundant updates and ensure that the action taken reflects the user's intent.
This fixes a possible recomposition loop caused by the ipn state and the vpn toggle state getting out of sync.

Updates tailscale/tailscale#14125

Signed-off-by: kari-ts <kari@tailscale.com>
12 months ago
kari-ts 45ddef1a90
android: add SearchView (#584)
-Material3 search bar opens up search suggestions/results view under the bar, but we want it to open up a full page, so create SearchView and use placeholder search bar on MainView that navigates to SearchView
-Tapping on suggestions/results should open up PeerDetails, so fix PeerDetails navigation to use backstack instead of always going back to Main view

Next up: ensuring search filtering adheres to MDM requirements, and UI polish

Updates tailscale/corp#18973

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
kari-ts bbe3270c51
android: hide allow LAN access if feature not enabled (#583)
excludeRoute is only supported on API 33+, so we are not supporting allow LAN access for older versions. To avoid confusion, don't show the option if the feature is not enabled.

Updates tailscale/corp#25083

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
Jonathan Nobels 205aeaed86
android: omit excludedRoutes for API<33 (#582)
updates tailscale/corp#25083

excludedRoutes is only supported on API 33 and up so
it needs a version check.

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
1 year ago
kari-ts e29cfc5411
android: fix android TV focus requester crash (#580)
Properly attach FocusRequester to the root column of TaildropView so that there is a focusable UI element available to receive the focus

Fixes tailscale/corp#25007

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
kari-ts 38abb03168
android: specify whether or not receivers are exported (#579)
Per https://developer.android.com/about/versions/14/behavior-changes-14#runtime-receivers-exported, we need to register all receivers.

Fixes tailscale/corp#25021

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
kari-ts f96b6328df
android: emphasize hex code in TV login (#578)
Add a rounded box around the hex code and emphasize the code with font/styling

Updates tailscale/corp#24837

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
Keli 7857f81f9f
android: update hex input code instructions for TV log in (#576)
Updates the login UI to provide the input code location in the admin console.

Fixes tailscale/corp#24837

Signed-off-by: Keli Velazquez <keli@tailscale.com>
1 year ago
Jonathan Nobels f35b3f9274
android: move node search to background and fix avatar padding (#574)
android: use background search and fix avatar padding

fixes tailscale/corp#24847
fixes tailsacle/corp#24848

Search jobs are moved to the default dispatcher so they
do not block the UI thread.

The avatar boxing is now used only conditionally on AndroidTV.

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
1 year ago
Andrea Gottardo fda3820582
HealthNotifier: prevent and drop all warnings in the Stopped state (#575)
Updates tailscale/tailscale#12960

When the client is Stopped after running, a false positive DERP warnings was getting presented. This was not happening on Apple platforms because we never leave the client in a Stopped state, the extension instantly terminates. Since that's not the case on Android, this PR ensures that:

- we do not present any warnings when the client is Stopped (nothing should be broken when nothing is running)
- if we enter the Stopped state, any pre-existing warnings generated while the client was running are dropped

Signed-off-by: Andrea Gottardo <andrea@gottardo.me>
1 year ago
Andrea Gottardo 61c7c3c8c1
HealthNotifier: fix dependent messages handling (#573)
Fixes tailscale/corp#24582

Android port of tailscale/corp#24719. We were not clearing dependency warnings when a new warning was added which was listed as a dependency of a pre-existing warning. For instance, if `dns-read-os-config-failed` is added to the warnings before `network-status` is added, we were ignoring the dependency by not removing `dns-read-os-config-failed` upon adding `network-status`. This PR addresses that.

Signed-off-by: Andrea Gottardo <andrea@gottardo.me>
1 year ago
kari-ts 0fe76a7d46
android: synchronize Notifier app initialization (#568)
@Synchronize Notifier.setApp and Notifier.start to make sure that app isn't being accessed while being set.

Updates tailscale/corp#24694

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
Nick Khyl d512aeffd1
mdm: update MDMSettings (and syspolicy) when application restrictions change (#571)
In this PR, we update the Android app to register a broadcast receiver that listens
for android.content.Intent.ACTION_APPLICATION_RESTRICTIONS_CHANGED
and updates MDMSettings whenever a change occurs. This, in turn, notifies the
Go backend and causes it to reload syspolicy, ensuring it reflects the updated
MDM settings.

Updates tailscale/tailscale#12687

Signed-off-by: Nick Khyl <nickk@tailscale.com>
1 year ago
Brad Fitzpatrick 463c70df2a android: modify proguard rules to not mangle Tailscale app symbols
Updates tailscale/tailscale#14162

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
1 year ago
kari-ts 788bb1dbcd
android: handle null query results in ShareActivity (#567)
If contentResolver.query returns null, or the URI is invalid, skip processing and log instead of crashing.
Also, use 'use' for the cursor instead of 'let' to automatically close the cursor after processing.

Fixes tailscale/corp#24293

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
kari-ts c56420bbc1
android: lazily init app in Client (#563)
-Lazily init app in Client to ensure that we aren't trying to make any local API calls before app has been initialized.
-Add @Volatile to ensure that isInitialized is always visible across threads and uses the updated value

Updates tailscale/tailscale#14125

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
kari-ts ed8a1b3573
android: initialize appInstance early (#561)
Also log if get() is still being accessed before onCreate initializes appInstance so we can understand if this is still happening.
Also remove a debug log that I forgot to delete.

Updates tailscale/tailscale#14125

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
kari-ts ca2d161535
android: exclude Adaptive Connectivity Services (#569)
Default to excluding Adaptive Connectivity Services to fix issue where it is erroneously classifying wifi as broken

Fixes tailscale/tailscale#14128

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
Jonathan Nobels a10c4ef9da
android/notifier: add ipn bus rate limit flag (#562)
updates corp#24553

Adds the new flag to rate limit netmap updates on the
ipnBus to one per 3 second interval.

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
1 year ago
kari-ts 08a062bfcf
android: show hex code for TV log in (#557)
Remove flag gating the display of a hex code for Android TV users, now that the change allowing hex code input in the admin console is merged.
Fixes tailscale/tailscale#13277

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
kari-ts 4c4148bd8e
android: fix issue where default avatar wasn't shown (#558)
Always render the default icon first so that if the profile picture is not loaded or has an issue, the default is shown.

Fixes tailscale/corp#24217

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
kari-ts 18ca09d0f3
android: fix MainActivityTest (#550)
-Permissions are shown after 'Get Started' screen, fix ordering in test
-Tap 'Authorize Tailscale'
-Re-add instrumentation test runner in build.gradle

Updates tailscale/corp#24242

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
kari-ts bd745b5254
android: fix avatar padding (#559)
Update Avatar to take isFocusable as a parameter, allowing us to make the avatar focusable in the main view but not in the settings / user switcher view. This fixes the issue where the padding is too big in the settings / user switcher view.

Fixes tailscale/corp#24370

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
kari-ts ba306bf883
android: use a coroutine for loadfiles (#551)
contentResolver.query is attempting to perform a network query on the main thread. Move this to a coroutine to prevent blocking.

Fixes tailscale/corp#24293

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
Andrea Gottardo c1ef8b5f20
android: bump OSS to 1.77.65-t698536947-ge7325f7d5 (#552)
android: bump OSS

OSS and Version updated to 1.77.65-t698536947-ge7325f7d5

Signed-off-by: Andrea Gottardo <andrea@gottardo.me>
1 year ago
James Tucker e7325f7d5f Makefile,*: use tailscale.com/cmd/mkversion
We've suffered misalignment in versioning and toolchain usage due to the
shell invocations downstream of ./version/tailscale-version.sh, but also
the whole version data scheme in the Makefile was quite complicated, and
required synchronization in the build.grade.

- Makfile no longer needs to be version aware itself.
- A Makefile target tailscale.version refreshes a local cached output
  from tailscale.com/cmd/mkversion which is updated when go.mod / go.sum
  change.
- build.gradle loads tailscale.version to get the version string.
- ldflags are produced from tailscale.version via version-ldflags.sh

Updates tailscale/tailscale#13850

Signed-off-by: James Tucker <james@tailscale.com>
1 year ago
kari-ts c7b1362451
android: use native search (#547)
-Add dynamic suggestions
-Use search bar with expanded view showing suggestions
-dpad: only open keyboard when clicked on and not on scroll

Updates tailscale/corp#18973
Fixes tailscale/corp#19231

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
kari-ts 0bd4ef932b
android: bump OSS (#549)
OSS and Version updated to 1.77.44-tc0a1ed86c-gcafb114ae0a

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
kari-ts cafb114ae0
android: don't show permissions for TV (#548)
Android TV has limited support for notifications compared to mobile - notifications are not show in the system UI to provide a leanback experience. Remove 'Permissions' from Settings menu.

Fixes tailscale/corp/#21034

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
kari-ts af98b14770
android: hide disconnect action if force enabled (#539)
In notification, don't show 'Disconnect' button if MDM force enable is on.

Fixes tailscale/corp#23764

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
kari-ts 354a903ee1
android: make tailnet lock setup view focusable and clickable (#544)
-use a shared InteractionSource for focusing and clicking to ensure they rely on the same state and to coordinate so that visual feedback is shown on scroll without affecting the click InteractionSource
-use LocalIndication to ensure that the click interaction maintains the visual feedback when combined with focusable
-use onFocusChanged to explicitly track the focus state

Updates tailscale/corp#21737

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
kari-ts 6ec54234ef
android: fix avatar focusable (#538)
-Apply focusable() directly to outer Box instead of nested with clickable()
-Explicitly handle focus
-Simplify focusable area

Fixes tailscale/corp/#23762

Signed-off-by: kari-ts <kari@tailscale.com>
Signed-off-by: kari-ts <135075563+kari-ts@users.noreply.github.com>
1 year ago
kari-ts 83f3f737ad
android: bump OSS (#542)
OSS and Version updated to 1.77.12-ta8f9c0d6e-g753b8d3fb4b

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
kari-ts 753b8d3fb4
android: handle multiple redundant intents (#541)
Use FLAG_UPDATE_CURRENT for managing multiple calls to startForegroundService. This ensures only one instance of the intent is active and replaces any previously pending intents with the latest one.

Fixes tailscale/corp#23828

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
Jonathan Nobels 8ff0672ec7
android: bumping OSS (#540)
OSS and Version updated to 1.77.0-tacb4a22dc-g5f19730c7a4

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
1 year ago
Andrea Gottardo 47cde89984
android: update dependencies (#535)
Updates #cleanup

Bumps our project dependencies to the latest versions. Verified that the project builds properly.

Signed-off-by: Andrea Gottardo <andrea@gottardo.me>
1 year ago
Keli 5f19730c7a
android: bumping OSS (#537)
OSS and Version updated to 1.75.104-tf6d4d0335-gd309f31b5ab

Signed-off-by: Keli Velazquez <keli@tailscale.com>
1 year ago
kari-ts d309f31b5a
android: don't show hex code yet (#536)
Hold off on showing the code until there is a place in the admin console for the user to input the code.

Updates tailscale/tailscale#13277

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
Andrea Gottardo cd993fee43
ui: hide commit hashes in user-facing version string (#534)
We currently show the full version number everywhere. This pointlessly causes confusion for users, and is only really useful for Tailscale employees. Let's show the marketing version everywhere instead.

Users can still tap on the version number to copy the full version string. The extended version is also available in the Android settings, when inspecting Tailscale from the Apps list.

Signed-off-by: Andrea Gottardo <andrea@gottardo.me>
1 year ago
Keli a32c2aa0df
android: bumping OSS (#532)
OSS and Version updated to 1.75.81-t4ad3f0122-g0126db799b1

Signed-off-by: Keli Velazquez <keli@tailscale.com>
1 year ago
Andrea Gottardo 0126db799b
ui/model: adjust default control server URL (#531)
Updates tailscale/corp#23660

I screwed up by not including 'https://' in a last-minute refactoring :-)
1 year ago
Andrea Gottardo 4ca757bb75
android: bumping OSS to 1.75.80 (#530)
android: bumping OSS

OSS and Version updated to 1.75.80-t8fdffb8da-g2daeee584df

Signed-off-by: Andrea Gottardo <andrea@gottardo.me>
1 year ago
Andrea Gottardo 2daeee584d
ui/UserView: show custom control server URL in account switcher (#529) 1 year ago
kari-ts be89cb10fe
android: bumping OSS (#528)
OSS and Version updated to 1.75.58-t262c526c4-gf5ecca3c967

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
kari-ts f5ecca3c96
android: StringArrayListMDMSetting should check for String[] (#527)
getFromBundle should check for both String[] and ArrayList<String>

Fixes tailscale/corp#23557

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
Kristoffer Dalby 8eabe8d6dd
android: bumping OSS (#526)
android: bumping OSS

OSS and Version updated to 1.75.56-t1eaad7d3d-g625f6f02352

Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
1 year ago
kari-ts 9572541648
android: bumping OSS (#524)
OSS and Version updated to 1.75.51-ta70287d32-gc10aca720b8

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
kari-ts c10aca720b
android: don't set vpnService to nil when state is Stopped (#523)
We are currently setting vpnService.service to nil:
-any time there’s an error with updateTUN
-when we exit out of runBackend
-if the config is the default config (aka when the ipn state is Stopped)

When it gets set to nil, we don’t handle state or config updates by calling updateTUN until after startVPN is called again.
The second case never happens because there’s no condition to break out of the loop in runBackend and ctx is uncancelable per the doc for context.Background()
In the third case, we should not establish the VPN; the state is already in the correct Stopped state, but there’s no need to set the service to nil and prevent updateTUN from being called. The quick settings tile bug is caused by this third case, where because the saved prefs starts the app up in the Stopped state, the config is set to the default config, and the service is set to nil, and we can't updateTUN until there’s another startVPN call.

This PR:
-cleans up the updateTUN error handling to be more consistent
-removes the IPNService parameter from updateTUN so that vpnService.service is not set to nil in the third case
-updates IPNService to use stopSelf and not stopForeground when we disconnect the VPN; the latter only disconnects if there is a memory need

Fixes tailscale/tailscale#12489

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
kari-ts 25e7681c32
android: set VPN status in service APIs (#522)
This is mainly a no-op; right now we are setting the VPN status when we successfully edit prefs with wantRunning=false, but the VPN status is separate from tailscaled status and reflects the status of the VPN interface. This change moves that status update into the Android Service APIs.

Updates tailscale/tailscale#12850
Updates tailscale/tailscale#12489

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
Jonathan Nobels f8f2ee029a
android: fix all linter warnings and treat warnings as errors (#521)
#Updates tailscale/corp#22284

Fixes and/or explicitly suppresses all linter warnings and
we will now fail the build if new warnings are introduced.

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
1 year ago
kari-ts 08ae018468
android: send Android logs to logz (#515)
TSLog sends log messages to Android's logcat and Tailscale's logger
Libtailscale wrapper is a Kotlin wrapper that allows us to get around the problems with mocking a native library

Fixes tailscale/corp#23191

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
kari-ts 9731afd44c
android: use PackageManager to determine install AppSourceChecker (#517)
We were using MaybeGoogle to determine whether the app was installed from the Play Store, but this has not worked since the refactor.
Fixes tailscale/tailscale#13442
Updates tailscale/corp#23283

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
kari-ts 9654bb5d9d
android: include hex in LoginQRView (#502)
Updates tailscale/tailscale#13277

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
kari-ts 2ec7304092
android: use onSuccess parameter in setWantRunning (#516)
Previously we were never actually invoking this parameter
We previously weren't setting vpnActive after closing IPNService

Updates tailscale/corp#22284

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
kari-ts 22de0cdb7e
android: make custom url check case-insensitive (#513)
Fixes tailscale/corp#23210

Signed-off-by: kari-ts <kari@tailscale.com>
Co-authored-by: Jonathan Nobels <jnobels@gmail.com>
1 year ago
Jonathan Nobels 0b2a04b475
android: bump OSS to 1.75.11 (#512)
android: bumping OSS

OSS and Version updated to 1.75.11-t8b962f23d-gf07d419a125

The toolchain hash is being incorrectly by bumpOSS.
Reverting it back to the correct value for 1.74/1.75

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
1 year ago
kari-ts 9987dbc592
android: only update DNS configs on LinkProperties changes (#511)
We were updating DNS configs when capabilities changed, without LinkProperties having been filled in. Because onAvailable always happened first, LinkProperties were created with default value, and onCapabilitiesChanged sent a DNS update using those LinkProperties.
This change only updates DNS configs on LinkProperties, which is the last update sent on a network change.

Updates tailscale/tailscale#13173

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
kari-ts 8b91b0ff0a
android: bumping OSS (#510)
OSS and Version updated to 1.75.6-tf572286bf-g2fcb080aa67

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
Andrea Gottardo 001e79546c
android: bump OSS to 1.75.3 + update toolchain (#501)
OSS and Version updated to 1.75.3-tafec2d41b-gffbc556cde8

Signed-off-by: Andrea Gottardo <andrea@gottardo.me>
1 year ago
Andrea Gottardo ffbc556cde
android: bumping OSS to 1.75.2 (#500)
OSS and Version updated to 1.75.2-t93f61aa4c-ge195def5e23

Signed-off-by: Andrea Gottardo <andrea@gottardo.me>
1 year ago
Andrew Dunham aaecc62e1c android: rework NetworkChangeCallback to track all networks
Instead of just tracking our default network, track all of them and
decide upon each change which is the "best" option.

Updates tailscale/tailscale#13173

Signed-off-by: Andrew Dunham <andrew@du.nham.ca>
1 year ago
kari-ts 28712da8d0
android: fix BuildConfig infinite loop (#495)
Rather than create a Go struct that is set by Android, have Go call into Android to fetch build BuildConfig
Updates tailscale/tailscale#13431

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
Andrew Dunham 45567146f4 android, libtailscale: pass BuildConfig to Go code; use for DNS config
This commit wires up a method to allow the Tailscale Go backend to
obtain the build configuration, and then adds a new build configuration
to the build to control whether we fall back to the Google public DNS
servers if we can't determine the platform's DNS configuration.

This replaces the previous "IsPlayVersion" / "MaybeGoogle" check for
whether to use the DNS servers as fallbacks, to allow users to decide
this independently of what version of the Android app this is.

Updates tailscale/tailscale#13431

Signed-off-by: Andrew Dunham <andrew@du.nham.ca>
1 year ago
kari-ts 283e1ebcd8
android: fix network callback race (#493)
ConnectivityManager doesn't make guarantees about the order of network updates. Only use network updates for currently active network.
Also, use registerDefaultNetworkCallback so that we are only listening for default networks.

Updates tailscale/tailscale#13173

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
Jonathan Nobels 9f87446ab6
android: bumping OSS to 1.73.114 (#492)
OSS Updated to 1.73.114
Version 1.73.114-t0970615b1-gab7ab737364

updates #cleanup

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
1 year ago
Jonathan Nobels ab7ab73736
android: fix versioning and bump oss (#490)
* android: update docker image names for go 1.23

updates #cleanup

We need to regenerate the docker images, we'll
denote the new ones with a go1.23 extension.

This also sets the TS_USE_TOOLCHAIN flag so
we're using the corp toolchain which fixes some
versioning script issues.

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>

* android: bumping OSS

OSS and Version updated to 1.73.104-te7b5e8c8c-g161457b99b5

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>

---------

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
1 year ago
Anton Tolchanov 095dae1195 android: exclude MDM classes from ProGuard optimizations
Updates tailscale/corp#22797

Signed-off-by: Anton Tolchanov <anton@tailscale.com>
1 year ago
Andrea Gottardo 19581721cf
android: bump OSS to 1.73.73, use Go 1.23 (#485)
Updates #cleanup

OSS and Version updated to 1.73.73

Signed-off-by: Andrea Gottardo <andrea@gottardo.me>
1 year ago
kari-ts 18e4b176c6
android: fix missing '}' issue (#487)
also run linter

Updates #cleanup

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
kari-ts 77eaadb360
android: fix missing imports (#486)
android: make clipboard values clickable and focusable

also, use Column isntead of LazyColumn since the Tailnet lock view is a short list and doesn't require lazy rendering

Fixes tailscale/corp#21737

Signed-off-by: kari-ts <kari@tailscale.com>
Signed-off-by: kari-ts <135075563+kari-ts@users.noreply.github.com>
1 year ago
yin kaisheng a9ff204ae4
android: fix Hostname type in MaskedPrefs, it should be String type (#482) 1 year ago
kari-ts b4ca226eb7
android: make clipboard values clickable and focusable (#483)
also, use Column isntead of LazyColumn since the Tailnet lock view is a short list and doesn't require lazy rendering

Fixes tailscale/corp#21737

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
kari-ts d94125e767
android: make settings button focusable and clickable (#484)
Fixes tailscale/corp#22717

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
kari-ts eae8789628
android: move string into correct place (#481)
Move MDM auth key strings into the MDM strings blcok

Updates #cleanup

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
kari-ts 29e3c187c2
android: stop tailscaled when VPN has been revoked (#480)
-add new Ipn UI state 'Stopping' to handle the case where the VPN is no longer active and a request to stop Tailscale has been issued (but is not complete yet) and use for optimistic UI
-when VPN has been revoked, stop tailscaled and set the state to Stopping
-this fixes the race condition where when we tell tailscaled to stop, stopping races against the netmap state updating as a result of the VPN being revoked
-add isActive state and use instead of isPrepared for UI showing whether we are connected - we were previously using isPrepared as a proxy for connection, but sometimes the VPN has been prepared but is not active (eg when VPN permissions have been given and VPN has been connected previously, but has been revoked)
-refactor network callbacks into its own class for readability

Fixes tailscale/tailscale#12850

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
Josh Vocal 40090f179b
android: Fix search not filtering machines from input (#478)
android: Fix search not filtering text input

Fixes tailscale/tailscale#13218

* Filtering machines in the textfield works since the flow is now reachable
* Updating the health icon works since the flow is now reachable

Signed-off-by: Josh Vocal <joshvocal@gmail.com>
1 year ago
Josh Vocal cdbd062426
android: Add Voicemail apps to Android Split Tunneling settings by de… (#479)
android: Add Voicemail apps to Android Split Tunneling settings by default

Updates tailscale/tailscale#13199

Signed-off-by: Josh Vocal <joshvocal@gmail.com>
1 year ago
Josh Vocal 26e5e796fa
android: Allow notification dismissed via swipe on Android 13 (#477)
Allow notification dismissed via swipe on Android 13

Signed-off-by: Josh Vocal <joshvocal@gmail.com>
1 year ago
Andrea Gottardo 8648c2ef27
mdm: add AuthKey piping (#476)
Updates tailscale/tailscale#1572

This PR defines the AuthKey system policy in the Android codebase, allowing the code in OSS (see tailscale/tailscale#13061) to pick up any value defined by an MDM solution via managed app configuration. It also adds the new key to the `app_restrictions.xml`.

OSS and Version updated to 1.73.13-taf3d3c433-g536e1adcc42

Signed-off-by: Andrea Gottardo <andrea@gottardo.me>
1 year ago
kari-ts 1a41ab3b66
android: check if other VPN is active (#475)
Detect when another VPN is active and launch dialog giving user the option to navigate to settings to disable.
Update state string and toggle to require successful VPN preparation

To do in a follow-up: monitor VPN connection, and if Tailscale VPN disconnects due to another VPN connecting, update toggle and text
Updates tailscale/tailscale#12850

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
kari-ts 10a4350c02
android: prepare VPN when quick tile is clicked (#473)
Currently, the VPN is prepared when MainActivity is launched. If Tailscale is enabled by a quick tile, the VPN is not prepared.
This change creates an application scoped view model and moves the VPN prep to the application class so that it is not dependent on MainActivity.

Fixes tailscale/tailscale#12489

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
Andrea Gottardo 4830d8826e
android: fix paddings and headers of Taildrop destination picker (#465)
Updates tailscale/corp#22362

First round of polish for the Taildrop device picker, to use more consistent metrics and SectionDivider resembling the rest of the app. We'll follow up with device icons like the ones we have on iOS in a later PR.

Signed-off-by: Andrea Gottardo <andrea@gottardo.me>
1 year ago
Jonathan Nobels 20a5beab3e
android: bump OSS (#472)
OSS and Version updated to 1.73.0-t1e8f8ee5f-ga843c93669f

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
1 year ago
Andrea Gottardo a843c93669
Revert "VPNServiceBuilder: document excludeRoute not supported on pre-33 API" (#471) 1 year ago
kari-ts fcfb997fde
Revert "android: prepare VPN when quick tile is clicked" (#470)
Revert "android: prepare VPN when quick tile is clicked (#451)"

This reverts commit c6f3239b1b.
1 year ago
kari-ts c6f3239b1b
android: prepare VPN when quick tile is clicked (#451)
Currently, the VPN is prepared when MainActivity is launched. If Tailscale is enabled by a quick tile, the VPN is not prepared.
This change creates an application scoped view model and moves the VPN prep to the application class so that it is not dependent on MainActivity.

Fixes tailscale/tailscale#12489

Signed-off-by: kari-ts <kari@tailscale.com>
1 year ago
Jonathan Nobels e6fc832494
android: bumping OSS (#469)
OSS and Version updated to 1.71.135-tccf091e4a-g7e5e0f25cf6

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
1 year ago
Andrea Gottardo 7e5e0f25cf
VPNServiceBuilder: document excludeRoute not supported on pre-33 API (#467)
VPNServiceBuilder: document excludeRoute not supported on pre-33 API level

Updates #cleanup
Updates tailscale/tailscale#13106

Our code in VPNServiceBuilder attempts to call excludeRoute regardless of API level. However, it requires a device on Android API level 33 or newer. Let's document and log this while we plan a proper workaround.

Signed-off-by: Andrea Gottardo <andrea@gottardo.me>
1 year ago
Percy Wegmann c1b957cc5f taildrop: use a random filename if real filename cannot be determined
Also pull in latest oss to avoid crashing if sharing fails.

Updates tailscale/corp#22357

Signed-off-by: Percy Wegmann <percy@tailscale.com>
1 year ago
Andrea Gottardo 338c13b6b5
android: add HealthView (#458)
Updates tailscale/tailscale#4136

This PR adds a proper health warnings viewer for the Android client, like we already do on iOS and macOS. A subtile info.circle or exclamation mark icon is displayed next to the connection status when one or more warnings are found. A detail view provides visibility into the full list.

Signed-off-by: Andrea Gottardo <andrea@gottardo.me>
1 year ago
Andrea Gottardo 403aa092c4
android: bumping OSS (#463)
OSS and Version updated to 1.71.72-t1ed958fe2-g2a32ed1f301

Signed-off-by: Andrea Gottardo <andrea@gottardo.me>
1 year ago
Nick Khyl 2a32ed1f30
libtailscale, mdm: allow syspolicy to subscribe to policy change notifications (#462)
In preparation for upcoming syspolicy improvements, we'd like to allow subscriptions
to policy change notifications via the syspolicyHandler.RegisterChangeCallback.
The registered callbacks are invoked whenever MDMSettings.update is called.

Updates tailscale/tailscale#12687

Signed-off-by: Nick Khyl <nickk@tailscale.com>
1 year ago
Nick Khyl 8767fbd8d8
mdm: improve handling and returning of not configured policy settings (#461)
We should distinguish between unconfigured policy settings and those configured with the default values.
In the first case, the syspolicyHandler should return syspolicy.ErrNoSuchKey instead of the default value,
while in the latter case, it should return the actual setting value, even if that value happens to be the default
value such as "user-decides". This distinction should also be reflected in the "Current MDM settings" view.

In this PR, we update MDMSetting.flow to hold both the value to be used by the app and a flag indicating
whether the policy setting is configured or not. If the policy setting is not configured, the value is the default
value for the setting type. We then use this new flag to decide whether to throw a NoSuchKeyException from
the Kotlin-side of the syspolicyHandler implementation and how to display the policy setting in the
"Current MDM settings" view.

Additionally, we update the MDMSettings.update and MDMSetting.setFrom methods to avoid calling
app.getEncryptedPrefs (and reading/decrypting the prefs) for every defined MDM setting.

Updates tailscale/tailscale#12687

Signed-off-by: Nick Khyl <nickk@tailscale.com>
1 year ago
Nick Khyl 946afb6c33 libtailscale, android: translate NoSuchKeyException as syspolicy.ErrNoSuchKey
Currently, NoSuchKeyException gets translated by gomobile to a Go error with "no such key" as the text.
It is imperative for syspolicy.Handler implementations to return syspolicy.ErrNoSuchKey if a policy setting
is not configured, so this PR adds translation for errors that do not already wrap syspolicy.ErrNoSuchKey,
but have "no such key" as the text.

Updates tailscale/tailscale#12687

Signed-off-by: Nick Khyl <nickk@tailscale.com>
1 year ago
Nick Khyl 101c9dd121 mdm: return values rather than the constant names for the setting enums
We stringify setting values with toString before returning them from the syspolicyHandler.
For enum setting types, such as AlwaysNeverUserDecides and ShowHide, the default toString
implementation returns the enum constant names, such as Always and UserDecides. However,
the Go backend requires us to return "always", "never", and "user-decides" values, exactly, and
falls back to the default value (e.g., "user-decides") if it receives anything else from the app.

This PR overrides the toString methods on both enums to return the required values rather than
the constant names.

Updates tailscale/tailscale#12687

Signed-off-by: Nick Khyl <nickk@tailscale.com>
1 year ago
Andrea Gottardo ea0c1e960d
android: remove Google Stadia from hardcoded exclusions list (#457) 1 year ago
Jonathan Nobels cb916676a4
android: bumping OSS (#455)
OSS and Version updated to 1.71.22-t855da4777-g32e48dc78e7

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
1 year ago
Jonathan Nobels 23454e9bc6
android: bump oss and version code (#452)
Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
1 year ago
Andrea Gottardo 1465b2a67f
ui: add Mullvad info view (#450)
Updates tailscale/tailscale#9421

Adds a view to highlight Mullvad support when it is not enabled.

Signed-off-by: Andrea Gottardo <andrea@gottardo.me>
1 year ago