Commit Graph

478 Commits

Author SHA1 Message Date
Junyu Lai
03cbe3f73b Merge "[MS15.1] Remove get/setSubscriberIdMatchRule dependencies" 2021-12-23 01:35:00 +00:00
James Mattis
be91b5831e eth manager updates for network management APIs
Private methods added to EthernetManager for network management to be
made public when ready.

Bug: 210485380
Test: make, flash and boot
Change-Id: I7f484d373e05225c98bf0e6111afdc12be31764f
2021-12-22 11:11:01 -08:00
James Mattis
407ea1dfc3 eth manager updates for network management APIs
Private methods added to EthernetManager for network management to be
made public when ready.

Bug: 210485380
Test: make, flash and boot
Change-Id: I7f484d373e05225c98bf0e6111afdc12be31764f
2021-12-22 11:11:01 -08:00
Frank Li
e25f849545 Merge "[DU02]Remove DevicePolicyManagerInternal from NetworkStatsAccess" am: 00827ef1db am: d45757d038 am: eba1fa16aa am: d7be87b871
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1930817

Change-Id: I9ffa5283c8e1ed1dcb4fb09e4114c30c3e2c1c45
2021-12-22 15:11:21 +00:00
Frank Li
00827ef1db Merge "[DU02]Remove DevicePolicyManagerInternal from NetworkStatsAccess" 2021-12-22 14:13:55 +00:00
Frank Li
6129e19e41 Merge "[DU02]Remove DevicePolicyManagerInternal from NetworkStatsAccess" 2021-12-22 14:13:55 +00:00
Treehugger Robot
8a5f603b8f Merge "Replace Preconditions.checkNotNull with Objects.requireNonNull" am: 2e22d3c35a am: 88cd3b1633 am: ed6b51a52c am: 507e398cdb
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1931581

Change-Id: I23934046bab19a91e827d65b06e94e2740aa3054
2021-12-22 12:34:49 +00:00
Treehugger Robot
2e22d3c35a Merge "Replace Preconditions.checkNotNull with Objects.requireNonNull" 2021-12-22 11:37:42 +00:00
Treehugger Robot
dae874959a Merge "Replace Preconditions.checkNotNull with Objects.requireNonNull" 2021-12-22 11:37:42 +00:00
Junyu Lai
4451b45f70 [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
Junyu Lai
e33b61eed1 [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
Aaron Huang
eb50ef2da7 Replace Preconditions.checkNotNull with Objects.requireNonNull
IpSec service is going to be moved into Connectivity module. Replace
Preconditions.checkNotNull with Objects.requireNonNull to remove
hidden API usages.

Bug: 204153604
Test: FrameworksNetTests
Change-Id: Iff7f76844d4126b0e17b62b4ce821449b5b6ce44
2021-12-22 16:35:13 +08:00
Aaron Huang
49eef6f7e1 Replace Preconditions.checkNotNull with Objects.requireNonNull
IpSec service is going to be moved into Connectivity module. Replace
Preconditions.checkNotNull with Objects.requireNonNull to remove
hidden API usages.

Bug: 204153604
Test: FrameworksNetTests
Change-Id: Iff7f76844d4126b0e17b62b4ce821449b5b6ce44
2021-12-22 16:35:13 +08:00
Treehugger Robot
706c472f3f Merge "[MS14] Move isPersistable to NetworkPolicy" am: b6d02f2cc0 am: 9eff138160 am: 3541c40966 am: f9610bf122
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1925762

Change-Id: I63fab97dc3c78143854055427c939aa1f6d674c3
2021-12-21 17:24:02 +00:00
Treehugger Robot
b6d02f2cc0 Merge "[MS14] Move isPersistable to NetworkPolicy" 2021-12-21 16:09:25 +00:00
Treehugger Robot
1a87666268 Merge "[MS14] Move isPersistable to NetworkPolicy" 2021-12-21 16:09:25 +00:00
Treehugger Robot
dddcce6e5e Merge "[MS12.1] Support NetworkTemplate builder" am: 6609167efe am: 4aabc795be am: 39a95e9ca0 am: 13ab47df6b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1926897

Change-Id: I18a089195fa49826906164b9cad0dbd0772df844
2021-12-21 15:52:08 +00:00
Treehugger Robot
6609167efe Merge "[MS12.1] Support NetworkTemplate builder" 2021-12-21 15:09:43 +00:00
Treehugger Robot
f19315b821 Merge "[MS12.1] Support NetworkTemplate builder" 2021-12-21 15:09:43 +00:00
Aaron Huang
64e55dd995 Merge "Make IpSecManager.DIRECTION_FWD @SystemApi" am: d793de23f0 am: 17ffcd98da am: 61b4ad626d am: f4575e5b4e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1928463

Change-Id: Id0f002e61d5fa6df4e3712b22e1911e4acce2b43
2021-12-21 14:01:09 +00:00
Aaron Huang
d793de23f0 Merge "Make IpSecManager.DIRECTION_FWD @SystemApi" 2021-12-21 12:49:49 +00:00
Aaron Huang
1c19199b62 Merge "Make IpSecManager.DIRECTION_FWD @SystemApi" 2021-12-21 12:49:49 +00:00
Junyu Lai
682bebbf60 [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
Junyu Lai
99d26987fd [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
Junyu Lai
2c94410620 [MS12.1] Support NetworkTemplate builder
In current design, NeworkTemplate has a lot of buildTemplate*
functions to create various type of templates. These functions
do not have any flexibility to add any dimension. Thus, if
there is a need to add a dimension, the typical ways are:
  1. Add one parameter to the buildTemplate* function and change
     all callers.
  2. Use the NetworkTemplate constructors directly. And add one
     more parameter if it doesn't fulfill the needs.

These codes are painful to maintain in the future if they are
exposed as system api since they are lack of flexibility. Thus,
introduce a builder class to NetworkTemplate to address this
problem.

Test: atest NetworkTemplateTest
Bug: 204830222
Change-Id: I49fab236bac392563b1290d69573ad1415fda734
2021-12-21 10:05:36 +00:00
Junyu Lai
83743a72de [MS12.1] Support NetworkTemplate builder
In current design, NeworkTemplate has a lot of buildTemplate*
functions to create various type of templates. These functions
do not have any flexibility to add any dimension. Thus, if
there is a need to add a dimension, the typical ways are:
  1. Add one parameter to the buildTemplate* function and change
     all callers.
  2. Use the NetworkTemplate constructors directly. And add one
     more parameter if it doesn't fulfill the needs.

These codes are painful to maintain in the future if they are
exposed as system api since they are lack of flexibility. Thus,
introduce a builder class to NetworkTemplate to address this
problem.

Test: atest NetworkTemplateTest
Bug: 204830222
Change-Id: I49fab236bac392563b1290d69573ad1415fda734
2021-12-21 10:05:36 +00:00
lifr
155cb5cced [DU02]Remove DevicePolicyManagerInternal from NetworkStatsAccess
NetworkStatsAccess is using DevicePolicyManagerInternal APIs, which
cannot be accessed after moving into the mainline module. So, replace
and remove those hidden API usages.

Bug: 207100745
Test: atest NetworkStatsAccessTest
Change-Id: I0802148050869d92e1f09d1d657034380029f236
2021-12-21 11:31:44 +08:00
lifr
65a9927deb [DU02]Remove DevicePolicyManagerInternal from NetworkStatsAccess
NetworkStatsAccess is using DevicePolicyManagerInternal APIs, which
cannot be accessed after moving into the mainline module. So, replace
and remove those hidden API usages.

Bug: 207100745
Test: atest NetworkStatsAccessTest
Change-Id: I0802148050869d92e1f09d1d657034380029f236
2021-12-21 11:31:44 +08:00
Junyu Lai
75c8846346 Merge "[MS10.1] Move multiplySafeByRational to NetworkStatsUtils" am: 9105163c65 am: ea23644145 am: f0a8f35ba4 am: 0f63403caa
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1920477

Change-Id: I4d415add75f300bd01ecfeb231c9edd9892b4d1f
2021-12-21 02:04:30 +00:00
Junyu Lai
9105163c65 Merge "[MS10.1] Move multiplySafeByRational to NetworkStatsUtils" 2021-12-21 01:22:14 +00:00
Junyu Lai
0012291184 Merge "[MS10.1] Move multiplySafeByRational to NetworkStatsUtils" 2021-12-21 01:22:14 +00:00
Junyu Lai
3ba6eb54f0 Merge "[MS05] Fix NetworkTemplate lint errors" am: 06bba324a8 am: 450e23e5e1 am: a8e70c3e5e am: ef31581199
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1886877

Change-Id: I1521f16148527ddfd8a816419d721c1fe74d660f
2021-12-20 13:22:02 +00:00
Junyu Lai
46429b7ded [MS10.1] Move multiplySafeByRational to NetworkStatsUtils
Since NetworkStats related code will be moved to the module.
multiplySafeByRational in the NetworkUtilsInternal cannot be
accessed after that. Thus, create another utils class that
will be moved with NetworkStats code and put the function
into it.

Test: atest NetworkStaticLibTests:com.android.net.moduletests.util.NetworkStatsUtilsTest
Bug: 204830222
Change-Id: I96f3ac02e57b7325ed53988285770f478dee529e
2021-12-20 09:12:13 +00:00
Junyu Lai
da74dda132 [MS10.1] Move multiplySafeByRational to NetworkStatsUtils
Since NetworkStats related code will be moved to the module.
multiplySafeByRational in the NetworkUtilsInternal cannot be
accessed after that. Thus, create another utils class that
will be moved with NetworkStats code and put the function
into it.

Test: atest NetworkStaticLibTests:com.android.net.moduletests.util.NetworkStatsUtilsTest
Bug: 204830222
Change-Id: I96f3ac02e57b7325ed53988285770f478dee529e
2021-12-20 09:12:13 +00:00
Junyu Lai
051de2cd49 [MS05] Fix NetworkTemplate lint errors
This change also defines some IntDef annotations that will
be used in the follow-up CLs.

Test: TH
Bug: 204830222
Change-Id: Iba5e714a1304fdfd154379415dcc5d0f9b7b1b29
2021-12-20 15:17:16 +08:00
Junyu Lai
7f3d5187a0 [MS05] Fix NetworkTemplate lint errors
This change also defines some IntDef annotations that will
be used in the follow-up CLs.

Test: TH
Bug: 204830222
Change-Id: Iba5e714a1304fdfd154379415dcc5d0f9b7b1b29
2021-12-20 15:17:16 +08:00
Aaron Huang
30a2b03042 Make IpSecManager.DIRECTION_FWD @SystemApi
IpSecManager.DIRECTION_FWD is used by VcnGatewayConnection and
it will be not visible to platform after IpSec was moved into
Connectivity mainline module. Therefore, make DIRECTION_FWD
@SystemApi so that it can be used by VcnGatewayConnection.

Bug: 204153604
Test: FrameworksNetTests
Change-Id: I80dc2a5b4940504820cee0d8e2d2e59ef3fcca18
2021-12-19 02:44:24 +08:00
Aaron Huang
4989e95a08 Make IpSecManager.DIRECTION_FWD @SystemApi
IpSecManager.DIRECTION_FWD is used by VcnGatewayConnection and
it will be not visible to platform after IpSec was moved into
Connectivity mainline module. Therefore, make DIRECTION_FWD
@SystemApi so that it can be used by VcnGatewayConnection.

Bug: 204153604
Test: FrameworksNetTests
Change-Id: I80dc2a5b4940504820cee0d8e2d2e59ef3fcca18
2021-12-19 02:44:24 +08:00
Treehugger Robot
052f8b350c Merge "Remove unused import in IpSecAlgorithm" am: c6b33a78bf am: 76984818e3 am: a0b5d41a75 am: ecfb320f60
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1924059

Change-Id: Id24b8392131926562534c4cce9f962babc4b7ba3
2021-12-16 22:51:27 +00:00
Treehugger Robot
c6b33a78bf Merge "Remove unused import in IpSecAlgorithm" 2021-12-16 20:45:17 +00:00
Treehugger Robot
62077d8f82 Merge "Remove unused import in IpSecAlgorithm" 2021-12-16 20:45:17 +00:00
Aaron Huang
a2a6b960a3 Remove unused import in IpSecAlgorithm
HexDump is an internal class which cannot be visible to mainline
module. Remove it since this is unused.

Bug: 204153604
Test: FrameworksNetTests
Change-Id: Ie65e7eff8464487719c3124005a097a500ba21c6
2021-12-16 17:36:10 +00:00
Aaron Huang
0464e77c3c Remove unused import in IpSecAlgorithm
HexDump is an internal class which cannot be visible to mainline
module. Remove it since this is unused.

Bug: 204153604
Test: FrameworksNetTests
Change-Id: Ie65e7eff8464487719c3124005a097a500ba21c6
2021-12-16 17:36:10 +00:00
Treehugger Robot
8b7f99f4d2 Merge "Remove isUnsafeBuild() from IpSecAlgorithm" am: ed3a5226ed am: db38285cf8 am: 4886dddd43 am: 844332044c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1922077

Change-Id: Ic33d91ba80113bc4e81e8e2ecb9322596a1639c7
2021-12-16 15:31:17 +00:00
Xiao Ma
371a5ea5a1 Merge "Move Ethernet related files to f/b/packages/ConnectivityT." am: 84f212ded1 am: 3190e7cc92 am: 9a735b3dd0 am: 5266f9e9d6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1922218

Change-Id: Iad8c9f7597e60682c5b241b5ebacb9d1aad81dcd
2021-12-16 15:30:08 +00:00
Treehugger Robot
ed3a5226ed Merge "Remove isUnsafeBuild() from IpSecAlgorithm" 2021-12-16 14:16:50 +00:00
Treehugger Robot
473df031d7 Merge "Remove isUnsafeBuild() from IpSecAlgorithm" 2021-12-16 14:16:50 +00:00
Xiao Ma
84f212ded1 Merge "Move Ethernet related files to f/b/packages/ConnectivityT." 2021-12-16 14:12:39 +00:00
Xiao Ma
9cb7b5dc65 Merge "Move Ethernet related files to f/b/packages/ConnectivityT." 2021-12-16 14:12:39 +00:00
Junyu Lai
b40efcd54c Merge "[MS03] Remove ServiceNotFoundException hidden API usage" am: a9f47b7aaa am: 8cd72998e1 am: 5b1d25ce3f am: c8aa26e71b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1878043

Change-Id: Ie5bd0130a07d015e464090d546fc625589272def
2021-12-16 11:48:43 +00:00