Snap for 6542686 from 7f3570724deecf3933cfb4d1cd98b014ef513c45 to rvc-release
Change-Id: Id4d5eafbfac86414fe2dc3a8e45812efac9428bb
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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")));
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user