Skip to content

Fix Android 11 notification action not clickable#793

Open
Pawloland wants to merge 1 commit into
tailscale:mainfrom
Pawloland:notification_fix
Open

Fix Android 11 notification action not clickable#793
Pawloland wants to merge 1 commit into
tailscale:mainfrom
Pawloland:notification_fix

Conversation

@Pawloland
Copy link
Copy Markdown
Contributor

Fix expedited WorkRequests by implementing getForegroundInfo() method for all Workers, thus fixing intent handling on Android 11 and older.

Fixes tailscale/tailscale#19772

… for all Workers, thus fixing intent handling on Android 11 and older

Fixes tailscale/tailscale#19772

Signed-off-by: Pawloland <59684145+Pawloland@users.noreply.github.com>
@Pawloland
Copy link
Copy Markdown
Contributor Author

I tested the intents with bellow adb commands. It works as expected on Android 11 now. I also added guards inside, so workers are triggered only when the actual state changes. Otherwise the temporary notification which is always sent by the system on older Androids, when expedited worker request is run, would replace the normal status notification, the one with the connect/disconnect button. Since the state would not change, the rerender of the default notification would not be triggered, but the temporary one would be, and it would be shown until the VPN is connected again, triggering the change in prefs and rerender of the default notification. This fixed the issue which made it apparent to me - non clickable connect/disconnect button in the notification, but it fundamentally fixes intent handling on older APIs, so 3rd party apps integrations on those.

#enable VPN
adb shell am broadcast -a com.tailscale.ipn.CONNECT_VPN -n com.tailscale.ipn/com.tailscale.ipn.IPNReceiver

#disable VPN
adb shell am broadcast -a com.tailscale.ipn.DISCONNECT_VPN -n com.tailscale.ipn/com.tailscale.ipn.IPNReceiver

#configure exit node 
adb shell am broadcast -a com.tailscale.ipn.USE_EXIT_NODE -n com.tailscale.ipn/com.tailscale.ipn.IPNReceiver --es exitNode "my-exit-node" --ez allowLanAccess true

#reset exit node configuration
adb shell am broadcast -a com.tailscale.ipn.USE_EXIT_NODE -n com.tailscale.ipn/com.tailscale.ipn.IPNReceiver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android 11 notification action not clickable

1 participant