Commit Graph

6441 Commits

Author SHA1 Message Date
Chiachang Wang
c8aec5f1a2 Merge "Only set excludeLocalRoutes in the bypassable VpnProfile" am: b70a0862ff am: bfc4c06f12 am: f1f4773f49 am: 8f7da779d1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1944537

Change-Id: I224709966a9ae453c90f3f40e391ab8c844ec708
2022-01-11 14:47:28 +00:00
Chiachang Wang
657656b460 Only set excludeLocalRoutes in the bypassable VpnProfile
fromVpnProfile() will be called in the system server directly.
If the input VpnProfile does not set excludeLocalRoute with a
bypassable VPN, it will crash system server. Thus, only set
the excludeLocalRoutes in the bypassable VpnProfile.

Bug: 184750836
Test: atest FrameworksNetTests
Change-Id: I311cc7e3c46ab4f6721f477f227e76ba4c0712f6
2022-01-11 13:46:47 +00:00
Chiachang Wang
bac69433f6 Merge "Allow excludeLocalRoutes set only in bypassable profile" am: eaa3fc76a8 am: e6c1b94120 am: 9d00b2224a am: 3c0d514eab
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1938237

Change-Id: I501199d6a3095aceefd7ea9e31e96af3d651efb4
2022-01-11 10:06:20 +00:00
Chiachang Wang
eaa3fc76a8 Merge "Allow excludeLocalRoutes set only in bypassable profile" 2022-01-11 08:56:38 +00:00
Yan Yan
ac9a6b935f Merge "Rename VcnUnderlyingNetworkPrioirty to VcnUnderlyingNetworkTemplate" am: 60ad179dff am: 6ca0ac41d5 am: 4b5fa75804 am: 62654e3ab8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1923190

Change-Id: I62258729b41a476bbde283f74a68c3829a886af9
2022-01-07 23:36:53 +00:00
Yan Yan
60ad179dff Merge "Rename VcnUnderlyingNetworkPrioirty to VcnUnderlyingNetworkTemplate" 2022-01-07 22:49:41 +00:00
Matt Buckley
2952c72239 Merge "Revert "Revert "Revert "Add APIs that allow to exclude routes fr..."" am: f7a327e8d5 am: 086cbfd1bf am: 366582cbae am: c83c35b7fd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1941194

Change-Id: Ie4bdc7876ab2bc61aff66d1b3c8a72748b3117ad
2022-01-07 18:58:22 +00:00
Matt Buckley
f7a327e8d5 Merge "Revert "Revert "Revert "Add APIs that allow to exclude routes fr..."" 2022-01-07 17:48:45 +00:00
Matt Buckley
7153b105e7 Revert "Revert "Revert "Add APIs that allow to exclude routes fr..."
Revert "Revert "Revert "Add VpnServiceBuilderShim for VpnService..."

Revert submission 1931760-reland-vpn-impl-part-2

Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=aosp-master&target=test_suites_x86_64&lkgb=8053795&lkbb=8053908&fkbb=8053828, bug b/213588956.
BUG: b/213588956
Reverted Changes:
Ic8ed8fce7:Revert "Revert "Add CTS tests for exclude VPN rout...
I07104340a:Revert "Revert "Add VpnServiceBuilderShim for VpnS...
I7c69b7244:Revert "Revert "Add APIs that allow to exclude rou...

Change-Id: Ic72cafcf5c7e2c62236f1cef61b0764882bacaad
2022-01-07 17:44:52 +00:00
Taras Antoshchuk
ddb46412b6 Merge "Revert "Revert "Add APIs that allow to exclude routes from VPN""" am: f4177e94ee am: 464eb8bc19 am: accf4c69a5 am: c159f90aa8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1931085

Change-Id: I5336589d5ddee73e626c6924d48b9b9cfb126a44
2022-01-07 17:21:35 +00:00
Taras Antoshchuk
f4177e94ee Merge "Revert "Revert "Add APIs that allow to exclude routes from VPN""" 2022-01-07 16:27:12 +00:00
Chiachang Wang
f9868455f9 Allow excludeLocalRoutes set only in bypassable profile
If excludeLocalRoutes is set, it means the VPN is not fully-routed.
The bypassable bit should also be set to reflect the behavior
in the VPN profile. Thus, verify it in the constructor to ensure
the behavior.

Bug: 184750836
Test: atest FrameworksNetTests
Change-Id: I5d2c7bea2e0d5e77f9241c1efc295b3929e1dae3
2022-01-07 02:32:12 +00:00
Yan Yan
a9eec89e4b Rename VcnUnderlyingNetworkPrioirty to VcnUnderlyingNetworkTemplate
Rename the classes' names as well as the test files.

Bug: 206044122
Test: atest FrameworksVcnTests, CtsVcnTestCases
Change-Id: I19d13acf0e46921a7254a39dff2af332c36ab2b2
2022-01-06 10:52:26 -08:00
Taras Antoshchuk
5b1d7c2ead Revert "Revert "Add APIs that allow to exclude routes from VPN""
This reverts commit 487b2e645a.

Reason for revert: failing build target configuration is fixed

Change-Id: I7c69b7244b4262336e427e4c671aaebb70ddc6ed
2022-01-06 14:49:02 +00:00
Junyu Lai
fb715a951d Merge changes from topics "ms34-tm", "ms40-clock" am: beb9fb3cc8 am: 08c51b04ca am: d312550ff8 am: f23caacaf1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1914533

Change-Id: I7db7bdf217c982ef6011a948b68d238c54e2a47e
2022-01-06 14:39:44 +00:00
Junyu Lai
64c6943777 [MS09] Expose NetworkTemplate APIs which are needed by NetworkPolicy
This change also remove getWifiNetworkKey which should not be exposed
as system API.

Test: atest NetworkTemplateTest
Bug: 204830222
Change-Id: I924f62025a8672167f778ff790cd208c74eed878
2022-01-06 09:22:52 +00:00
Les Lee
d3f1e95245 Merge "wifi data usage: replaced Wi-Fi SSID with a Wi-Fi network key" am: d9862a4d0c am: 154dceeb32 am: 3e524035b9 am: 2e7e0c7894
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1916817

Change-Id: I9e3bc289ac8c3da842e03acd6b7a205371375ab5
2022-01-03 13:12:06 +00:00
Les Lee
d9862a4d0c Merge "wifi data usage: replaced Wi-Fi SSID with a Wi-Fi network key" 2022-01-03 12:36:49 +00:00
Les Lee
6ca5c25bf4 wifi data usage: replaced Wi-Fi SSID with a Wi-Fi network key
1. Used SSID to be a wifi network identity can't separate wifi
data usage when there are two different network with same SSID.
Use a new usage key from WifiInfo to replace wifi SSID to solve
this issue.

2. To support to query wifi usage per configured Wifi network.
Adding matchWifiNetworkKeys in NetworkTemplate to support querying
multi networkKeys wifi data usage since each configured Wifi
network configuration might be used to connect different Wifi
network. (Replace mNetworkId with mMatchWifiNetworkKeys)

3. Updated callers who were using NetworkTemplate constructor.

4. Fixed SortedSet null order case. The null subscriberId is a
valid input for matchSubscriberIds.

5. Replaced ArrayUtils with CollectionUtils.

Bug: 197520752
Bug: 126299427
Test: atest -c NetworkTemplateTest
Test: atest -c NetworkStatsServiceTest
Test: atest -c NetworkPolicyManagerServiceTest
Test: atest -c NetworkPolicyTest
Change-Id: Ie20e7fb56597817901be4ce1d2a7afcbc9ded0c6
2022-01-03 15:13:00 +08:00
Chiachang Wang
e920dac785 Merge "Add configuration whether to exclude local traffic in the VPN" am: 80178db312 am: 0ea8189d38 am: 4974ca5f52 am: ba123cee70
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1926899

Change-Id: I431fe80bf87637e50f1cf3023ac59cad9bc8a05c
2021-12-28 08:24:16 +00:00
Chiachang Wang
80178db312 Merge "Add configuration whether to exclude local traffic in the VPN" 2021-12-28 07:45:20 +00:00
Chiachang Wang
de8c621832 Add configuration whether to exclude local traffic in the VPN
Add a extra variable to store whether the local traffic is
exempted from the VPN.

Bug: 184750836
Test: atest FrameworksNetTests
Change-Id: I70301901c2374ded9fdf179d0ce64e7bb2d7b1ab
2021-12-28 11:14:01 +08:00
Junyu Lai
e30047b059 Merge "[MS15.1] Remove get/setSubscriberIdMatchRule dependencies" am: d159c1ead7 am: d0c50a49e0 am: 157b8f7a3a am: 5dddce9aa2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1926944

Change-Id: I3fc3b45ac97b1f3a60cba1f2700fe7dcd73ad43b
2021-12-23 02:17:58 +00:00
James Mattis
a170912070 Merge changes from topic "railway_stub" am: 9ff27e5802 am: 8a24cce6d2 am: 0b5a0881f3 am: 11a5ed05ef
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1923578

Change-Id: Ibfca187222fca09418668466c3e1b0c19b4d47d4
2021-12-23 02:05:09 +00:00
Junyu Lai
d159c1ead7 Merge "[MS15.1] Remove get/setSubscriberIdMatchRule dependencies" 2021-12-23 01:35:00 +00:00
James Mattis
e350f54f94 aidl and Parcelable defintions for eth management
aidl and Parcelable definitions neccessary for internal network
management APIs as related to ethernet interfaces.

Bug: 210485380
Test: make, flash and boot
Change-Id: I5908d21564014c56282dad001da441f5b900b523
2021-12-22 11:10:58 -08:00
Junyu Lai
ed26feb95c [MS15.1] Remove get/setSubscriberIdMatchRule dependencies
Subscriber Id Match Rule won't be exposed as system Api.
Callers should use Builder#setSubscriberIds or
NetworkTemplate#getSubscriberIds to set/get the Subscriber
Ids filter. An empty set in the paremter or return value
represents the intention of matching any Subscriber Ids.

Test: atest NetworkPolicyManagerServiceTest \
      FrameworksNetTests
Bug: 204830222

Change-Id: I12c54280b44c71e4737e82859dfe869794cc9c29
2021-12-22 09:50:44 +00:00
Treehugger Robot
17832397d1 Merge "[MS14] Move isPersistable to NetworkPolicy" am: f421f1dd68 am: 3c4a90eda1 am: 3dd00d784f am: fe17ca0a4b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1925762

Change-Id: I63fab97dc3c78143854055427c939aa1f6d674c3
2021-12-21 17:24:02 +00:00
Martijn Coenen
c8de979930 Revert "Added a new network capability MMTEL" am: bcfe8037e2 am: 39beeb7b45 am: 7992c40489 am: 8e2325ad42
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1928147

Change-Id: I80959a07d7b7a9a0e7065887da6d180f588c6cb9
2021-12-21 12:29:53 +00:00
Treehugger Robot
3605f59131 Merge changes from topic "mmtel_capability" am: 4b07c1b401 am: 6ab83e6216 am: 764e5d7fae am: 2e7981b69c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1927643

Change-Id: If7b902a414a9dc88fea2d8269747015d57ec28f5
2021-12-21 12:28:54 +00:00
Martijn Coenen
bcfe8037e2 Revert "Added a new network capability MMTEL"
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: Ifd818ba06bc8c6a10bf0393243443d049e5d7503
2021-12-21 11:24:01 +00:00
Junyu Lai
96a19bcaba [MS14] Move isPersistable to NetworkPolicy
Since the NetworkTemplate serialization is done in the platform
code. To decide whether the template is persistable should be
also inside the platform along with the serialization logic.

Test: atest NetworkPolicyTest
Bug: 204830222
Change-Id: I15d17dda77e6a3e1ae11275915e3d2f6e2888639
2021-12-21 10:05:47 +00:00
Jack Yu
f705cb8db6 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: I2c7b291fee3450f588a282f7a252c183c374becf
(cherry picked from commit 1e6438b43a13c27d0f939ec417dc0a84597fe935)
2021-12-16 22:55:52 +00:00
Ayush Sharma
7fd1f1cc2d Merge "Revert "Add APIs that allow to exclude routes from VPN"" am: da37e0f471 am: d48a67e944 am: 05fad87223 am: e41e71aca7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1927301

Change-Id: I2d6f52d4c11e8b3064f816a4a125ada8b344866c
2021-12-16 15:55:07 +00:00
Xiao Ma
d7db702350 Merge "Move Ethernet related files to f/b/packages/ConnectivityT." am: 23b9aec38e am: 7fbed57e5f am: a4ac725170 am: 6aa5b56fe4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1922218

Change-Id: Iad8c9f7597e60682c5b241b5ebacb9d1aad81dcd
2021-12-16 15:30:08 +00:00
Ayush Sharma
da37e0f471 Merge "Revert "Add APIs that allow to exclude routes from VPN"" 2021-12-16 15:01:30 +00:00
Ayush Sharma
487b2e645a 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: I89209357ab4bb206d206adcf9fd6d3498ce6ef4c
BUG: 210979001
2021-12-16 14:40:13 +00:00
Xiao Ma
23b9aec38e Merge "Move Ethernet related files to f/b/packages/ConnectivityT." 2021-12-16 14:12:39 +00:00
Taras Antoshchuk
37479d8fcf Merge "Add APIs that allow to exclude routes from VPN" am: 55f030225b am: 1e2f898c30 am: 0cfd695f07 am: a5d20fcf3c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1619406

Change-Id: I6d0a62140e6d8c525bbf0114b52c3b196a97b9d4
2021-12-16 12:05:50 +00:00
Taras Antoshchuk
55f030225b Merge "Add APIs that allow to exclude routes from VPN" 2021-12-16 11:13:33 +00:00
Xiao Ma
dfed81ffde Move Ethernet related files to f/b/packages/ConnectivityT.
ethernet-service is going to be moved into Connectivity mainline module.
Move all ethernet related files in f/b/ to f/b/packages/ConnectivityT so
that it's easier to migrate these files to Connectivity module finally
after clearing the hidden API usages. Below files to be moved:

Ethernet framework related files:
    - EthernetManager.java
    - EthernetNetworkSpecifier.java
    - IEthernetManager.aidl
    - IEthernetServiceListener.aidl
    - ITetheredInterfaceCallback.aidl

Ethernet service related files:
    - IpConfigStore.java(EthernetConfigStore has dependency on the class)

For the ethernet-service related files, keep it as-is temproraliy and
fix the hiden API dependencies in f/opt/net/ethernet/. After this work
is done, then migrating the whole of ethernet folder to Connectivity
module completely.

This CL also fixes some minor errors of code style format to pass the
code style check.

Bug: 210586283
Test: build pass
      atest FrameworksNetTests
      atest EthernetServiceTests
Change-Id: Ib359d29d5221105f648bc4194c6d6dbe4cc6e3e5
2021-12-16 06:59:08 +00:00
Bernardo Rufino
90bb3709dc Migrate unsafe parcel APIs in framework-minus-apex
Migrate the following unsafe parcel APIs in framework-minus-apex:
* Parcel.readSerializable()
* Parcel.readArrayList()
* Parcel.readList()
* Parcel.readParcelable()
* Parcel.readParcelableList()
* Parcel.readSparseArray()

This CL was generated by applying lint fixes that infer the expected
type from the caller code and provide that as the type parameter
(ag/16365240).

A few observations:
* In some classes we couldn't migrate because the class also belonged to
another build module whose min SDK wasn't current (as is the case for
framework-minus-apex), hence I suppressed the lint check
(since I'll eventually submit the lint check to the tree).
* In some cases, I needed to do the cast in
https://stackoverflow.com/a/1080525/5765705 to make the compiler happy
since there isn't another way of providing a class of type
Class<MyClassWithGenerics<T>>.
* In the readSerializable() case, the new API also requires the class
loader, that was inferred to by InferredClass.class.getClassLoader().
* Note that automatic formatting and import rely on running hooked up
to the IDE, which wasn't the case here.

Bug: 195622897
Test: TH passes
Change-Id: I11a27b9bdab7959ee86e90aa1e1cbebd7aaf883c
2021-12-15 18:21:38 +00:00
Treehugger Robot
a172e37813 Merge "Move IpSec associated files to f/b/packages/ConnectivityT" am: 58093bfdec am: 2f8e4526e5 am: 7e305e3242 am: a7ec763cfe
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1909906

Change-Id: Ia4864df8c20e460a5fe743856e7a9f42f8c6be6b
2021-12-14 09:43:19 +00:00
Aaron Huang
a09ac8b57b Move IpSec associated files to f/b/packages/ConnectivityT
IpSecService is going to be moved into Connectivity mainline module.
Move all ipsec associated files to packages/ConnectivityT so that
it can be easily migrate these files to connectivity module after
clearing the hidden API usages.

Bug: 204153604
Test: build pass
      FrameworksNetTests
      CtsNetTestCases
Change-Id: I562b47f18e345988a2638cf886f86818f9144b91
2021-12-14 14:06:44 +08:00
Taras Antoshchuk
59073f0652 Add APIs that allow to exclude routes from VPN
Add new methods to VpnService.Builder that allow to specify network
routes that should bypass the VPN. Implemented by using RTN_THROW
routes.

Bug: 186082280
Test: atest HostsideVpnTests
Test: atest VpnServiceBuilderTest
Change-Id: Ic3b10464a53a8b56334589acec8f27acdc180ff7
2021-12-13 11:11:00 +01:00
Junyu Lai
456b39de58 Merge "[MS01] Move NetworkTemplate cloud backup functions to NetworkPolicy" am: 40eb40302d am: 895f993439 am: 522e497231 am: b2afbc4490
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1878037

Change-Id: I9a4e8607e9500f427bfad716ddbce0bacd468fd8
2021-12-10 23:20:41 +00:00
Treehugger Robot
79779fcb69 Merge changes from topic "ms07-movestats" am: 942c713c9d am: 6d0a6803c9 am: f626e66561 am: 4e59f54c9e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1895044

Change-Id: Ie8b9eefca78493204ae2d83c1e051f4c2788b5c5
2021-12-10 19:43:44 +00:00
Zhomart Mukhamejanov
1f8b0e54af Merge "Add javadoc to NetworkStats related classes." am: e51a1d0254 am: daa3f0519a am: 7c457bff70 am: a7d3cbaa43
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1917019

Change-Id: Ifcd393b558059c2d153dc2a419b3fe7617004830
2021-12-10 16:26:46 +00:00
Junyu Lai
650ee7a1d1 [MS01] Move NetworkTemplate cloud backup functions to NetworkPolicy
Since NetworkTemplate will be moved into the mainline module.
It is necessary to remove hidden BackupUtil usage from
NetworkTemplate. Also, it is also a hazard to maintain
compatibility for byte buffer interfaces.

Thus, move out these cloud backup functions to NetworkPolicy
to address these concerns.

Test: atest NetworkPolicyTest NetworkPolicyManagerServiceTest
Bug: 204830222
Change-Id: I3ec55f7e419ea13db535acff2457d8e7aaebdce8
2021-12-10 16:11:09 +00:00
Junyu Lai
d82296cf33 [MS08] Move NetworkStats files to f/b/package/ConnectivityT
NetworkStatsService is going to be moved into ConnectivityService
module. Move all related files to packages/ConnectivityT so that
it can be easily migrate these files to connectivity module
after clearing the hidden API usages.

Bug: 197717846
Test: TH
Change-Id: Iead00832b5eb7b1dc40a92027c5a14ae8316b16c
2021-12-10 16:11:08 +00:00