diff options
| author | lifr <lifr@google.com> | 2021-03-24 18:38:37 +0800 |
|---|---|---|
| committer | lifr <lifr@google.com> | 2021-04-01 15:46:31 +0800 |
| commit | 3aee3e78cc585335b0e9d1255d4389d7572d7685 (patch) | |
| tree | 6fafeeb1f049c745eb3dc9c8804745438b044726 /tests/net/java/com/android/server/ConnectivityServiceTest.java | |
| parent | e492ec434da0fb175cd4e4b8cf09ce5483317072 (diff) | |
Add session ID to VpnTransportInfo
- This will be visible only to apps with the NETWORK_SETTINGS
permissions (signature), and will be redacted for all other callers.
- This string is expected to be the same as set by
VpnService#setSession, and in general, VpnConfig.session. But it
will be a general API that Vpn.java can call when setting the
VpnTransportInfo.
- This string cannot be updated once the VPN NetworkAgent is connected.
Bug: 171872481
Test: atest ConnectivityServiceTest
atest VpnTransportInfoTest
atest android.net.cts.NetworkAgentTest
Change-Id: I8d09e25b83f7ee8be21ec9c9bd3c72a251f1370d
Merged-In: I8d09e25b83f7ee8be21ec9c9bd3c72a251f1370d
(cherry-picked from ag/14011912)
Diffstat (limited to 'tests/net/java/com/android/server/ConnectivityServiceTest.java')
| -rw-r--r-- | tests/net/java/com/android/server/ConnectivityServiceTest.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/net/java/com/android/server/ConnectivityServiceTest.java b/tests/net/java/com/android/server/ConnectivityServiceTest.java index 9c1bd66cc19e..0bfcf978e4cd 100644 --- a/tests/net/java/com/android/server/ConnectivityServiceTest.java +++ b/tests/net/java/com/android/server/ConnectivityServiceTest.java @@ -1227,10 +1227,12 @@ public class ConnectivityServiceTest { if (mAgentRegistered) throw new IllegalStateException("already registered"); updateState(NetworkInfo.DetailedState.CONNECTING, "registerAgent"); mConfig = new VpnConfig(); + mConfig.session = "MySession12345"; setUids(uids); if (!isAlwaysMetered) mNetworkCapabilities.addCapability(NET_CAPABILITY_NOT_METERED); mInterface = VPN_IFNAME; - mNetworkCapabilities.setTransportInfo(new VpnTransportInfo(getActiveVpnType())); + mNetworkCapabilities.setTransportInfo(new VpnTransportInfo(getActiveVpnType(), + mConfig.session)); mMockNetworkAgent = new TestNetworkAgentWrapper(TRANSPORT_VPN, lp, mNetworkCapabilities); mMockNetworkAgent.waitForIdle(TIMEOUT_MS); |
