1
0
Fork 0
mirror of https://github.com/M66B/NetGuard.git synced 2025-02-20 21:37:13 +00:00

Merge pull request #525 from hackel/fix-metered-connection

Set metered connection status on Android 10
This commit is contained in:
Marcel Bokhorst 2020-03-22 19:40:54 +01:00 committed by GitHub
commit 95e535ff58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1250,6 +1250,10 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
Builder builder = new Builder();
builder.setSession(getString(R.string.app_name));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
builder.setMetered(Util.isMeteredNetwork(this));
}
// VPN address
String vpn4 = prefs.getString("vpn4", "10.1.10.1");
Log.i(TAG, "Using VPN4=" + vpn4);