Commit Graph

6344 Commits

Author SHA1 Message Date
Treehugger Robot
d6b4b6dc69 Merge "Correct comments" am: 2c0b1b672e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1784149

Change-Id: I3bc94fb7cbc33dc32bb4b0adf5282814bac75232
2021-08-25 07:17:26 +00:00
Treehugger Robot
2c0b1b672e Merge "Correct comments" 2021-08-25 07:04:22 +00:00
Yen-Jen Wang
68d79b074c Correct comments
PacProxyInstaller had been renamed to PacProxyService
so any comments that refer to it should be updated
accordingly.

Bug: 194984075
Test: refine comments only
Change-Id: I5d8ed07e804471cfcbcc80eca908b18f6557cf79
2021-08-03 19:41:14 +08:00
lucaslin
3eb2a54e31 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
Merged-In: I00f49555bbbc8ccf270056f0e4d1bfdd927ef26d
2021-07-30 14:15:38 +08:00
Luke Huang
6bb1bf8f2c Merge "Keep the native mdns daemon alive for pre-S application" into sc-dev am: 5978eb6eb4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15320524

Change-Id: I18b5ab0a0d332167db75d97b8d35595dedc56567
2021-07-22 03:26:43 +00:00
Luke Huang
4593d929fe Keep the native mdns daemon alive for pre-S application
Roll back the behavior changes by checking the target SDK to ensure that
there are no compatibility issues with the pre-S application.
If the target SDK of the application <S, NsdManager will actively send a
cmd to start the native daemon, and NsdService will keep the daemon
until the last client with the target SDK <S disconnects.

Test: atest NsdManagerTest NsdServiceTest
Bug: 191844585
Change-Id: Ie93d5d585e126fe220ae865bbc7274f21a925984
2021-07-21 06:21:42 +00:00
Treehugger Robot
f305d79b2f Merge "Gracefully handle integer overflows." am: edbf08efe4 am: d4909b9aa9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1714119

Change-Id: I95ef9e71987fc39250e6edd107fe2ec597b1ea17
2021-07-20 08:15:13 +00:00
Treehugger Robot
edbf08efe4 Merge "Gracefully handle integer overflows." 2021-07-20 07:36:56 +00:00
Remi NGUYEN VAN
8608d0626e Merge "Rename FIRST_SDK_INT to DEVICE_INITIAL_SDK_INT" 2021-07-19 09:47:21 +00:00
Chalard Jean
452aed7c25 Merge "Add doc explaining PAC proxies are not supported over VPNs" am: 2f3d6bc593 am: 75e9f0806c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1767430

Change-Id: Ia763ff8a6ddcbaf86f0dc8220a75819bb2e44858
2021-07-15 09:33:47 +00:00
Chalard Jean
3eac2ebe4d Add doc explaining PAC proxies are not supported over VPNs
Test: Comment-only change
Bug: 181600172
Change-Id: I3049fa7eafed04858711f8dee0c11dd4656f9106
2021-07-15 13:45:51 +09:00
paulhu
670abcd53d Rename FIRST_SDK_INT to DEVICE_INITIAL_SDK_INT
As API review feedback, rename Build#VERSION#FIRST_SDK_INT to
Build#VERSION#DEVICE_INITIAL_SDK_INT. As well as update all usage
in frameworks and tests.

Bug: 184735771
Test: m
Merged-In: I72660959cb4e638a8e80fcf2f4e96ea172969f44
(cherry-pick with minor conflicts)

Change-Id: I72660959cb4e638a8e80fcf2f4e96ea172969f44
2021-07-05 14:10:16 +09:00
Benedict Wong
a49bbf06f1 Add support for app data accounting for in-kernel dataplanes
This change ensures that app data accounting works correctly within the
confines of in-kernel dataplanes, as used by platform VPNs and the VCN.

Notably, the VCN MUST NOT specify the IMSI, as that would lead to double
counting of the interface statistics.

Bug: 175853498
Bug: 190620024
Test: atest NetworkStatsTest FrameworksVcnTests
Original-Change: https://android-review.googlesource.com/1749070
Merged-In: I768907cd3dd2028c7040cddd81fc71a5ce69bbdb
Change-Id: I768907cd3dd2028c7040cddd81fc71a5ce69bbdb
2021-07-02 19:28:45 +00:00
Benedict Wong
9c66126e95 Merge "Add support for app data accounting for in-kernel dataplanes" am: 69e2f04207 am: cdb9503af4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1749070

Change-Id: I583a872bcb18f1b749f4ab0b49cbc9323920f048
2021-07-02 19:12:24 +00:00
Benedict Wong
69e2f04207 Merge "Add support for app data accounting for in-kernel dataplanes" 2021-07-02 18:42:15 +00:00
Benedict Wong
bbee1d39b1 Add support for app data accounting for in-kernel dataplanes
This change ensures that app data accounting works correctly within the
confines of in-kernel dataplanes, as used by platform VPNs and the VCN.

Notably, the VCN MUST NOT specify the IMSI, as that would lead to double
counting of the interface statistics.

Bug: 175853498
Bug: 190620024
Test: atest NetworkStatsTest FrameworksVcnTests
Change-Id: I768907cd3dd2028c7040cddd81fc71a5ce69bbdb
2021-07-01 19:49:50 -07:00
Yan Yan
bfeb5980f2 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
Original-Change: https://android-review.googlesource.com/1742657
Merged-In: I70182f9b645e55eced1e0a048a1bd87778c1c0f6
Change-Id: I70182f9b645e55eced1e0a048a1bd87778c1c0f6
2021-06-23 23:38:16 +00:00
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
Pavan Kumar M
9c48c78de3 Gracefully handle integer overflows.
Avoid recording negative data by doing integer-based
math as much as possible, but switch to double-based
math if we detect that we'd end up causing an overflow.

Test :
    - Builds, Boots
    - High data throughput scenarios
    - NetworkStatsHistoryTest, NetworkStatsCollectionTest,
      NetworkStatsTest

Bug: 119527458
Change-Id: I355fc9bd127da83c1dc70ab3b1261346d4fa5de0
2021-05-26 08:09:31 +00: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