Commit Graph

2 Commits (4a79eda41056bbacd768e9dff5fb979803cf7bb7)

Author SHA1 Message Date
Jonathan Nobels 4a79eda410 android/ui: switch lateinint app instance to optional
updates tailscale/corp#12430

The app instance is set in onCreate, but this has a chance to race
with the intent handlers throwing a null pointer exception.

This should ultimately be corrected in the API interface on the caller side, on but
that fix runs deep and still requires care on the part of the caller.  This will,
at least, error out gracefully rather than crashing the application process at the
expense of an action potentially failing.

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
2 years ago
Fred Silberberg 864cc35bd4
android/ui: implement USE_EXIT_NODE intent (#142)
Fixes tailscale/tailscale#8143. 

Map friendly labels from intent extras to tailscale node IDs, with empty string or not specifying the exitNode intent extra as the "no exit node" action. When an error is encountered, we will push a notification with a friendly message to the status notification channel. The tasker syntax I tested with locally is:

Action: `com.tailscale.ipn.USE_EXIT_NODE`
Package: `com.tailscale.ipn`
Class: `com.tailscale.ipn.IPNReceiver`
Target: Broadcast Receiver
Extra: `exitNode:exitNodeLabelOrEmpty`
Extra: `allowLanAccess:trueOrFalse`

Signed-off-by: Fredric Silberberg <fred@silberberg.xyz>

* Extract constant strings to resources for later localization.

Signed-off-by: Fredric Silberberg <fred@silberberg.xyz>

---------

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