Commit Graph

588 Commits (1ec621c382307cd87cca7b277b9d79fd7120d44b)

Author SHA1 Message Date
kari-ts 1ec621c382
android: make currentDir reactive (#661)
-The composables were reading the currentDir value once and not observing it. This fixes it so that we recompose when the StateFlow changes.
-Use commit() instead of apply() when writing to EncryptedSharedPreferences since we are reading from it immediately and need the writes to happen synchronously
-Remove unused function in PermissionsViewModel

Fixes tailscale/corp#29283

Signed-off-by: kari-ts <kari@tailscale.com>
6 months ago
kari-ts 87f0e9754b
android: allow users to update taildrop directory (#658)
-Modify Permissions view to navigate to Taildrop dir view and Notifications view, and to reflect state
-Add Taildrop dir view which navigates to directory selector
-Add Notifications view which navigates to Taildrop notifications setting

Updates tailscale/tailscale#15263

Signed-off-by: kari-ts <kari@tailscale.com>
6 months ago
Jonathan Nobels a14d4c7184
android: add explanatory dialog for taildrop directory selection (#657)
fixes tailscale/corp#29067

Adds an interstitial explaining that the user needs to select/create
a taildrop target directory on startup.

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
6 months ago
Jonathan Nobels 88a5d3c140
android: modify mullvad exit node detection logic (#656)
updates tailscale/corp#29045

We ran into an issue where the current detection logic was not
sufficient to filter out mullvad nodes.  This modifies the logic so we
scan both the Name and ComputedName for the mullvad domain and
also treat all nodes with location info as mullvad nodes.  While all
of these conditions *should* be true for any mullvad node, in practice
it's possible that they aren't so we or them together for some redundancy
and define a mullvad exit node to be any node where any of these
conditions is true.

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
6 months ago
kari-ts bd5191363c
android: use SAF for storing Taildropped files (#632)
Use Android Storage Access Framework for receiving Taildropped files.

-Add a picker to allow users to select where Taildropped files go
-If no directory is selected, internal app storage is used
-Provide SAF API for Go to use when writing and renaming files
-Provide Android FileOps implementation

Updates tailscale/tailscale#15263

Signed-off-by: kari-ts <kari@tailscale.com>
7 months ago
kari-ts d5988faf9a
android: add IME action to trigger custom CustomLogin (#649)
Updates tailscale/tailscale#14864

Signed-off-by: kari-ts <kari@tailscale.com>
7 months ago
kari-ts 81ff898782
android: replace broadcast intent with service intent (#650)
We were previously calling startService(intent), which is a direct call consumed by IPNService, but restartVPN was not working as intended because the broadcast receiver was never triggered.
Rather than use a broadcast receiver, directly start the service in restartVPN as we do in stopVPN. Also, batch changes to excluded apps so that we don't restart the VPN each time the user toggles an app.

Fixes tailscale/corp#28668

Signed-off-by: kari-ts <kari@tailscale.com>
7 months ago
kari-ts e3c76eb812
android: fix isExitNode check (#646)
&& takes precedence over ?:, so fix isExitNode to check both IPv4 and IPv6

Updates tailscale/tailscale#15785

Signed-off-by: kari-ts <kari@tailscale.com>
7 months ago
kari-ts d3f34c579d
android: defer vpn permission until activity is resumed (#647)
Right now, we register the launcher in MainActivity.onCreate(), inject this into the ViewModel, then show the launcher in MainView.
There is no guarantee that the activity is in RESUMED when the Composable runs, showing the launcher. This can lead to a silent RESULT_CANCELED on some OEMs.
The fix is to add a lifecycle-aware wrapper that defers the launch.

Updates tailscale/tailscale#15419

Signed-off-by: kari-ts <kari@tailscale.com>
7 months ago
davfsa ca7dc5f8a8
android: ensure in secure state to interact with quicktile (#622)
* android: ensure in secure state to interact with quicktile

Updates tailscale/tailscale#14628

Signed-off-by: davfsa <davfsa@gmail.com>

* Update android/src/main/java/com/tailscale/ipn/QuickToggleService.java

Signed-off-by: davfsa <davfsa@gmail.com>

---------

Signed-off-by: davfsa <davfsa@gmail.com>
7 months ago
Jakub Meysner 8683c789fd
android/src/main: show exit node information in the permanent notification (#642)
* android/src: ktfmt

Signed-off-by: Jakub Meysner <git@jakubmeysner.com>

* android/src/main: show exit node information in the permanent notification

Displays exit node status (including the name of the exit node) in the permanent connection notification's content (moving the overall connected/disconnected status to the title).

Fixes tailscale/tailscale#14438

Signed-off-by: Jakub Meysner <git@jakubmeysner.com>

* docker: fix invalid instruction in Dockerfile not using trailing slash for files destination directory

> If the source is a file, and the destination doesn't end with a trailing slash, the source file will be written to the destination path as a file.
~ https://docs.docker.com/reference/dockerfile/#destination

Signed-off-by: Jakub Meysner <git@jakubmeysner.com>

---------

Signed-off-by: Jakub Meysner <git@jakubmeysner.com>
7 months ago
kari-ts ff4a49a076
android: fix IllegalStateException in navigation (#643)
Update to androidx.navigation 2.8.5: this fixes the NavHost exception per https://developer.android.com/jetpack/androidx/releases/navigation#2.8.5

Fixes tailscale/tailscale#15755

Signed-off-by: kari-ts <kari@tailscale.com>
8 months ago
sakuram 79cd12a159 android: fix typo in comment
Signed-off-by: sakuram <trge241@gmail.com>
8 months ago
kari-ts 0888b3c248
android: add missing import (#629)
Updates tailscale/corp#27375

Signed-off-by: kari-ts <kari@tailscale.com>
8 months ago
kari-ts 9652dbc6e4
android: only use new search for API 33+ (#627)
disable search for Android TV running < API 33

Updates tailscale/corp#27375

Signed-off-by: kari-ts <kari@tailscale.com>
8 months ago
kari-ts 99712c14da
android: enable search for TV (#620)
Updates tailscale/corp#18973

Signed-off-by: kari-ts <kari@tailscale.com>
9 months ago
kari-ts 189de89466
android: check back stack before popping back (#618)
A possible cause for an IndexOutOfBounds exception is that when the intent is delivered, the back stack doesn't have enough entries for the operation. Condition popping back on if there is more than one entry in the back stack; otherwise, navigate directly to main to reset the back stack.

Updates tailscale/tailscale#15188

Signed-off-by: kari-ts <kari@tailscale.com>
9 months ago
kari-ts 10b2c61f5f
android: refine search (#611)
-improve transition
-clean up search input spacing to match other elements
-match search results page styling to machines page
-fix issue where search suggestions were propagating to main view
-flip new search flag On

Fixes tailscale/corp#18973

Signed-off-by: kari-ts <kari@tailscale.com>
9 months ago
Andrea Gottardo 8d55951fb2
android: bump OSS (#607)
Signed-off-by: Andrea Gottardo <andrea@gottardo.me>
10 months ago
Jonathan Nobels 817121e213
android/tv: remove avatar padding in userView (#606)
updates tailscale/corp#26199

Removes the avatar padding when the avatar is not focusable.

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
10 months ago
Jonathan Nobels 7f93377c2f
android/tv: fix focus highlighting on back buttons (#605)
updates tailscale/corp#26199

The back buttons would not highlight properly when
they are focussed on Android TV.  This pulls in what
was implemented for the Avatar.

Some small tweaks to the action animation so that it
has a nice radius instead of a square box.

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
10 months ago
Andrea Gottardo 56d7be331e
ui: display error dialog when saving subnet routes fails (#604)
Fixes tailscale/corp#26175

When setting subnet routing settings, for a variety of reasons the Tailscale backend may reject an entered value with a 400 error. Here we handle such errors in a user-facing fashion:

- We display an ErrorDialog with title 'Failed to save' and whatever error message the backend request returned. To do so, we introduce a new initializer for ErrorDialog that accepts a runtime-generated String instead of a fixed string resource.
- We ask the backend to provide an updated value of AdvertiseRoutes whenever the error dialog is dismissed by the user, and set it as the UI state, to ensure consistency between UI and backend upon a failed save.

Signed-off-by: Andrea Gottardo <andrea@gottardo.me>
10 months ago
Keli 0ed18a2b0a
android: fix typo in subnet menu (#603)
android: update typo in subnet menu
Updates a typo in the subnet router "add route" menu from "a IPv4" to "an IPv4"

Fixes tailscale/corp#26167

Signed-off-by: Keli Velazquez <keli@tailscale.com>
10 months ago
Andrea Gottardo 0f6059dfc0
android: bump OSS (#599)
Bump OSS to 20250117225247 and versionCode to 350

Signed-off-by: Andrea Gottardo <andrea@gottardo.me>
11 months ago
Andrea Gottardo 61895c47a1
mdm: define Hostname syspolicy on Android (#598)
Updates tailscale/corp#25936

Adds a definition for the Hostname syspolicy which we are adding in OSS: https://github.com/tailscale/tailscale/pull/14676

Also adds it to the app_restrictions.xml file so that MDM solutions can pick it up.

Signed-off-by: Andrea Gottardo <andrea@gottardo.me>
11 months ago
Andrea Gottardo 9c3378d7eb
ui: add ability to advertise Android device as subnet router (#595) 11 months ago
Jarne Demeulemeester a2850b1078
android: mark Quick Settings tile as toggleable (#594)
Signed-off-by: Jarne Demeulemeester <jarnedemeulemeester@gmail.com>
11 months ago
Andrea Gottardo b1bc451d76
android: bump OSS, set versionCode to 346 (#596)
OSS bumped to v1.79.116-t6364b5f1e-g34a06be19

Signed-off-by: Andrea Gottardo <andrea@gottardo.me>
11 months ago
kari-ts e500111fb9
android: put new search behind flag (#587)
Until the WIP feature is ready

Updates tailscale/corp#18973

Signed-off-by: kari-ts <kari@tailscale.com>
Signed-off-by: kari-ts <135075563+kari-ts@users.noreply.github.com>
12 months ago
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