Feature description
I'm looking for a way to tell if the current connection is set as metered or not (including use of mobile data as well as Wi-Fi networks set as metered e.g. hotspots), so that I can guard scripts or steps of them from using large amounts of data where this is chargeable.
termux-job-schedule allows deferring jobs from running on metered connections with --network unmetered, though I'd like more fine-grained control that can also be used outside of work jobs.
It doesn't look like there's currently any transport-agnostic network tools here, and the existing Wi-Fi commands don't expose this information.
Reference implementation
NetworkCapabilities::getCapabilities() and NetworkCapabilities::NET_CAPABILITY_NOT_METERED
Feature description
I'm looking for a way to tell if the current connection is set as metered or not (including use of mobile data as well as Wi-Fi networks set as metered e.g. hotspots), so that I can guard scripts or steps of them from using large amounts of data where this is chargeable.
termux-job-scheduleallows deferring jobs from running on metered connections with--network unmetered, though I'd like more fine-grained control that can also be used outside of work jobs.It doesn't look like there's currently any transport-agnostic network tools here, and the existing Wi-Fi commands don't expose this information.
Reference implementation
NetworkCapabilities::getCapabilities()andNetworkCapabilities::NET_CAPABILITY_NOT_METERED