mirror of
https://github.com/strongswan/strongswan.git
synced 2025-10-06 00:00:47 -04:00
android: Don't default to marking VPN connections as metered
For apps targeting Android 10, where a method to change this was added, the default changed so that all VPN connections are marked as metered. This means certain background operations (e.g. syncing data) are not performed anymore even when connected to a WiFi. By setting this to false, the metered state of the VPN connection reflects that of the underlying networks.
This commit is contained in:
parent
b58740996f
commit
b32a9be419
@ -822,6 +822,12 @@ public class CharonVpnService extends VpnService implements Runnable, VpnStateSe
|
||||
PendingIntent pending = PendingIntent.getActivity(context, 0, intent,
|
||||
PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
builder.setConfigureIntent(pending);
|
||||
|
||||
/* mark all VPN connections as unmetered (default changed for Android 10) */
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q)
|
||||
{
|
||||
builder.setMetered(false);
|
||||
}
|
||||
return builder;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user