Browse Source

GoBackend: restrict APIs to proper version

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
master
Jason A. Donenfeld 4 years ago
parent
commit
c621ec0c50
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      app/src/main/java/com/wireguard/android/backend/GoBackend.java

+ 3
- 3
app/src/main/java/com/wireguard/android/backend/GoBackend.java View File

@@ -213,9 +213,10 @@ public final class GoBackend implements Backend {

builder.setMtu(config.getInterface().getMtu().orElse(1280));

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q)
builder.setMetered(false);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
service.setUnderlyingNetworks(null);

builder.setBlocking(true);
try (final ParcelFileDescriptor tun = builder.establish()) {
@@ -229,7 +230,6 @@ public final class GoBackend implements Backend {

currentTunnel = tunnel;

service.setUnderlyingNetworks(null);
service.protect(wgGetSocketV4(currentTunnelHandle));
service.protect(wgGetSocketV6(currentTunnelHandle));
} else {


Loading…
Cancel
Save