Commit graph android_packages_modules_Co.../framework/src/android/net
Message SHA1
Merge "Add enterpriseSpecifier"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-12-23 22:25:20 +00:00
fbe500351e
Add enterpriseSpecifier
Add enterpriseSpecifier to network capability

Bug: 194332512
CTS-Coverage-Bug: 211133973
Test: CTS and unit test.
Change-Id: If16c8e17cee71cc6788c43a8818bcca68a00bf99

Sooraj Sasindran   commited 2021-12-23 09:32:20 -08:00
4196937bdd
Merge "Revert "Revert "Unhide IpPrefix(InetAddress, int)"""
Taras Antoshchuk   authored and   Gerrit Code Review   commited 2021-12-23 12:41:23 +00:00
37ff6df023
Merge "Revert "Revert "Unhide RouteInfo#getType and related fields"""
Taras Antoshchuk   authored and   Gerrit Code Review   commited 2021-12-23 12:41:23 +00:00
839cb2692e
Added a new network capability MMTEL
Added NET_CAPABILITY_MMTEL to indicate a network
support MMTEL (Multimedia telephony). This is for
IMS service to request an IMS network that supports
voice or PS (VoPS for 4G, VoNR for 5G).

This was previously submitted as aosp/1927841, but
which got reverted due to breaking the mainline
build, which uses the pre-built module.

Bug: 210774375
Test: atest ConnectivityServiceTest
Change-Id: If8b691ff4999a4dbf54e7567d9ca74d743dc5ded

Jack Yu   commited 2021-12-21 16:31:30 +00:00
04bbc5b9b0
Revert "Added a new network capability MMTEL"
Revert "Added setup/tear down data support"

Revert "Added a new network capability MMTEL"

Revert submission 1927643-mmtel_capability

Reason for revert: b/211586152
Reverted Changes:
Ifea8b1e40:Added a new network capability MMTEL
I38655bef2:Added a new network capability MMTEL
I837606d9e:Added setup/tear down data support
I2c7b291fe:Added a new network capability MMTEL

Change-Id: Ie9b0b0d9017ef8aea7fbb56dda522e7c433144b9

Martijn Coenen   commited 2021-12-21 11:24:01 +00:00
6ebc8ba595
Revert "Revert "Unhide IpPrefix(InetAddress, int)""
This reverts commit 758ead6dd3.

Reason for revert: Re-landing changes not related to postsubmit failure

Change-Id: I2f705549d85af4ba45dc294e0a86d757490b1cd7

Taras Antoshchuk   commited 2021-12-19 11:54:56 +00:00
3bbbffe133
Revert "Revert "Unhide RouteInfo#getType and related fields""
This reverts commit 6d1ea2bb16.

Reason for revert: Re-landing changes not related to postsubmit failure

Change-Id: If7940801518be5ddec91270b3663ddfc8b42eadb

Taras Antoshchuk   commited 2021-12-19 11:51:39 +00:00
2b3d62f3e9
Added a new network capability MMTEL
Added NET_CAPABILITY_MMTEL to indicate a network
support MMTEL (Multimedia telephony). This is for
IMS service to request an IMS network that supports
voice or PS (VoPS for 4G, VoNR for 5G).

Bug: 210774375
Test: atest ConnectivityServiceTest
Change-Id: Ifea8b1e40f65c610e925a27be873930fee2df693

Jack Yu   commited 2021-12-16 14:38:10 -08:00
f322d4f5e0
Revert "Unhide IpPrefix(InetAddress, int)"
Revert "Add APIs that allow to exclude routes from VPN"

Revert "Suppress NewApi warnings for @SystemApi -> public APIs"

Revert "Add VpnServiceBuilderShim for VpnService.Builder"

Revert submission 1551943-vpn-impl

Reason for revert: <DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=aosp-master&target=mainline_modules_x86_64-userdebug&lkgb=8007224&lkbb=8008168&fkbb=8007902 >, bug b/210979001
Reverted Changes:
I0e7aa077a:Add VpnServiceBuilderShim for VpnService.Builder
Ib12f5ab39:Suppress NewApi warnings for @SystemApi -> public ...
I59b9185cf:Unhide RouteInfo#getType and related fields
Ie5b62b2b2:Unhide IpPrefix(InetAddress, int)
I993a32d40:Add CTS tests for exclude VPN routes APIs
Ib24b2d3fb:Suppress NewApi warnings for @SystemApi -> public ...
Ic3b10464a:Add APIs that allow to exclude routes from VPN

Change-Id: Id0c373fb042a98c1c68807acf7fcfe456520ebe2
BUG: 210979001

Ayush Sharma   commited 2021-12-16 14:40:13 +00:00
758ead6dd3
Revert "Unhide RouteInfo#getType and related fields"
Revert "Add APIs that allow to exclude routes from VPN"

Revert "Suppress NewApi warnings for @SystemApi -> public APIs"

Revert "Add VpnServiceBuilderShim for VpnService.Builder"

Revert submission 1551943-vpn-impl

Reason for revert: <DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=aosp-master&target=mainline_modules_x86_64-userdebug&lkgb=8007224&lkbb=8008168&fkbb=8007902 >, bug b/210979001
Reverted Changes:
I0e7aa077a:Add VpnServiceBuilderShim for VpnService.Builder
Ib12f5ab39:Suppress NewApi warnings for @SystemApi -> public ...
I59b9185cf:Unhide RouteInfo#getType and related fields
Ie5b62b2b2:Unhide IpPrefix(InetAddress, int)
I993a32d40:Add CTS tests for exclude VPN routes APIs
Ib24b2d3fb:Suppress NewApi warnings for @SystemApi -> public ...
Ic3b10464a:Add APIs that allow to exclude routes from VPN

Change-Id: I98d3b998e4702f56e9d5e17944238b283b29f2b2
BUG: 210979001

Ayush Sharma   commited 2021-12-16 14:40:13 +00:00
6d1ea2bb16
Genericize NC#hasSameUids
This will be used by another set of UIDs in a future patch

Test: FrameworksNetTests
Change-Id: I2c5d18ef93e73b702723814592ef3f3baf5dfbc4

Chalard Jean   commited 2021-12-16 23:03:42 +09:00
f4802fa4c2
Merge "Mark arg to NC#appliesToUidRange non-null"
Jean Chalard   authored and   Gerrit Code Review   commited 2021-12-14 12:17:27 +00:00
ec3013ddf4
Merge "Remove NetworkCapabilities#combine*"
Jean Chalard   authored and   Gerrit Code Review   commited 2021-12-14 10:47:31 +00:00
5469fa6e59
Mark arg to NC#appliesToUidRange non-null
This is always non-null, and if it's not it has a good
chance to throw anyway

Test: m
Change-Id: I1020ab9e6eb546390325cf6aa4d30183b2e69785

Chalard Jean   commited 2021-12-13 21:55:56 +09:00
2873428835
Remove NetworkCapabilities#combine*
This is no longer used outside of tests, and can be safely
removed.

Also this family of methods is fairly confusing, as while
it's well defined for some members, many later additions
had to be written so as to dissallow some combinations when
the workings of this family of methods didn't match the
semantics of some members, making them possibly dangerous
to use and at least exhibit difficult to understand semantics.

Test: FrameworksNetTests
      m
Change-Id: Ia69c20afa16c2153839891f6e33331caa9da33ff

Chalard Jean   commited 2021-12-13 21:15:34 +09:00
bdf4f2987d
Unhide IpPrefix(InetAddress, int)
Unhide IpPrefix constructor to allow its usage with the new
VpnService.Builder#excludeRoute(IpPrefix) method.

Bug: 186082280
Test: atest IpPrefixTest
Change-Id: Ie5b62b2b206def1be53a41219681b4a8bc06c1d2

Taras Antoshchuk   commited 2021-12-13 11:11:00 +01:00
a5a1b80222
Unhide RouteInfo#getType and related fields
Bug: 186082280
Test: atest RouteInfoTest
Change-Id: I59b9185cf4f8f2afd691b49cf6b4659fe36e6bf8

Taras Antoshchuk   commited 2021-12-13 11:11:00 +01:00
62065db8d1
Merge changes from topic "DnsException"
* changes:
  CTS DnsResolverTest for DnsException ctor
  DnsResolver: Make DnsException ctor public

Treehugger Robot   authored and   Gerrit Code Review   commited 2021-12-13 07:48:28 +00:00
0db3016398
Merge "Create DhcpOption object and make it a SystemApi"
Mingguang Xu   authored and   Gerrit Code Review   commited 2021-12-10 19:43:02 +00:00
0a416b65b1
DnsResolver: Make DnsException ctor public
Making the DnsException constructor public is useful for apps
using DnsResolver to write their tests, and for internal packages
that may want to implement the DnsResolver.Callback interface.

Test: for regression; CTS tests in b/208479811
Bug: 208464882
Change-Id: I14641688f53721c96e6df9596a7506912ba3aec0

Aswin Sankar   commited 2021-12-10 19:30:20 +00:00
74cbfd5aab
Create DhcpOption object and make it a SystemApi
This allows OEM apps to pass their custom DHCP options for establishing
network connection.

Bug: 177278970

Test: atest FrameworksNetTests
Test: atest NetworkStackTests

Signed-off-by: Mingguang Xu <mingguangxu@google.com>
Change-Id: I2b8c38ee9a948ad6edb666312c989d27a8ff904b

Mingguang Xu   commited 2021-12-09 19:37:40 -08:00
2d87c6152d
Merge "Enable strict_updatability_linting in connectivity src"
Chiachang Wang   authored and   Gerrit Code Review   commited 2021-12-08 02:36:16 +00:00
81bc609550
Ensure created fd being closed
If exception s thrown while calling bindSocket(fd), the temporary
created ParcelFileDescriptor may not be closed as expected.

Ensure it's closed eventually.

Bug: 206042872
Test: atest FrameworksNetTests
Change-Id: Icde895978ab9281006ffd56335d1247462d9da28

Chiachang Wang   commited 2021-12-01 14:46:29 +08:00
0209c36662
Enable strict_updatability_linting in connectivity src
Bug: 188851968
Test: m lint-check
Change-Id: I3cd06ea16f05cb37d9369a48dd0285d8239fd764

Chiachang Wang   commited 2021-11-26 10:31:58 +08:00
3bc5276568
S- not to crash on NetworkInfo(null) or setDetailedState(null)
When NetworkInfo(null) or setDetailedState(null, any, any) are
called, S used to not crash but plant a null bomb for later
which may explode in some calls (notably, parceling) : see the
bug referenced below for details.

To help catching these errors earlier a patch was made to crash
as soon as one of these methods is called with a null argument,
but this will also crash incorrect use on existing code that
may never actually step on the mine, crashing code that used not
to crash. For safety, implement the new behavior only on T.

Bug: 145972387
Test: NetworkInfoTest
Change-Id: Ib710497d83b2d26439c2bd4d2f572310db97d6fd

Chalard Jean   commited 2021-11-15 21:18:25 +09:00
dece0d805f
Merge "Qualify references to WifiNetworkSuggestions"
Anton Hansson   authored and   Gerrit Code Review   commited 2021-10-21 11:53:06 +00:00
7ea2767864
Merge "Add underlying networks into NetworkAgentInfo if any"
Lucas Lin   authored and   Gerrit Code Review   commited 2021-10-21 08:33:29 +00:00
9c9850b944
Qualify references to WifiNetworkSuggestions
Connectivity's metalava invocation does not depend on framework-wifi,
so these references fail to resolve, and as a result metalava currently
removes the import.

Fully qualify the references instead, to avoid both metalava trying
to resolve the dependency, and having to depend on framework-wifi just
for javadoc.

Bug: 186197911
Test: build the sdk (with connectivity module stubs as input)
Change-Id: I7129821b9a0d08d06f8e977a3c17fa5f5f6f9cee

Anton Hansson   commited 2021-10-20 11:34:48 +01:00
df40109271
Crash bad callers earlier
Instead of crashing when parceling the NetworkInfo object,
crash at the time the bad call is made.

Bug: 145972387
Test: FrameworksNetTests
Change-Id: If8b5fd3d7b800c97211bcd16c9a8c5812708d4ab

Chalard Jean   authored and   paulhu   commited 2021-10-19 16:43:50 +08:00
4b918ab1a4
Add underlying networks into NetworkAgentInfo if any
Now, VPN will set underlying networks into NetworkCapabilities
directly. So the declaredUnderlyingNetworks can also be set
directly when creating a NetworkAgentInfo.

Bug: 191918368
Test: atest FrameworksNetTests:ConnectivityServiceTest
Change-Id: I507072d00ae1eb0c391e5261ab93e359b9c4cb5c

lucaslin   commited 2021-10-19 15:04:56 +08:00
6adf5ac19b
Add new APIs in NetworkCapabilities to set and get underlying networks
Previously, the caller can only know about the transport type of
the underlying network. The information might not be enough if
the device support WiFi STA+STA.
Thus, provide an API for the caller to get the correct underlying
network.

Bug: 191918368
Test: atest FrameworksNetTests:NetworkCapabilitiesTest
Change-Id: I7752b2356770f4572f6ca4cbaecaa45c09d6d72f

lucaslin   commited 2021-10-15 18:07:12 +08:00
8b2dfa7c02
Merge "Add a small usage comment" am: a898f0a039
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1844182

Change-Id: Ibe27d64cd16a2ef44d6a41b94f81a0daa06c523b

Chalard Jean   authored and   Automerger Merge Worker   commited 2021-10-05 11:14:01 +00:00
7f40360e32
Add a small usage comment
Test: comment-only change
Bug: 201972281
Change-Id: Ifbdadbaacfaf364f6770e56ccb816eb3269003d5

Chalard Jean   commited 2021-10-04 18:33:36 +09:00
025f40bc4f
Merge "Remove reference when active listener is unregistered" am: a39b107812
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1833145

Change-Id: I7b05b33c2a0c02c298d42ab4891ce543fe5ab9bd

Chiachang Wang   authored and   Automerger Merge Worker   commited 2021-10-01 00:54:16 +00:00
e129460c46
Merge "Remove reference when active listener is unregistered"
Chiachang Wang   authored and   Gerrit Code Review   commited 2021-10-01 00:37:00 +00:00
a39b107812
Remove reference when active listener is unregistered
The registered listeners are added into internal ArrayMap as a
reference but are not removed when the listeners are
unregistered. The actions for registration should be done in
pairs.

Test: atest FrameworksNetTests
Change-Id: Id9e674f5104d1471dd81224b6a271a8a92172e34

Chiachang Wang   commited 2021-09-30 10:30:35 +00:00
2de41686e7
Merge "Small doc improvement" am: a997db7f40
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1838427

Change-Id: Id3afa12d046e1666978840fee0918f4f160a21c9

Chalard Jean   authored and   Automerger Merge Worker   commited 2021-09-30 08:01:44 +00:00
9f61ab08bd
Merge "Small doc improvement"
Chalard Jean   authored and   Gerrit Code Review   commited 2021-09-30 07:48:00 +00:00
a997db7f40
Small doc improvement
Test: comment-only change
Bug: 191744296
Change-Id: I80447783c9fd89f3b6685a4276cc555a7075a70f

Chalard Jean   commited 2021-09-28 15:31:15 +09:00
0d05151b5c
Merge "Add a mode for cell radios unable to time share" am: c80a5d56db
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1827923

Change-Id: I5ded48c8498c32977adcfe2363599d6cfa246e1b

Chalard Jean   authored and   Automerger Merge Worker   commited 2021-09-18 12:50:52 +00:00
d4ec13a400
Add a mode for cell radios unable to time share
Upon changing the default SIM card, the radio will create a
new connection to the new subscription. If that subscription
works correctly, the stack will prefer it to the old one as
the new subscription will be marked with a Primary policy
flag it its score.

Normally, at this point the old network lingers to give apps
an opportunity to gracefully migrate their connections. But
with some radios, this may have a dramatic effect on the
performance of the new connection.

This patch introduces a flag so that devices with such radios
can be marked. In this case the stack will move to a degraded
mode and eschew the grace delay for apps and give them a hard
break instead, so that the new network can reach a good
performance immediately. Apps with existing connections will
suffer a worse experience.

If there is a request that can only be served by the old
connection, still keep it, as arguably the user still
expects their MMS be sent on the old connection, even if the
new connection doesn't work well until it's done.

Test: new test in this patch, and add relevant tests in both modes
      also manually change the value of the flag and run
      FrameworksNetTests and CtsNetTestCasesLatestSdk
Bug: 200226979
Change-Id: I4ace82f90e873bf06298cc689bb1d794ed5124bd

Chalard Jean   commited 2021-09-18 04:03:13 +00:00
0702f98edc
Merge "Correct the calling method in removeDefaultNetworkActiveListener" am: a6e3069c27
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1827914

Change-Id: I69a199d8253aca744a43b04e89a88da65f6bd8b9

Chiachang Wang   authored and   Automerger Merge Worker   commited 2021-09-16 06:39:32 +00:00
7c04a51a95
Correct the calling method in removeDefaultNetworkActiveListener
The removeDefaultNetworkActiveListener should do the
unregisteration but it's incorrectly calling
registerNetworkActivityListener into the ConnectivityService.

Bug: 199753782
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: I65a2ddc82989d736316d51f5058e707f5b261a82

Chiachang Wang   commited 2021-09-16 02:25:48 +00:00
e54c8199aa
Merge "Separate test into reasonable multiple tests" am: 26a7e61417
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1793478

Change-Id: I9193477c6744c6f9a1f7e7e14e0c98e4348b262d

Chiachang Wang   authored and   Automerger Merge Worker   commited 2021-09-07 03:01:39 +00:00
33076dddff
Merge "Merge sc-dev-plus-aosp-without-vendor@7634622" into stage-aosp-master
Xin Li   authored and   Android (Google) Code Review   commited 2021-08-17 18:15:09 +00:00
e534ce4c55
Separate test into reasonable multiple tests
The test actually verifies multiple behaviors and mutates the
networkCapabilities. Thus, refactor the method to keep the
tests easier to follow up.

Bug: 191918212
Test: atest android.net.NetworkCapabilitiesTest
Change-Id: Ibad1a0569d26d92f94153bee323cef5a1c30d8d4

Chiachang Wang   commited 2021-08-17 16:02:09 +08:00
d525a64ead
Fix NetworkCapabilities MTS on S, CTS on S+module
restrictCapabilitiesForTestNetwork was renamed after S release to be
included in a mainline release, but this causes the MTS test to fail on
S if the Connectivity module is not updated, and CTS to fail if the
connectivity module is updated.

Mark the test as @ConnectivityModuleTest so it can be skipped on
non-connectivity module MTS tests (such as NetworkStack tests), and add
back the previous method name to keep CTS passing.

Bug: 196755836
Test: atest NetworkCapabilitiesTest
Change-Id: Ibd6c2e62e5949ec6d93e9f6e4fc05129c29b94f8

Remi NGUYEN VAN   commited 2021-08-16 18:03:37 +09:00
5b8e2e9935
Merge sc-dev-plus-aosp-without-vendor@7634622
Merged-In: I5a33f959c8ae5a34584f57508f392038e44062e7
Change-Id: Ib4e5e75ee8bbe19806bdc2f69590d164fb75774b

Xin Li   commited 2021-08-14 06:31:05 +00:00
3ec4468fb7
The net cap value should be bit shifted before &ing
The check intends to do the bit & operation. The net cap value
should be shifted against the original capabilities.

Also fix the typo in the method name.

Bug: 191918212
Test: atest FrameworksNetTests
Change-Id: I98396b2538f36fe8b29d27a544a2dfb3060bc9c5

Chiachang Wang   commited 2021-08-11 14:55:00 +08:00
c07315aa08