Revert "VCN: Require capability matching on test networks for CTS"
This reverts commit 4477537461.
Reason for revert: b/274811188 (unit tests are broken)
Bug: 274811188
Test: atest CtsVcnTestCases; atest FrameworksVcnTests
Change-Id: Id48ce89650864bbb5c489871dadb9b2714ab6910
This commit is contained in:
@@ -354,7 +354,6 @@ public final class VcnCellUnderlyingNetworkTemplate extends VcnUnderlyingNetwork
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@Override
|
||||
public Map<Integer, Integer> getCapabilitiesMatchCriteria() {
|
||||
return Collections.unmodifiableMap(new HashMap<>(mCapabilitiesMatchCriteria));
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ import com.android.internal.util.Preconditions;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
@@ -308,7 +307,4 @@ public abstract class VcnUnderlyingNetworkTemplate {
|
||||
public int getMinExitDownstreamBandwidthKbps() {
|
||||
return mMinExitDownstreamBandwidthKbps;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public abstract Map<Integer, Integer> getCapabilitiesMatchCriteria();
|
||||
}
|
||||
|
||||
@@ -15,9 +15,6 @@
|
||||
*/
|
||||
package android.net.vcn;
|
||||
|
||||
import static android.net.NetworkCapabilities.NET_CAPABILITY_INTERNET;
|
||||
import static android.net.vcn.VcnUnderlyingNetworkTemplate.MATCH_ANY;
|
||||
|
||||
import static com.android.internal.annotations.VisibleForTesting.Visibility;
|
||||
import static com.android.server.vcn.util.PersistableBundleUtils.STRING_DESERIALIZER;
|
||||
import static com.android.server.vcn.util.PersistableBundleUtils.STRING_SERIALIZER;
|
||||
@@ -26,7 +23,6 @@ import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.net.NetworkCapabilities;
|
||||
import android.net.vcn.VcnUnderlyingNetworkTemplate.MatchCriteria;
|
||||
import android.os.PersistableBundle;
|
||||
import android.util.ArraySet;
|
||||
|
||||
@@ -36,7 +32,6 @@ import com.android.server.vcn.util.PersistableBundleUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -167,12 +162,6 @@ public final class VcnWifiUnderlyingNetworkTemplate extends VcnUnderlyingNetwork
|
||||
return Collections.unmodifiableSet(mSsids);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@Override
|
||||
public Map<Integer, Integer> getCapabilitiesMatchCriteria() {
|
||||
return Collections.singletonMap(NET_CAPABILITY_INTERNET, MATCH_REQUIRED);
|
||||
}
|
||||
|
||||
/** This class is used to incrementally build VcnWifiUnderlyingNetworkTemplate objects. */
|
||||
public static final class Builder {
|
||||
private int mMeteredMatchCriteria = MATCH_ANY;
|
||||
|
||||
@@ -171,18 +171,6 @@ class NetworkPriorityClassifier {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (Map.Entry<Integer, Integer> entry :
|
||||
networkPriority.getCapabilitiesMatchCriteria().entrySet()) {
|
||||
final int cap = entry.getKey();
|
||||
final int matchCriteria = entry.getValue();
|
||||
|
||||
if (matchCriteria == MATCH_REQUIRED && !caps.hasCapability(cap)) {
|
||||
return false;
|
||||
} else if (matchCriteria == MATCH_FORBIDDEN && caps.hasCapability(cap)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (vcnContext.isInTestMode() && caps.hasTransport(TRANSPORT_TEST)) {
|
||||
return true;
|
||||
}
|
||||
@@ -331,6 +319,18 @@ class NetworkPriorityClassifier {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (Map.Entry<Integer, Integer> entry :
|
||||
networkPriority.getCapabilitiesMatchCriteria().entrySet()) {
|
||||
final int cap = entry.getKey();
|
||||
final int matchCriteria = entry.getValue();
|
||||
|
||||
if (matchCriteria == MATCH_REQUIRED && !caps.hasCapability(cap)) {
|
||||
return false;
|
||||
} else if (matchCriteria == MATCH_FORBIDDEN && caps.hasCapability(cap)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user