Connectivity: Add capability to allow tethering to use VPN upstreams
Updated for Android 14, which does not handle CONNECTIVITY_ACTION and
therefore does not react to VPN connections as it previously did. The
new way to handle this is EVENT_DEFAULT_SWITCHED, but this only
considered the system default network, not VPNs; now, in 14, when VPN
upstreams are allowed, we follow the default network for ROOT_UID,
mirroring this change's existing consideration of ROOT_UID.
Uses AOSP Settings for easier APEX updates
Squash of:
Author: Sam Mortimer <sam@mortimer.me.uk>
Date: Thu Aug 15 19:40:55 2019 -0700
fw/b: Add capability to allow tethering to use VPN upstreams
* Toggled on/off at runtime via a new hotspot lineage setting.
* Dynamically updates the tethering upstream for existing hotspot
clients as VPNs are brought up / down or the hotspot setting
is changed.
* This implementation depends on fw/b config_tether_upstream_automatic
being set to true.
Change-Id: I2ac0b4acc0ea686dfdf54561cb3428808e337160
Author: Sam Mortimer <sam@mortimer.me.uk>
Date: Fri Sep 13 16:27:37 2019 -0700
fw/b: Prevent trying to enable hw offload for tethering via VPN upstreams
* Tethering via VPN upstream requires a sw path.
* hw offload setup happened to be being disabled anyway owing to a fail
return code from setDataLimit(). However, it was causing offload to be
disabled entirely (until next hotspot off / on event).
* Gracefully skip hw offload for vpn upstreams so that it is automatically
used again when a vpn is disconnected.
Change-Id: I4df13f02889305560903b7b1e919eedc7af78c07
* Previously if you had a VPN running in a work profile, it'd end up using that over user 0 VPN
* Only use user 0 VPNs, as that makes most sense logically for a device-wide feature (hotspot)
Issue: calyxos#912
Co-authored-by: Tommy Webb <tommy@calyxinstitute.org>
Change-Id: I77ed0142e653f4993486eea44e4dac21e3f67f17
Signed-off-by: Dmitrii <bankersenator@gmail.com>
Signed-off-by: Jis G Jacob <studiokeys@blissroms.org>
2 files changed