Snap for 6545159 from 9c234038c3c27e0b8728825b93b0037316d5708e to mainline-release
Change-Id: I54aee6d4c4c178ed29654d832a99589e8f84e218
This commit is contained in:
@@ -27,12 +27,13 @@
|
|||||||
#include <netinet/ip.h>
|
#include <netinet/ip.h>
|
||||||
#include <netinet/udp.h>
|
#include <netinet/udp.h>
|
||||||
|
|
||||||
|
#include <DnsProxydProtocol.h> // NETID_USE_LOCAL_NAMESERVERS
|
||||||
#include <android_runtime/AndroidRuntime.h>
|
#include <android_runtime/AndroidRuntime.h>
|
||||||
#include <cutils/properties.h>
|
#include <cutils/properties.h>
|
||||||
#include <utils/misc.h>
|
|
||||||
#include <utils/Log.h>
|
|
||||||
#include <nativehelper/JNIHelp.h>
|
#include <nativehelper/JNIHelp.h>
|
||||||
#include <nativehelper/ScopedLocalRef.h>
|
#include <nativehelper/ScopedLocalRef.h>
|
||||||
|
#include <utils/Log.h>
|
||||||
|
#include <utils/misc.h>
|
||||||
|
|
||||||
#include "NetdClient.h"
|
#include "NetdClient.h"
|
||||||
#include "core_jni_helpers.h"
|
#include "core_jni_helpers.h"
|
||||||
|
|||||||
@@ -8187,6 +8187,11 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
+ "creators");
|
+ "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();
|
final DataStallReportParcelable p = new DataStallReportParcelable();
|
||||||
p.timestampMillis = timestampMillis;
|
p.timestampMillis = timestampMillis;
|
||||||
p.detectionMethod = detectionMethod;
|
p.detectionMethod = detectionMethod;
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ public class IpMemoryStoreTest {
|
|||||||
|
|
||||||
private static NetworkAttributes buildTestNetworkAttributes(String hint, int mtu) {
|
private static NetworkAttributes buildTestNetworkAttributes(String hint, int mtu) {
|
||||||
return new NetworkAttributes.Builder()
|
return new NetworkAttributes.Builder()
|
||||||
.setGroupHint(hint)
|
.setCluster(hint)
|
||||||
.setMtu(mtu)
|
.setMtu(mtu)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public class ParcelableTests {
|
|||||||
|
|
||||||
builder.setAssignedV4Address((Inet4Address) Inet4Address.getByName("6.7.8.9"));
|
builder.setAssignedV4Address((Inet4Address) Inet4Address.getByName("6.7.8.9"));
|
||||||
builder.setAssignedV4AddressExpiry(System.currentTimeMillis() + 3_600_000);
|
builder.setAssignedV4AddressExpiry(System.currentTimeMillis() + 3_600_000);
|
||||||
builder.setGroupHint("groupHint");
|
builder.setCluster("groupHint");
|
||||||
builder.setDnsAddresses(Arrays.asList(
|
builder.setDnsAddresses(Arrays.asList(
|
||||||
InetAddress.getByName("ACA1:652B:0911:DE8F:1200:115E:913B:AA2A"),
|
InetAddress.getByName("ACA1:652B:0911:DE8F:1200:115E:913B:AA2A"),
|
||||||
InetAddress.getByName("6.7.8.9")));
|
InetAddress.getByName("6.7.8.9")));
|
||||||
|
|||||||
@@ -199,6 +199,8 @@ public class VpnTest {
|
|||||||
when(mContext.getString(R.string.config_customVpnAlwaysOnDisconnectedDialogComponent))
|
when(mContext.getString(R.string.config_customVpnAlwaysOnDisconnectedDialogComponent))
|
||||||
.thenReturn(Resources.getSystem().getString(
|
.thenReturn(Resources.getSystem().getString(
|
||||||
R.string.config_customVpnAlwaysOnDisconnectedDialogComponent));
|
R.string.config_customVpnAlwaysOnDisconnectedDialogComponent));
|
||||||
|
when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_IPSEC_TUNNELS))
|
||||||
|
.thenReturn(true);
|
||||||
when(mSystemServices.isCallerSystem()).thenReturn(true);
|
when(mSystemServices.isCallerSystem()).thenReturn(true);
|
||||||
|
|
||||||
// Used by {@link Notification.Builder}
|
// 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
|
@Test
|
||||||
public void testProvisionVpnProfilePreconsented() throws Exception {
|
public void testProvisionVpnProfilePreconsented() throws Exception {
|
||||||
final Vpn vpn = createVpnAndSetupUidChecks(AppOpsManager.OP_ACTIVATE_PLATFORM_VPN);
|
final Vpn vpn = createVpnAndSetupUidChecks(AppOpsManager.OP_ACTIVATE_PLATFORM_VPN);
|
||||||
|
|||||||
Reference in New Issue
Block a user