Commit Graph

1238 Commits

Author SHA1 Message Date
Mark Chien
6bc9c8d5be Merge "Add isFeatureEnabled by checking with apex module version" am: eeb15a8c6d am: 4509298603 am: ab0871f6e7
Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/1705174

Change-Id: I82b91dab6fd4aa2787e696cafa7b8fb20f027db8
2021-05-18 10:16:47 +00:00
Mark Chien
1344d523f3 Merge "Add isFeatureEnabled by checking with apex module version" 2021-05-18 03:09:20 +00:00
markchien
c4719cd17a Add isFeatureEnabled by checking with apex module version
A variable of #isFeatureEnabled which check apex module version
instead of apk version.

Bug: 187946226
Test: NetworkStaticLibTests

Change-Id: I4cfc0a68f6ecb7eb9e127b3445b261e0108f6481
2021-05-14 23:39:14 +08:00
junyulai
20df2bf7a7 [FUI26.1] Generalize assertSameElements am: 4fe8286217 am: 75babd3e64 am: 8d7885b554
Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/1618691

Change-Id: Ib6a3137b7cb583a45a1796a0a0138e53cf836bc3
2021-05-14 12:11:01 +00:00
Chiachang Wang
d598031a8e Merge "Replace clearAll with withoutDefaultCapabilities" into sc-dev 2021-05-14 09:32:47 +00:00
Chiachang Wang
3468c1fc8b Replace clearAll with withoutDefaultCapabilities
Update the method to clearer naming as the feedback from API
review.

Bug: 184735772
Test: m
Change-Id: Id0b1df83926352969049a50b3f1af111a4ac603c
Ignore-AOSP-First: Parts of the topic are only available in internal
2021-05-14 08:49:57 +00:00
junyulai
4a73a9f08f [FUI26.1] Generalize assertSameElements
Test: atest NetworkStaticLibTests
Bug: 174123988
Change-Id: I72a33a3c6ba849666e9f892745be3175aeb34b0e
2021-05-14 11:06:18 +08:00
Orion Hodson
059eb44e9f Move to renamed NDK symbol AFileDescriptor_getFd
Ignore-AOSP-First: automerger issue from aosp http://b/187941100#comment11
Bug: 185256332
Test: TH
Change-Id: I77f7551a97d015fe5cc54c053020504f5fb93ab7
2021-05-13 11:16:58 +00:00
Orion Hodson
88dfe23949 Move to renamed NDK symbol AFileDescriptor_getFd
Bug: 185256332
Test: TH
Change-Id: I77f7551a97d015fe5cc54c053020504f5fb93ab7
2021-05-12 09:43:35 +01:00
Chalard Jean
2522de86a3 Support both R and S+ in NetworkFactory
NetworkFactory needs to be backwards compatible as
it is statically linked by the Wifi module, which
needs to run on both R and S.

To achieve this, maintain 2 separate implementations
called NetworkFactoryImpl (S+) and
NetworkFactoryLegacyImpl (R). NetworkFactory itself
becomes a shim that delegates to one of these
implementations depending on the device's SDK version.

Ignore-AOSP-First: Merge in internal first to fix
                   S-on-R test breakages.
Bug: 183902758
Test: ClientModeImplTest
      OemWifiNetworkFactoryTest
      TelephonyNetworkFactoryTest
      UntrustedWifiNetworkFactoryTest
      WifiNetworkFactoryTest
Change-Id: I6a08f39ad1633dd7c1582c362c97821e24ce6683
2021-05-03 23:09:41 -07:00
Pedro Loureiro
d641313cfc Add lint baseline to address NewApi errors
We are enabling a new lint check where the min sdk != compile sdk.
It has produced a lot of errors and adding the baseline file(s)
allows us to continue work without introducing more problems.

Bug: 150847901

Test: m lint-check
Change-Id: I2c38dac481685470af8be115d867953325e75d94
Merged-In: I2c38dac481685470af8be115d867953325e75d94
2021-04-14 10:43:02 +00:00
Pedro Loureiro
d8bb125a4d Add lint baseline to address NewApi errors
We are enabling a new lint check where the min sdk != compile sdk.
It has produced a lot of errors and adding the baseline file(s)
allows us to continue work without introducing more problems.

Bug: 150847901

Test: m lint-check
Change-Id: I2c38dac481685470af8be115d867953325e75d94
Merged-In: I2c38dac481685470af8be115d867953325e75d94
2021-04-14 10:43:02 +00:00
Pedro Loureiro
11ba50b4e4 Merge "Add lint baseline to address NewApi errors" into sc-dev 2021-04-13 14:12:40 +00:00
Pedro Loureiro
86fa055d4a Add lint baseline to address NewApi errors
We are enabling a new lint check where the min sdk != compile sdk.
It has produced a lot of errors and adding the baseline file(s)
allows us to continue work without introducing more problems.

Bug: 150847901

Test: m lint-check
Change-Id: I2c38dac481685470af8be115d867953325e75d94
2021-04-12 10:18:45 +00:00
Xiao Ma
e73ca55962 Add build ICMPv6 echo request packet helper function in Ipv6Utils. am: 657b2e8660 am: 21839bcbdd am: fa4eb167dd
Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/1669829

Change-Id: Id7fd98e9e359d9a6525b3ac2efaafee3b240b07b
2021-04-09 16:50:13 +00:00
Xiao Ma
0d7d45cdef Add build ICMPv6 echo request packet helper function in Ipv6Utils.
Bug: 168868607
Test: atest NetworkStaticLibTests
Change-Id: Ibd3c8348996c8b55767956b03978a69593ec29e7
2021-04-09 18:57:00 +09:00
Chalard Jean
6f20c2dc80 Merge "Make a utility function public." am: a2d81a0e97 am: 5829303877 am: 3051194ba8
Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/1664087

Change-Id: I709c95e31128994db2d72868d133324e4d55ce9d
2021-04-06 09:22:24 +00:00
Lucas Lin
028fdb49f1 Merge "Define TRANSPORT_USB in NetworkCapabilitiesUtils temporarily" into sc-dev 2021-04-06 08:40:25 +00:00
lucaslin
7cfcecc11b Define TRANSPORT_USB in NetworkCapabilitiesUtils temporarily
The new API constant - TRANSPORT_USB didn't in mainline
branch, so the user of TRANSPORT_USB will get build break
when it is built in mainline branch.
Define TRANSPORT_USB in NetworkCapabilitiesUtils temporarily
is a workaround to fix this problem, and it should be removed
once downstream branches are S-based.

Bug: 184158327
Test: m
Change-Id: I83560c75761e7008b457a66296364cb4ce24db50
Ignore-AOSP-First: This should be compiled with ag/14049950.
2021-04-06 09:54:45 +08:00
Chalard Jean
c0d49afba2 Make a utility function public.
...oops ?

Test: m
Change-Id: Ic8f4e7ef430a6fa49f8a477f9d48267b889b83ed
2021-04-05 16:34:18 +09:00
Chalard Jean
c853e34a22 Merge "Add a filter function to CollectionUtils" am: f1e182b5f8 am: 8273e9af8f am: 35c90d6c50
Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/1659981

Change-Id: Ice5d78d052087637601a9bf29ab4217bf2a3e8a7
2021-04-02 10:51:14 +00:00
Remi NGUYEN VAN
20559c08a0 Merge "Allow hidden connectivity APIs in net test utils" into sc-dev 2021-04-02 09:18:29 +00:00
Chalard Jean
9db4048e07 Merge "Add a filter function to CollectionUtils" 2021-04-02 09:04:16 +00:00
Aaron Huang
91f659208d Merge "Move some constants from TrafficStatsConstants to NetworkStackConstants" 2021-04-01 15:59:39 +00:00
Bob Badour
a64434b44d Merge "[LSC] Add LOCAL_LICENSE_KINDS to frameworks/libs/net" 2021-04-01 15:17:01 +00:00
Aaron Huang
47dde914a2 Fix javadoc error am: e8b56bb5a3 am: 43bcbeb7f0 am: 99ff8a1c66
Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/1661679

Change-Id: I2470e999ceac258691257997ef1ac806a8c59252
2021-04-01 10:53:16 +00:00
Remi NGUYEN VAN
2202e61492 Allow hidden connectivity APIs in net test utils
The net test utils are used for unit tests exercising connectivity code,
and need access to its hidden APIs.

Bug: 182859030
Test: atest NetworkStaticLibTests
Ignore-AOSP-First: needs manual cherry-picks
Change-Id: I33273e5c1cc2731443f0fd745ce526473a704520
2021-04-01 06:39:46 +00:00
Bob Badour
5aacbafb88 [LSC] Add LOCAL_LICENSE_KINDS to frameworks/libs/net
Added SPDX-license-identifier-Apache-2.0 to:
  common/testutils/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: If307a41f295d202c3cb8b733ed74af26d3358058
2021-03-31 19:53:56 -07:00
Aaron Huang
9d7cc739ba Fix javadoc error
Test: make doc-comment-check-docs
Change-Id: If0451c2a32a9d7df1f5bb21cc688b9bdc3ce91fa
2021-04-01 10:02:22 +08:00
Chalard Jean
9b3d3cf607 Add a filter function to CollectionUtils
This is generally useful, and specifically useful in
NetworkRanker

Test: Used in NetworkRanker, ConnectivityServiceTest
Change-Id: I896e7e5bcb2931ce43a5b88967bfd6fcd1de0ce2
2021-03-31 19:33:09 +09:00
Aaron Huang
8df2356e1c Reimplement inferRestrictedCapability without new exposed API
Method inferRestrictedCapability() was moved from frameworks/base
to libs/net and it is using an API NetworkCapabilities.getCapabilities()
which is a new exposed API in S. However, the change of moving the
method will downstream to the branches without the new exposed API.
Thus, reimplement this method without new exposed API.

(cherry-picked from ag/14029492)
Bug: 178777253
Bug: 130869457
Test: NetworkStaticLibTests
Merged-In: Ib88fe2b831e968513f221443ed62a09c02150882
Change-Id: Ib88fe2b831e968513f221443ed62a09c02150882
2021-03-31 17:31:00 +08:00
Chiachang Wang
43da8b835e Break the reference for the new added API constant
RESTRICTED_CAPABILITIES was moved from NetworkCapabilities to
frameworks/libs/net. RESTRICTED_CAPABILITIES refers to some
S added NET_CAPABILITIES_* definitions. Replace the constants
definitions with local constants because this git will
downstream to branches without this constants. Downstream will
not be able to find the references in NetworkCapailities and
cause breakage.

Bug: 178777253
Bug: 130869457
Test: m
(cherry-picked from ag/14008231)
Merged-In: I270593c12c1a7ff9f05d3bcd5f6d5647f89efb63
Change-Id: I270593c12c1a7ff9f05d3bcd5f6d5647f89efb63
2021-03-31 17:30:33 +08:00
Aaron Huang
6f35a36c47 Merge "Reimplement inferRestrictedCapability without new exposed API" into sc-dev 2021-03-31 09:27:39 +00:00
Chiachang Wang
4f80496409 Update new capabilities into restricted capabilities
NET_CAPABILITY_VSIM and NET_CAPABILITY_BIP are new restricted
capabiltity for carrier usage. Update them the
RESTRICTED_CAPABILITIES.

Bug: 130869457
Test: m
Change-Id: I20e3cf34634cf0c106560fc4173fcfb91d85724e
Merged-In: I20e3cf34634cf0c106560fc4173fcfb91d85724e
2021-03-31 16:43:53 +08:00
Bob Badour
95e52fde7d [LSC] Add LOCAL_LICENSE_KINDS to frameworks/libs/net am: 739f5fe595
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/libs/net/+/14035538

Change-Id: Ia1912eec12b55b8af10c40dcdf70061dc5950fef
2021-03-31 08:42:55 +00:00
Aaron Huang
d7830e3ddc Move deduceRestrictedCapability to libs/net and rename it
NetworkCapabilities is included in framework-connectivity, so external
module cannot have dependencies on its hidden API. Move the method to
libs/net and rename it to inferRestrictedCapability so that external
module can use it by inculding the library.

Bug: 178777253
Test: FrameworksNetTests
      NetworkStaticLibTests
(cherry-picked from ag/13930236)
Merged-In: I51244048e31699b562b1444d88511e3a3da845ec
Change-Id: I51244048e31699b562b1444d88511e3a3da845ec
2021-03-31 16:42:26 +08:00
Bob Badour
9802148967 [LSC] Add LOCAL_LICENSE_KINDS to frameworks/libs/net
Added SPDX-license-identifier-Apache-2.0 to:
  common/testutils/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: Ib947b1cd6eae235e77cd55d57673360c426e80f1
2021-03-30 22:55:10 -07:00
Aaron Huang
1c9edae84c Reimplement inferRestrictedCapability without new exposed API
Method inferRestrictedCapability() was moved from frameworks/base
to libs/net and it is using an API NetworkCapabilities.getCapabilities()
which is a new exposed API in S. However, the change of moving the
method will downstream to the branches without the new exposed API.
Thus, reimplement this method without new exposed API.

Ignore-AOSP-First: code conflict
Bug: 178777253
Bug: 130869457
Test: NetworkStaticLibTests
Change-Id: Ib88fe2b831e968513f221443ed62a09c02150882
2021-03-31 12:00:08 +08:00
Remi NGUYEN VAN
e4010160f3 Move net-test-utils to its own directory am: 0fb2de46f0 am: 3d9ec0a4b8 am: 8648b9fcba
Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/1654919

Change-Id: I7c71161258167d2ea71a988a1df2f87d9b12c234
2021-03-31 03:44:18 +00:00
Chiachang Wang
e998b8a75a Break the reference for the new added API constant
RESTRICTED_CAPABILITIES was moved from NetworkCapabilities to
frameworks/libs/net. RESTRICTED_CAPABILITIES refers to some
S added NET_CAPABILITIES_* definitions. Replace the constants
definitions with local constants because this git will
downstream to branches without this constants. Downstream will
not be able to find the references in NetworkCapailities and
cause breakage.

Bug: 178777253
Bug: 130869457
Test: m
Change-Id: I270593c12c1a7ff9f05d3bcd5f6d5647f89efb63
Ignore-AOSP-First: code conflict
2021-03-30 17:17:40 +08:00
Remi NGUYEN VAN
be2a07fce3 Move net-test-utils to its own directory
Having the test targets in a different directory allows setting
visibility rules for tests only, which is necessary for access to
targets that should not be used for device builds.

Bug: 182859030
Test: m
Change-Id: Iaf426cf339a97833acf80c941db692329c6e2dcb
2021-03-30 16:52:09 +09:00
junyulai
217801c67d [SP28.2] Add shims to allow test utils built against different SDKs am: ccd68dc9c9 am: ec3c6f19f4 am: 7b7013bd70
Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/1654918

Change-Id: I1eee73c46d02bb18a6c60b3c31492fc64719935b
2021-03-29 12:56:17 +00:00
junyulai
3a6ab33439 [SP28.1] Add onSetWarningAndLimit to test utilities
Test: atest NetworkStatsServiceTest
Bug: 149467454
Bug: 170699770
Bug: 170179169
Merged-In: I4cc242e5fba895bb0756733bafc5be1f39b10ac0
Change-Id: I4cc242e5fba895bb0756733bafc5be1f39b10ac0
  (cherry-picked from ag/13970092)
2021-03-29 16:38:51 +08:00
junyulai
2b6477198d [SP28.2] Add shims to allow test utils built against different SDKs
Test: build pass with or without aosp/1469125 in frameworks/base
Test: atest NetworkStatsServiceTest TetheringTests
Bug: 149467454
Change-Id: Ie3971ed3b18e0f1a54d4834e310bc6df82e5acdd
2021-03-29 16:38:43 +08:00
Lorenzo Colitti
3b90d8ff58 Make TestableNetworkCallback understand blocked reasons. am: 5d4e7a5d36 am: b14d6f3014 am: 205fbfdcb8
Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/1652229

Change-Id: I2c206af4731c30aa2da6489f1ca5d43176d66aea
2021-03-26 05:25:14 +00:00
Chalard Jean
2523a7329c Merge "[NS05] Implement NetworkScore in NetworkFactory" into sc-dev 2021-03-26 05:07:39 +00:00
Chiachang Wang
9a6732f96c Merge "Update new capabilities into restricted capabilities" into sc-dev 2021-03-26 02:38:34 +00:00
Chalard Jean
d1fc0809d8 [NS05] Implement NetworkScore in NetworkFactory
Test: FrameworksNetTests FrameworksWifiTests NetworkStackTests
Change-Id: I6ec7b49bef74b030687c16bce14c2522431018ab
2021-03-25 21:06:22 +09:00
Chiachang Wang
c8925dd672 Update new capabilities into restricted capabilities
NET_CAPABILITY_VSIM and NET_CAPABILITY_BIP are new restricted
capabiltity for carrier usage. Update them the
RESTRICTED_CAPABILITIES.

Bug: 130869457
Test: m
Change-Id: I20e3cf34634cf0c106560fc4173fcfb91d85724e
Ignore-AOSP-First: code conflict
2021-03-25 04:47:15 +00:00
Remi NGUYEN VAN
e8c69746da Merge "Add visibility to net-utils-framework-srcs" into sc-dev 2021-03-25 02:05:07 +00:00