Commit Graph

6326 Commits

Author SHA1 Message Date
Lucas Lin
da2e1eb4d4 Merge "Throw UnsupportedOperationException if startLegacyVpn is called" into sc-dev am: 3d46c08205
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15047372

Change-Id: Ibaba54fc37e9e0d33504b2901484e3551afeb005
2021-06-23 05:38:24 +00:00
Yan Yan
627f34fab2 Merge "Include IkeTunnelConnectionParams in #hashCode and #equals" am: 320056b32d am: 8d9fa0b9e6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1742657

Change-Id: I061ad3d218a460a7f859fe442b1111f3432ae28c
2021-06-23 02:18:09 +00:00
lucaslin
d4c4a2c95b Throw UnsupportedOperationException if startLegacyVpn is called
Legacy VPN is deprecated starting from Android S. So this API
shouldn't be called if the initial SDK version of device is
Android S+. Otherwise, UnsupportedOperationException will be
thrown.

Bug: 189808606
Test: 1. make gts && gts-tradefed
      2. run gts --module GtsNetworkStackHostTestCases
Change-Id: I00f49555bbbc8ccf270056f0e4d1bfdd927ef26d
2021-06-23 08:17:55 +08:00
Yan Yan
320056b32d Merge "Include IkeTunnelConnectionParams in #hashCode and #equals" 2021-06-22 22:41:03 +00:00
Yan Yan
16006a61b9 Include IkeTunnelConnectionParams in #hashCode and #equals
This commit includes IkeTunnelConnectionParams in
VcnGatewayConnectionConfig#hashCode and
VcnGatewayConnectionConfig#equals.

This commit fixes the issue that VcnGatewayConnection was not
being restarted as expected.

Bug: 191317512
Test: atest FrameworksVcnTests (new tests added)
Test: atest CtsVcnTestCases
Change-Id: I70182f9b645e55eced1e0a048a1bd87778c1c0f6
2021-06-22 11:37:38 -07:00
Treehugger Robot
e98c98156c Merge "Convert VcnNetworkProvider to use NetworkOffers" 2021-06-16 19:48:58 +00:00
Cody Kesting
705021aa6b Convert VcnNetworkProvider to use NetworkOffers
This change brings VcnNetworkProvider to full functionality in the new
NetworkProvider paradigm, where NetworkProviders offer networks, and are
notified based on NetworkOfferCallbacks.

Bug: 185204197
Test: atest FrameworksVcnTests
Change-Id: I88c69c0be9f6fd81839fb1595ed00341001694a5
Merged-In: I88c69c0be9f6fd81839fb1595ed00341001694a5
2021-06-15 18:13:56 -07:00
Sarah Chin
ab9f5d46b2 Merge "Update documentation for setSubscriptionOverride" 2021-06-14 19:30:48 +00:00
Luke Huang
171d69e33e Make NsdService only start the native daemon when needed and automatically clean it up.
Currently, NsdService starts the native mdnsresponder daemon if any
NsdManager connect to it, which results in that when any constant
service holds the NsdManager connection, the device would always be
in the mdns multicast group whatever the connection is not used or not.
This is because mdnsresponder will join the multicast group when it
starts.

To solve this problem, start the native daemon only when needed, and
clean it up after the given idle timeout.

1. Start the native daemon when a new request come.
2. If there is no pending request, clean up the daemon after 3 seconds
of idle time.

Bug: 181810560
Test: atest NsdManagerTest NsdServiceTest
Original-Change: https://android-review.googlesource.com/1717479
Merged-In: I3eb04552f6cf6c0c68c07abffe751bb4d0669215
Change-Id: I3eb04552f6cf6c0c68c07abffe751bb4d0669215
2021-06-14 06:54:52 +00:00
Luke Huang
83703e20c1 Merge "Make NsdService only start the native daemon when needed and automatically clean it up." am: 05081aa3b0 am: 109327feb0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1717479

Change-Id: Idb9e8dcd7c38ee09e21a3e0af3e643c44f9aa357
2021-06-13 16:52:05 +00:00
Luke Huang
b4cbf81dd7 Make NsdService only start the native daemon when needed and automatically clean it up.
Currently, NsdService starts the native mdnsresponder daemon if any
NsdManager connect to it, which results in that when any constant
service holds the NsdManager connection, the device would always be
in the mdns multicast group whatever the connection is not used or not.
This is because mdnsresponder will join the multicast group when it
starts.

To solve this problem, start the native daemon only when needed, and
clean it up after the given idle timeout.

1. Start the native daemon when a new request come.
2. If there is no pending request, clean up the daemon after 3 seconds
of idle time.

Bug: 181810560
Test: atest NsdManagerTest NsdServiceTest
Change-Id: I3eb04552f6cf6c0c68c07abffe751bb4d0669215
2021-06-08 10:09:30 +08:00
Benedict Wong
c52419c68a Merge "Remove underlying network caps" into sc-dev 2021-06-07 17:24:45 +00:00
Sarah Chin
2aaa2c3205 Update documentation for setSubscriptionOverride
Test: build
Fix: 180496714
Change-Id: Iebfcd0ece1891c1b77d132b92e93d8c1eea3aa6e
Merged-In: Iebfcd0ece1891c1b77d132b92e93d8c1eea3aa6e
2021-06-03 17:40:53 -07:00
lesl
c23f868643 carrier data usage: Use carrier template as default policy am: b8b282e54e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14782679

Change-Id: I8bdde6aaeea04c4c70a37d5a71ad31a5590323a9
2021-06-02 04:01:14 +00:00
Les Lee
9eb7688535 Merge "carrier data usage: Use carrier template as default policy" 2021-06-01 10:42:08 +00:00
lesl
b8b282e54e carrier data usage: Use carrier template as default policy
The carrier network means any network which linked with sepcific
subscriberId (for instances: merged Wifi or mobile).
Update default policy to use carrier network template to replace mobile
template.

No impact for current AOSP user because no any wifi network is merged
wifi. (Because the merged wifi network requires to support from the wifi module).

Also this change convert all of the old policies which template is
TYEP_MOBILE to TYPE_CARRIER to match the default policy.

Bug: 176396812
Test: atest -c NetworkPolicyManagerServiceTest
Test: atest -c CtsHostsideNetworkTests
Test: Manual Test with test code (Force wifi to merged wifi).
      The data will limit when using merged wifi.
      And mobile policy also work normally.

Merged-In: I33c10f7549e713c52ce9afd5b8c4cce2abbda616
Change-Id: I33c10f7549e713c52ce9afd5b8c4cce2abbda616
2021-06-01 18:12:56 +08:00
Aaron Huang
b0409be590 Merge "Remove IntDef annotations from NetworkPolicyManager" into sc-dev am: 2debdb3ec2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14747451

Change-Id: Ibd18e3a01ebc46cf27494d99d95e85ef74762f9c
2021-06-01 08:20:24 +00:00
Aaron Huang
fb2b21a167 Remove IntDef annotations from NetworkPolicyManager
@RestrictBackgroundStatus and @MultipathPreference are defined
in connectivity mainline module. Annotate these in non-updatable
platform is not going to be manageable long term. For example,
if the module gets updated and the annotation gets more values
then it's a problem in non-updatable platform. So, it should
not have IntDef cross module boundaries. The javadoc already
document the return type.

Bug: 183972925
Test: build
Change-Id: I371e61fc1ba4d6137139bcfbf1d57fdebe00a257
2021-05-27 15:00:24 +08:00
Benedict Wong
4ab47decd6 Remove underlying network caps
This change removes unused fields in the persistable bundle and
VcnGatewayConnectionConfig classes to ensure future flexibility.

Bug: 182219992
Test: atest FrameworksVcnTests
Change-Id: Ic2fec8a87fd19a1780333c61759c4092598d349e
Merged-In: Ic2fec8a87fd19a1780333c61759c4092598d349e
(cherry picked from commit 1f06b95c62)
2021-05-25 23:17:58 +00:00
Yan Yan
ff41121597 Improve IKEv2/IPsec VPN by proposing more IPsec algorithms
This commit allows IKEv2/IPsec VPN to propose more algorithms that
newly added in IpSecAlgorithm. Those new algorithms have stronger
security guarantees and better performances.

This commit also removes algorithm name validation because all
algorithms are URL encoded to ensure no special characters create
problems due to their use by VpnProfile for list or field delimiting
(e.g. rfc7539esp(chacha20,poly1305))

Bug: 185265778
Test: atest FrameworksNetTests, CtsNetTestCases
Test: All new algorithms are manually verified
Change-Id: I1de322c95aacc8924e95bcdbcfdbd1ec441de99c
Merged-In: I1de322c95aacc8924e95bcdbcfdbd1ec441de99c
2021-05-21 23:33:23 +00:00
Yan Yan
10987d8c02 Merge "Improve IKEv2/IPsec VPN by proposing more IPsec algorithms" am: 94a4cdd4e8 am: 7b8b5fd6de
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1690265

Change-Id: I0e467627fdbf70d6ec704f1f2be58223df9642ed
2021-05-21 23:12:45 +00:00
Yan Yan
94a4cdd4e8 Merge "Improve IKEv2/IPsec VPN by proposing more IPsec algorithms" 2021-05-21 22:00:30 +00:00
Yan Yan
cc258065e1 Improve IKEv2/IPsec VPN by proposing more IPsec algorithms
This commit allows IKEv2/IPsec VPN to propose more algorithms that
newly added in IpSecAlgorithm. Those new algorithms have stronger
security guarantees and better performances.

This commit also removes algorithm name validation because all
algorithms are URL encoded to ensure no special characters create
problems due to their use by VpnProfile for list or field delimiting
(e.g. rfc7539esp(chacha20,poly1305))

Bug: 185265778
Test: atest FrameworksNetTests, CtsNetTestCases
Test: All new algorithms are manually verified
Change-Id: I1de322c95aacc8924e95bcdbcfdbd1ec441de99c
2021-05-21 17:46:54 +00:00
Treehugger Robot
d621b43a5d Improve documentation of IpSecTunnelInterface#setUnderlyingNetwork
Clarify the consequence of adding IpSecTunnelInterface to the
underlying network.

Bug: 169855650
Test: builds
Change-Id: I2e3c4fe735b3374b2ff6d23850970e36c0aafda5
Merged-In: I2e3c4fe735b3374b2ff6d23850970e36c0aafda5
2021-05-20 21:56:26 +00:00
Treehugger Robot
1ffe8e3a8f Merge "Improve documentation of IpSecTunnelInterface#setUnderlyingNetwork" am: 06a4f88eb9 am: 932ee4368e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1590415

Change-Id: I02207954757c9135fbf6674720dd8e623fc9e435
2021-05-20 21:22:32 +00:00
Treehugger Robot
06a4f88eb9 Merge "Improve documentation of IpSecTunnelInterface#setUnderlyingNetwork" 2021-05-20 20:33:41 +00:00
lesl
95904d435d carrier data usage: Use carrier template as default policy
The carrier network means any network which linked with sepcific
subscriberId (for instances: merged Wifi or mobile).
Update default policy to use carrier network template to replace mobile
template.

No impact for current AOSP user because no any wifi network is merged
wifi. (Because the merged wifi network requires to support from the wifi module).

Also this change convert all of the old policies which template is
TYEP_MOBILE to TYPE_CARRIER to match the default policy.

Bug: 176396812
Test: atest -c NetworkPolicyManagerServiceTest
Test: atest -c CtsHostsideNetworkTests
Test: Manual Test with test code (Force wifi to merged wifi).
      The data will limit when using merged wifi.
      And mobile policy also work normally.

Change-Id: I33c10f7549e713c52ce9afd5b8c4cce2abbda616
2021-05-20 23:46:39 +08:00
Les Lee
6fff3df429 Merge "Add metered filter for API: buildTemplateCarrier" into sc-dev 2021-05-19 14:32:29 +00:00
Junyu Lai
b987babf5e Merge changes I3ba50cbd,I970ee365 into sc-dev
* changes:
  [FUI29] Migrate ConnectivityService to use getAllNetworkStateSnapshots
  [FUI27] Fix internal naming of notifyNetworkStatus
2021-05-19 12:36:03 +00:00
lesl
559d4ec575 Add metered filter for API: buildTemplateCarrier
This CL modifies NetworkTemplate#buildTemplateCarrier to force on
metered carrier network and rename to buildTemplateCarrierMetered.
This method was introduced recently and has no callers.

This method will be used in Settings and NetworkPolicyManagerService
to display and manage data usage on carrier metered networks.

Settings/NetworkPolicyManagerService will use it instead of the existing
method buildTemplateMobileAll method, which only matches metered networks.
That code will change from matching metered mobile networks to matching
metered carrier networks.

Note: The carrier metered network includes metered mobile network and
metered "merged carrier wifi network" that is a specific cerrier wifi network
which provides the same user experience as mobile.

Bug: 176396812
Test: atest -c NetworkTemplateTest
Change-Id: I7196d62bb60844458a6c4b1d94e2baccb71e15cd
Merged-In: I7196d62bb60844458a6c4b1d94e2baccb71e15cd
2021-05-19 02:53:39 +00:00
Chris Weir
3be5715ee4 Merge "Print human-readable OEM managed states" am: c4099ac074 am: c589d4e2a3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1636561

Change-Id: I4ecc049acf7a5f2e3c99808c7e5f6c2f064d7e5c
2021-05-18 17:39:57 +00:00
Chris Weir
c4099ac074 Merge "Print human-readable OEM managed states" 2021-05-18 16:29:26 +00:00
Les Lee
bb2bce3215 Merge "Add metered filter for API: buildTemplateCarrier" am: 287dcfbc80 am: 94fa18312d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1699687

Change-Id: I46d8d8f0d9b83fb0a817a3455cbbc28d558b871c
2021-05-18 13:57:06 +00:00
Les Lee
287dcfbc80 Merge "Add metered filter for API: buildTemplateCarrier" 2021-05-18 13:01:38 +00:00
Aaron Huang
329aede902 Merge "Add ConnectivityAnnotations class" into sc-dev am: d2d8fa6c17
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14186142

Change-Id: Ib74156e9f29e62e861d19f5b58a12ab106478b4c
2021-05-17 14:26:25 +00:00
Aaron Huang
d2d8fa6c17 Merge "Add ConnectivityAnnotations class" into sc-dev 2021-05-17 14:07:45 +00:00
junyulai
0c7c578433 [FUI27] Fix internal naming of notifyNetworkStatus
Test: TH
Bug: 174123988
Merged-In: I970ee365ca221956ee85788005d331374b5fa71a
Change-Id: I970ee365ca221956ee85788005d331374b5fa71a
  (cherry-picked from aosp/1620539)
2021-05-17 14:07:00 +08:00
Junyu Lai
8354c4531a Merge changes I3ba50cbd,I970ee365 am: 37f2408143 am: ed64c29783
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1620859

Change-Id: If9a3e37e5359b955e330002d81cbeb48f90ee22b
2021-05-15 17:24:42 +00:00
Junyu Lai
37f2408143 Merge changes I3ba50cbd,I970ee365
* changes:
  [FUI29] Migrate ConnectivityService to use getAllNetworkStateSnapshots
  [FUI27] Fix internal naming of notifyNetworkStatus
2021-05-15 16:21:38 +00:00
Benedict Wong
b9b8c45d66 Merge "Make VcnTransportInfo unparcel to null if no data contained" into sc-dev am: e0ee346120
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14554154

Change-Id: I419ab78dbca7e418f702ad93b90dc481ff90578b
2021-05-14 23:18:15 +00:00
Benedict Wong
6452f6f978 Merge "Remove underlying network caps" am: 886e94b0a3 am: a6006f1d44
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1709008

Change-Id: I9dc2ede9a3e01b1f6988e847d2176a33c159a7fb
2021-05-14 23:13:41 +00:00
Nathan Harold
e386a1fbe8 Merge "Update VCN Owners Post-Initial-Development" am: 4b8d448b3b am: b9ec9c28ef
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1709010

Change-Id: I5fd07130187aed119c27d25082981964b7d12597
2021-05-14 23:12:57 +00:00
Benedict Wong
e0ee346120 Merge "Make VcnTransportInfo unparcel to null if no data contained" into sc-dev 2021-05-14 23:00:21 +00:00
Benedict Wong
d9695aced3 Make VcnTransportInfo unparcel to null if no data contained
When VcnTransportInfo is redacted, it contains no useful information. In
order to preserve the abstraction, the VcnTransportInfo should be
unparcelled to null


Bug: 8675309
Test: atest VcnTransportInfoTest
Change-Id: Ia9dbb9f259027acc74004eb1207e0a13cea56088
2021-05-14 22:53:51 +00:00
Benedict Wong
886e94b0a3 Merge "Remove underlying network caps" 2021-05-14 22:40:54 +00:00
Benedict Wong
b2632543c0 Remove underlying network caps
Bug: 182219992
Test: atest FrameworksVcnTests
Change-Id: Ic2fec8a87fd19a1780333c61759c4092598d349e
2021-05-14 15:28:34 -07:00
Nathan Harold
e0f865d554 Update VCN Owners Post-Initial-Development
Owners files update for VCN now that primary development
is complete and the codebase is stable.

Bug: 8675309
Test: compilation
Change-Id: Ie686729b33f0a7e1c3414374ce4bf3d7ef514a22
2021-05-14 15:05:26 -07:00
junyulai
9c964b11e6 [FUI27] Fix internal naming of notifyNetworkStatus
Test: TH
Bug: 174123988
Change-Id: I970ee365ca221956ee85788005d331374b5fa71a
2021-05-14 19:48:17 +08:00
Aaron Huang
f281058618 Merge "Rename *Iface* APIs to *Interface*" 2021-05-14 09:11:29 +00:00
Benedict Wong
d9c05c23e6 Merge "Custom network selection" am: bc3638ce5d am: b3f0495383 am: 2a86eae65e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1706226

Change-Id: Icdf319d564e4eab468d9d4e722716a2ef7d2c3cd
2021-05-14 05:25:38 +00:00