Snap for 6545159 from 9c234038c3c27e0b8728825b93b0037316d5708e to mainline-release

Change-Id: I54aee6d4c4c178ed29654d832a99589e8f84e218
This commit is contained in:
android-build-team Robot
2020-05-31 07:09:59 +00:00
5 changed files with 26 additions and 4 deletions

View File

@@ -27,12 +27,13 @@
#include <netinet/ip.h>
#include <netinet/udp.h>
#include <DnsProxydProtocol.h> // NETID_USE_LOCAL_NAMESERVERS
#include <android_runtime/AndroidRuntime.h>
#include <cutils/properties.h>
#include <utils/misc.h>
#include <utils/Log.h>
#include <nativehelper/JNIHelp.h>
#include <nativehelper/ScopedLocalRef.h>
#include <utils/Log.h>
#include <utils/misc.h>
#include "NetdClient.h"
#include "core_jni_helpers.h"

View File

@@ -8187,6 +8187,11 @@ public class ConnectivityService extends IConnectivityManager.Stub
+ "creators");
}
// Instead of passing the data stall directly to the ConnectivityDiagnostics handler, treat
// this as a Data Stall received directly from NetworkMonitor. This requires wrapping the
// Data Stall information as a DataStallReportParcelable and passing to
// #notifyDataStallSuspected. This ensures that unknown Data Stall detection methods are
// still passed to ConnectivityDiagnostics (with new detection methods masked).
final DataStallReportParcelable p = new DataStallReportParcelable();
p.timestampMillis = timestampMillis;
p.detectionMethod = detectionMethod;

View File

@@ -105,7 +105,7 @@ public class IpMemoryStoreTest {
private static NetworkAttributes buildTestNetworkAttributes(String hint, int mtu) {
return new NetworkAttributes.Builder()
.setGroupHint(hint)
.setCluster(hint)
.setMtu(mtu)
.build();
}

View File

@@ -54,7 +54,7 @@ public class ParcelableTests {
builder.setAssignedV4Address((Inet4Address) Inet4Address.getByName("6.7.8.9"));
builder.setAssignedV4AddressExpiry(System.currentTimeMillis() + 3_600_000);
builder.setGroupHint("groupHint");
builder.setCluster("groupHint");
builder.setDnsAddresses(Arrays.asList(
InetAddress.getByName("ACA1:652B:0911:DE8F:1200:115E:913B:AA2A"),
InetAddress.getByName("6.7.8.9")));

View File

@@ -199,6 +199,8 @@ public class VpnTest {
when(mContext.getString(R.string.config_customVpnAlwaysOnDisconnectedDialogComponent))
.thenReturn(Resources.getSystem().getString(
R.string.config_customVpnAlwaysOnDisconnectedDialogComponent));
when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_IPSEC_TUNNELS))
.thenReturn(true);
when(mSystemServices.isCallerSystem()).thenReturn(true);
// Used by {@link Notification.Builder}
@@ -730,6 +732,20 @@ public class VpnTest {
}
}
@Test
public void testProvisionVpnProfileNoIpsecTunnels() throws Exception {
when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_IPSEC_TUNNELS))
.thenReturn(false);
final Vpn vpn = createVpnAndSetupUidChecks(AppOpsManager.OP_ACTIVATE_PLATFORM_VPN);
try {
checkProvisionVpnProfile(
vpn, true /* expectedResult */, AppOpsManager.OP_ACTIVATE_PLATFORM_VPN);
fail("Expected exception due to missing feature");
} catch (UnsupportedOperationException expected) {
}
}
@Test
public void testProvisionVpnProfilePreconsented() throws Exception {
final Vpn vpn = createVpnAndSetupUidChecks(AppOpsManager.OP_ACTIVATE_PLATFORM_VPN);