Commit graph android_packages_modules_Co.../core/java/android
Message SHA1
Merge "Add metered filter for API: buildTemplateCarrier" am: 7486607f4b am: 937568499f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1699687

Change-Id: I46d8d8f0d9b83fb0a817a3455cbbc28d558b871c

Les Lee   authored and   Automerger Merge Worker   commited 2021-05-18 13:57:06 +00:00
b93cccec91
Merge "Add metered filter for API: buildTemplateCarrier"
Les Lee   authored and   Gerrit Code Review   commited 2021-05-18 13:01:38 +00:00
7486607f4b
Merge changes I3ba50cbd,I970ee365 am: 37f2408143 am: 2710ae1348
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1620859

Change-Id: If9a3e37e5359b955e330002d81cbeb48f90ee22b

Junyu Lai   authored and   Automerger Merge Worker   commited 2021-05-15 17:24:42 +00:00
9e02177f83
[FUI27] Fix internal naming of notifyNetworkStatus
Test: TH
Bug: 174123988
Change-Id: I970ee365ca221956ee85788005d331374b5fa71a

junyulai   commited 2021-05-14 19:48:17 +08:00
4e56bc1c93
Rename *Iface* APIs to *Interface*
Address API review feedback, other APIs have been refering to
these as "interface" instead of "iface" so migrate the APIs named
*Iface* to *Interface*.

(cherry-picked from ag/14326779)
Bug: 183972554
Test: atest android.net.UnderlyingNetworkInfoTest
Merged-In: I38b476e762fb57fa88c4a789092d0af6f5330d80
Change-Id: I38b476e762fb57fa88c4a789092d0af6f5330d80

Aaron Huang   commited 2021-05-14 11:05:22 +08:00
a266a9855c
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

lesl   authored and   Les Lee   commited 2021-05-14 11:04:17 +08:00
c9e6c56067
Merge "Add return type javadoc to NetworkStateSnapshot#getLegacyType" into sc-dev
Aaron Huang   authored and   Android (Google) Code Review   commited 2021-05-12 05:11:45 +00:00
2ed83a71ee
Merge changes from topic "vcn-fwd" am: d7d2d2a15b am: fc14eeaf35 am: 07806ad6be
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1682047

Change-Id: I745687f69366657dc33bfdacd878e06affd6a8ec

Benedict Wong   authored and   Automerger Merge Worker   commited 2021-05-11 06:10:32 +00:00
70f1aab8c7
Add return type javadoc to NetworkStateSnapshot#getLegacyType
Add javadoc to document the return type is the legacy network
type in getLegacyType.

Bug: 183972826
Test: only update javadoc
Change-Id: I7757253af5955f7d489d6349c090dcba146cfd7f

Aaron Huang   commited 2021-05-10 23:18:41 +08:00
ba8093a22e
Add internal support for IPsec forward policies
This change adds support for IPsec forward policies, which are necessary
for packets to be allowed to be forwarded to another interface, as is
the case with tethering. This is necessary and useful only within the
system server, and as such is not exposed as a public API.

This change is safe, since the addition of a FWD policy on IPsec tunnel
interfaces will by default block forwarded traffic (as would be the case
without this patch). In the event that the (system) owner of the tunnel
requires support for forwarded packets (eg tethering), this patch allows
application of transforms in the FWD direction as well.

This will be used to ensure that the VCN can be used as the underlying
network for the purposes of tethering.

Bug: 185495453
Test: atest IpSecServiceTest
Test: atest IpSecServiceParameterizedTest
Test: manual testing with tethering over VCN
Change-Id: I74ecea71f1954029f6fbdbe34598c82e0aac386b

Benedict Wong   commited 2021-05-07 15:09:42 -07:00
908d34edcb
Merge "Add getters to NetworkStateSnapshot"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-04-29 09:20:34 +00:00
3bcc77078c
Merge "Add getters to UnderlyingNetworkInfo"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-04-29 07:29:08 +00:00
05d884470a
Rename *Iface* APIs to *Interface*
Address API review feedback, other APIs have been refering to
these as "interface" instead of "iface" so migrate the APIs named
*Iface* to *Interface*.

Bug: 183972554
Test: atest android.net.UnderlyingNetworkInfoTest
Change-Id: I38b476e762fb57fa88c4a789092d0af6f5330d80

Aaron Huang   commited 2021-04-28 17:57:32 +08:00
c6e149a977
Merge "wifi data usage: support to get carrier merged wifi network." am: bef2f5be94 am: e0f1f83446 am: 1f366a8365
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1538743

Change-Id: Ie55770f885bf3c917ad485d2bd8c025b676f12b6

Les Lee   authored and   Automerger Merge Worker   commited 2021-04-27 06:00:48 +00:00
3f3865873d
Add getters to UnderlyingNetworkInfo
Address API review feedback, add getters to UnderlyingNetworkInfo
instead of exposing fields.

Instead of wasting memory by converting this into an array, have
migrateTun take a List<String>. In turn, tunAdjustmentInit should
also take a List<String>.

(cherry picked from ag/14211075)
Bug: 183972554
Test: atest android.net.UnderlyingNetworkInfoTest
Merged-In: Id59744097208d91298a25ef110ade91a9cf291a1
Change-Id: Id59744097208d91298a25ef110ade91a9cf291a1

Aaron Huang   commited 2021-04-22 22:30:42 +08:00
433fb498b5
Add getters to NetworkStateSnapshot
Address API council feedback, add getters to NetworkStateSnapshot
instead of exposing the bare fields directly.

(cherry picked from ag/14233655)
Bug: 183972826
Test: FrameworksNetTests
Merged-In: Id1707753b42ae88d2b95e4bd00a792609434e4f5
Change-Id: Id1707753b42ae88d2b95e4bd00a792609434e4f5

Aaron Huang   commited 2021-04-22 18:21:00 +08:00
955a1a50df
Merge "Add getters to UnderlyingNetworkInfo" into sc-dev
Aaron Huang   authored and   Android (Google) Code Review   commited 2021-04-22 03:09:41 +00:00
360973e00a
Add getters to NetworkStateSnapshot
Address API council feedback, add getters to NetworkStateSnapshot
instead of exposing the bare fields directly.

Bug: 183972826
Test: FrameworksNetTests
Change-Id: Id1707753b42ae88d2b95e4bd00a792609434e4f5

Aaron Huang   commited 2021-04-20 21:55:56 +08:00
444fcb9d56
Add getters to UnderlyingNetworkInfo
Address API review feedback, add getters to UnderlyingNetworkInfo
instead of exposing fields.

Instead of wasting memory by converting this into an array, have
migrateTun take a List<String>. In turn, tunAdjustmentInit should
also take a List<String>.

Bug: 183972554
Test: atest android.net.UnderlyingNetworkInfoTest
Change-Id: Id59744097208d91298a25ef110ade91a9cf291a1

Aaron Huang   commited 2021-04-20 13:34:52 +08:00
8a74c1ff1d
wifi data usage: support to get carrier merged wifi network.
Carrier merged wifi network is a specific cerrier wifi network
which provides the same user experience as mobile.

To support data usage accounting for carrier merged wifi,
the change provide several APIs in NetworkTemplate:

  1. extend buildTemplateWifi so it could be used for matching
     wifi networks with subscriber Id (IMSI).
  2. add buildTemplateCarrier to let
     NetworkPolicyManagerService creates a single policy for
     a given carrier regardless of network type.

Bug: 176396812
Test: atest -c NetworkTemplateTest
Test: atest -c NetworkStatsServiceTest
Test: Manual Test with test code on mobile and wifi network.
      1. buildTemplateCarrier includes the carrier wifi and
         mobile usage
      2. buildTemplateWifi can get carrier wifi usage and support the
         filter via subscriberId

Change-Id: I667b4adf3eec0bdd3a7385109dd8c1fae8e7be32

lesl   commited 2021-04-19 16:13:27 +08:00
b2cd0b9e57
Merge "Rename FIRST_SDK_INT to DEVICE_INITIAL_SDK_INT" into sc-dev
Paul Hu   authored and   Android (Google) Code Review   commited 2021-04-13 02:05:21 +00:00
378712e2d0
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
Change-Id: I72660959cb4e638a8e80fcf2f4e96ea172969f44

paulhu   commited 2021-04-09 15:47:36 +08:00
f7633ac09c
Add documentation on EthernetNetworkSpecifier API
Add javadoc on the constructor and getInterfaceName method.

Fixes: 182979732
Test: m
Change-Id: Iced805149a8344b953331501b48184661be0053a

Remi NGUYEN VAN   commited 2021-04-08 15:32:08 +09:00
212d6930cc
Fix Wi-Fi SSID null handling
When Wi-Fi SSID is null in NetworkCapabilities,
get Wi-Fi SSID from connection info (WifiInfo) which is non-null design.

Bug: 176396812
Test: FrameworksNetTests NetworkPolicyManagerServiceTest
Change-Id: I59c7d8f7e176d0c6bb100721269f3f6165f0ca21

lesl   commited 2021-03-30 23:57:56 +08:00
1c4cd5c1d8
[SP31] Expose onSetWarningAndLimit System API
Test: atest NetworkPolicyManagerServiceTest NetworkStatsServiceTest
Bug: 149467454
CTS-Coverage-Bug: 183598414
Merged-In: I6f5e22e3a7b80a38cae9f3c5d7296a1dff34facf
Change-Id: I6f5e22e3a7b80a38cae9f3c5d7296a1dff34facf
  (cherry-picked from ag/13981689)

junyulai   commited 2021-03-25 09:32:43 +08:00
47597b92ab
[SP28] Add API for set data warning
To have better control and race-free of set data warning
to tether offload hardware, an interface of set warning and
limit at the same time in the NetworkStatsProvider is needed.

This is a no-op change which expose such interface with minimum
changes in service side to get build pass. The implementation
would be included in follow-up patches.

Test: atest NetworkStatsServiceTest
Test: atest NetworkPolicyManagerServiceTest
Test: atest GtsNetworkStackHostTestCases
Test: m doc-comment-check-docs
Bug: 149467454
Bug: 170699770
Bug: 170179169
Merged-In: I6ee661497f7dedb871c85786d1950cab951d8aa2
Change-Id: I6ee661497f7dedb871c85786d1950cab951d8aa2
  (cherry-picked from ag/13959436)

junyulai   commited 2021-03-24 22:48:26 +08:00
d66c225def
Merge "Annotate NSM heavy methods with @WorkerThread"
Chalard Jean   authored and   Gerrit Code Review   commited 2021-03-17 02:03:22 +00:00
e096339dc3
Add Ethernet, TestNetworkSpecifier API
Rename StringNetworkSpecifier to EthernetNetworkSpecifier (its only
production user), and make it module-lib API.
The original StringNetworkSpecifier file is actually kept to satisfy
some invalid dependencies; it will be removed separately.

This allows specifying an Ethernet interface with a non-deprecated API:
until this change the only way to do so would be to use
NetworkRequest#setSpecifier(String), which is deprecated.

Similarly, add the TestNetworkSpecifier API for TestNetworkManager, to
replace previous usage of StringNetworkSpecifier. TestNetworkManager is
module API, so TestNetworkSpecifier should be module API too. This
allows tests to request the test interface specifically, without using
the deprecated NetworkRequest#setSpecifier(String).

Bug: 179329291
Test: m
Merged-In: Iee569f5c8bbdc4bc979610e1191308281f3d4620

Change-Id: Iee569f5c8bbdc4bc979610e1191308281f3d4620

Remi NGUYEN VAN   authored and   junyulai   commited 2021-03-11 23:02:02 +08:00
65949518fa
Annotate NSM heavy methods with @WorkerThread
Test: TH
Bug: 181906747
Change-Id: Ia30273466c1b91a3dcc5d36dac61f92185dec96e

Chalard Jean   commited 2021-03-11 10:47:46 +00:00
63595c6f88
Remove unused buildNetworkIdentity
The overload using a NetworkState is now unused.

Bug: 174123988
Change-Id: I22f2d2fffd2d70c08097d3217f01393ff8e75ab5
Test: m

Remi NGUYEN VAN   commited 2021-03-09 09:31:21 +00:00
872fe3f815
Merge "[FUI22] Support getAllNetworkStateSnapshot"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-03-05 05:16:43 +00:00
89f7c5570a
Merge "Revert "Use VERSION_CODES.S instead of VERSION_CODES.R + 1""
Yan Yan   authored and   Gerrit Code Review   commited 2021-03-05 02:30:21 +00:00
d032de0ecd
Revert "Use VERSION_CODES.S instead of VERSION_CODES.R + 1"
This reverts commit 272ee7c909.

Reason for revert:
1. The BUILD_VERSIONS.S is 1000, and thus it will prevent
   the code from requiring new algorithms on devices whose
   first sdk is 31 (e.g. cuttlefish), though these devices
   should be treated as first launched with SDK S.
2. It will break #testValidationForAlgosAddedInS, because
   the test code is using BUILD_VERSIONS.R to gate the test,
   which is inconsistent with the implementation.

Bug: 181887451
Test: atest IpSecAlgorithmTest
Change-Id: I5cd717c5ebd6086ae5cf9abf76311ae4fca0c6e9

Yan Yan   commited 2021-03-05 00:15:15 +00:00
88f5da0903
[FUI22] Support getAllNetworkStateSnapshot
Currently, ConnectivityService has getAllNetworkState but it is
not ideal to expose as system API since the plan is to get rid
of NetworkState. Thus, create a new one that returns
NetworkStateSnapshot to fulfill the needs.

Note the original getAllNetworkState cannot be deleted now since
it has @UnsupportedAppUsage annotation.

Test: atest FrameworksNetTests
Bug: 174123988
Change-Id: Icddd434552b0e9ecbc8299e7242ec88cf3145aca

junyulai   commited 2021-03-04 18:41:09 +08:00
41c85f50c4
Merge "Use VERSION_CODES.S instead of VERSION_CODES.R + 1"
Yan Yan   authored and   Gerrit Code Review   commited 2021-03-03 18:04:52 +00:00
90b5d871e1
[FUI18] Expose notifyNetworkStatus as system API
Test: m -j doc-comment-check-docs
Bug: 174123988
Merged-In: I11d4c9ab24de87fb2ad120e3787b78b73133e874
Change-Id: I11d4c9ab24de87fb2ad120e3787b78b73133e874
  (cherry-picked from ag/13749978)

junyulai   commited 2021-03-03 20:01:46 +08:00
f72320776d
Merge "Support new IpSecAlgorithm AUTH_AES_CMAC"
Yan Yan   authored and   Gerrit Code Review   commited 2021-03-02 18:24:27 +00:00
d3a444609a
Merge "[FUI09] Expose NetworkStateSnapshot as system API"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-03-02 16:08:03 +00:00
c061f0053e
[FUI09] Expose NetworkStateSnapshot as system API
This is needed by NetworkStatsService and
NetworkPolicyManagerService to utilize the snapshots of
information of networks that grabbed from ConnectivityService.

Test: atest FrameworksNetTests NetworkPolicyManagerServiceTest
Bug: 174123988
Change-Id: I7e974ef7b23ba9ba6ee775eed9899b0c0e2eca55

junyulai   commited 2021-03-02 23:09:16 +08:00
7c17de401b
Merge "[FUI17] Migrate NetworkStatsService to use NetworkStateSnapshot"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-03-02 13:21:32 +00:00
1ad27ef2a1
[FUI17] Migrate NetworkStatsService to use NetworkStateSnapshot
This change migrates NetworkStatsService and related code to use
NetworkStateSnapshot which is used for replacing the NetworkState.

This patch also changes some formating which is suggested by
the linter.

Test: FrameworksNetTests NetworkPolicyManagerServiceTest
Bug: 174123988
Change-Id: I547da8f411cb45bdadc376ac3cadf3f3c55bb282

junyulai   commited 2021-03-02 20:08:53 +08:00
125631330d
Move UidRange to connectivity
UidRange is a data class that is an implementation detail of
Connectivity. Move it to the connectivity boundary.

Remaining usages of UidRange outside of Connectivity (in VPN) should be
migrated to other classes, like Range<Integer> or UidRangeParcel.

Bug: 181512874
Test: m
Change-Id: I6f2e3685ad1c07171dd90480d1e546329de8732d

Remi NGUYEN VAN   commited 2021-03-02 15:35:36 +09:00
1bc09ccb14
Merge "[FUI08] Create NeworkStateSnapshot"
Junyu Lai   authored and   Gerrit Code Review   commited 2021-02-26 10:53:36 +00:00
18f51bd23d
[FUI08] Create NeworkStateSnapshot
Since NetworkState has UnsupportedAppUsage APIs that cannot
be changed, create another class for follow-up patches
to expose as system API.

Test: NetworkStateSnapshotTest
Bug: 174123988
Change-Id: I54ef872847f34166aa34a79f6178c90ac12b6c72

junyulai   commited 2021-02-26 11:57:06 +08:00
8f1eb24a94
Merge "Add support for tracking PANS data usage"
Chris Weir   authored and   Gerrit Code Review   commited 2021-02-25 21:37:42 +00:00
dbedad0dd5
Use VERSION_CODES.S instead of VERSION_CODES.R + 1
Bug: 170424293
Test: IpSecAlgorithmTest
Change-Id: I4662b0d43c476b744536a41000d578e8b69286ef

Yan Yan   commited 2021-02-25 10:40:24 -08:00
272ee7c909
Support new IpSecAlgorithm AUTH_AES_CMAC
Bug: 161716062
Test: IpSecAlgorithmTest, verified with CTS
Change-Id: Ideaf4225bd851fad8c8072505c6ad99d85ba616e

Yan Yan   commited 2021-02-25 10:35:10 -08:00
f72b01527f
Add support for tracking PANS data usage
Adds support for tracking oemManagedNetwork types (OEM_PAID and
OEM_PRIVATE).

Bug: 174485293
Test: atest NetworkTemplateTest NetworkStatsCollectionTest
NetworkStatsObserversTest NetworkStatsServiceTest NetworkIdentityTest
Test: verify that the bytes go up in PansTest app only when
`ping -I eth2 8.8.8.8` is run as root.

Change-Id: I78660a835f16265ba8e44bb84332c6633dd72b84

Chris Weir   commited 2021-02-17 20:32:53 -08:00
f8f291cb7b
Split parcelable .aidl files to aidl-export
The one-line "parcelable X" files need to be imported by targets that do
not build against SDK (the SDK has prebuilt definitions), so prepare a
dedicated directory for them.
This avoids having users of the classes include the whole src/
directory, which could contain definitions for classes that are not part
of the public API, so should not be imported.

Also move back to frameworks/base/core some .aidl definitions that
were separated from their associated class.

Bug: 171540887
Test: m
Merged-In: I7432fe4c87cd3cab04dcb6185c9a4f3f84376549
Change-Id: I7432fe4c87cd3cab04dcb6185c9a4f3f84376549

Remi NGUYEN VAN   commited 2021-02-18 01:17:04 +00:00
037a730efd
[API] Expose IpSecTunnelInterface#setUnderlyingNetwork
This API is required to perform MOBIKE. This API allows an IPsec
peer to change the underlying network of its established IPsec
tunnel without re-establishing the tunnel.

Bug: 169855650
Test: atest IpSecManagerTunnelTest (new tests added)
Change-Id: Ifc8ad902cbfbe4ad07e715f2fef0faa1bf9d68f3

Yan Yan   commited 2021-02-10 14:52:18 -08:00
441e35f612