Merge "Update to positive logic to better match the method naming" am: 1c7bc039ea am: a7136c6340

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1450336

Change-Id: I6e823ac8769864d9a1bfd6d675331d4b683da331
This commit is contained in:
Chiachang Wang
2020-10-07 09:50:45 +00:00
committed by Automerger Merge Worker
2 changed files with 4 additions and 4 deletions

View File

@@ -380,8 +380,8 @@ public class Vpn {
} }
} }
public boolean checkInterfacePresent(final Vpn vpn, final String iface) { public boolean isInterfacePresent(final Vpn vpn, final String iface) {
return vpn.jniCheck(iface) == 0; return vpn.jniCheck(iface) != 0;
} }
} }
@@ -2995,7 +2995,7 @@ public class Vpn {
checkInterruptAndDelay(false); checkInterruptAndDelay(false);
// Check if the interface is gone while we are waiting. // Check if the interface is gone while we are waiting.
if (mDeps.checkInterfacePresent(Vpn.this, mConfig.interfaze)) { if (!mDeps.isInterfacePresent(Vpn.this, mConfig.interfaze)) {
throw new IllegalStateException(mConfig.interfaze + " is gone"); throw new IllegalStateException(mConfig.interfaze + " is gone");
} }

View File

@@ -1263,7 +1263,7 @@ public class VpnTest {
} }
@Override @Override
public boolean checkInterfacePresent(final Vpn vpn, final String iface) { public boolean isInterfacePresent(final Vpn vpn, final String iface) {
return true; return true;
} }
} }