Commit Graph

3748 Commits

Author SHA1 Message Date
Aaron Huang
c4f95e136a Merge "Check iface by TextUtils.equals" am: 6b1e9e63cb
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1946587

Change-Id: Id8fc2d7463688eab87259a310492d6a5c02c8a7a
2022-02-22 11:30:00 +00:00
Aaron Huang
6b1e9e63cb Merge "Check iface by TextUtils.equals" 2022-02-22 09:48:08 +00:00
Maciej Żenczykowski
94b0f2ff81 Merge "Fix system_server crash while iterating CookieTagMap" am: dd5a31eb2d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1990333

Change-Id: I04bd616a62ba77219c0ae812d2337e474b1fe2c2
2022-02-19 22:03:23 +00:00
markchien
c4cfd83ad4 Fix system_server crash while iterating CookieTagMap
When uid is removed, NetworkStatsService will iterate CookieTagMap and
delete the corresponded uid socketTag value. But not only
NetworkStatsService would detete CookieTagMap entries. There are other
threads may also delete CookieTagMap entries such as #unTagSocket in
bpfHandler and desctroy socket listener in TrafficController. System
server crash as NPE because the CookieTagMap entry it iterate just be
removed by other threads at the same time. This is just a simple fix to
prevent the crash. Will have follow up CL for formal fix.

Bug: 220084230
Test: m
Change-Id: I08cad87f537fb09499faf1ff5cfd443fcb8ce436
2022-02-18 10:11:15 +00:00
Patrick Rohr
a78828383b Merge "Replace qtaguid_deleteTagData with java implementation" am: 66c59866c2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1969203

Change-Id: I8737beca8dfe0bf6cd4b3a117fc2c1b856592c8a
2022-02-16 20:35:22 +00:00
Patrick Rohr
66c59866c2 Merge "Replace qtaguid_deleteTagData with java implementation" 2022-02-16 19:59:14 +00:00
Treehugger Robot
cc39a55bcd Merge "Fix grammar nit in comment." am: 5870ba5ace
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1981670

Change-Id: I0dc66f1e7cbe99ac575f834bbb2b49bdf849dcea
2022-02-16 15:16:55 +00:00
Xin Li
3e53b35a7d Merge "Merge sc-v2-dev-plus-aosp-without-vendor@8084891" into stage-aosp-master 2022-02-14 17:30:12 +00:00
Lorenzo Colitti
e9d7dfd6a6 Merge "Expose EthernetManager state and control APIs." am: 212e17e6ac
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1968559

Change-Id: I4ee521da4bc1e71fd577092ef6313d048f253663
2022-02-12 05:04:55 +00:00
Lorenzo Colitti
6c032e53a0 Fix grammar nit in comment.
Test: None
Change-Id: I60cb2478615efce13f1904092abe5c21bdf0dc9a
2022-02-11 18:50:04 +09:00
Xiao Ma
7f9ac50065 Expose EthernetManager state and control APIs.
This CL exposes EthernetManager APIs that settings and other
system components can use to modify and monitor Ethernet state.
The new APIs are similar to the existing @hide methods but
pass on more information and meet API guidelines:

1. Add an InterfaceStateListener interface, and
   addInterfaceStateListener and removeInterfaceStateListener
   methods that meet API guidelines (e.g., take Executor, take
   SAM parameter last, etc.) This new listener passes interface
   state (absent, up, down), role (client or server) and IP
   configuration.
2. Implement the legacy Listener type as a subinterface of the
   new interface. Hopefully existing callers should be able to
   use it unchanged.
3. Expose setIncludeTestInterfaces as module-lib api instead of
   TestApi, since modules cannot expose TestApi methods.

Bug: 210586283
Test: m
Test: atest EthernetServiceTests
Test: atest EthernetTetheringTest
Change-Id: I88240a546ab51d128ed83775499f2bcabab74db0
Merged-In: I88240a546ab51d128ed83775499f2bcabab74db0
2022-02-11 18:50:04 +09:00
Xin Li
cfb3e4a341 Merge sc-v2-dev-plus-aosp-without-vendor@8084891
Bug: 214455710
Merged-In: I8cfa435bb6233818adb9cc99dadeeb06a03443d5
Change-Id: Ib93992d88fd1704179009a3872798b9e7b83a6d1
2022-02-11 07:25:43 +00:00
markchien
2c938e1b0e Replace qtaguid_deleteTagData with java implementation
Copies the behavior of TrafficController::deleteTagData.

Test: atest NetworkStatsServiceTest
Change-Id: I436ce514108486db712b455f1b5fd8dca345c65c
2022-02-11 14:51:09 +08:00
James Mattis
c3d63a1f72 Merge "Making EthernetNetworkSpecifier public" am: d13094cef4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1971181

Change-Id: Ifce3d11a0e0e997924bd431c9208bf8c6a95cba8
2022-02-10 22:38:36 +00:00
James Mattis
81cab05410 Making EthernetNetworkSpecifier public
Bug: 210485380
Test: atest EthernetServiceTests
atest CtsNetTestCasesLatestSdk

Change-Id: Ic0b7a3360745632eb024a97692e49f6c8dafa3ee
Merged-In: Ic0b7a3360745632eb024a97692e49f6c8dafa3ee
2022-02-10 11:25:18 -08:00
Treehugger Robot
9dbfadff27 Merge "Split out the ipsec API surface and use framework-connectivity-tiramisu" am: 5edd77be5c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1960193

Change-Id: Ic3518daa2fc4e6219be1b1de547c21b7eee814e4
2022-02-10 12:10:30 +00:00
Aaron Huang
b944ff1540 Split out the ipsec API surface and use framework-connectivity-tiramisu
(cherry picked from commit 1dad7aa006492035293e68080aeaf606df02618a)
Bug: 204153604
Test: TH
Change-Id: I6cc8aef6a0ab9ce4bcef2797196b1d1b3687acca
Merged-In: I6cc8aef6a0ab9ce4bcef2797196b1d1b3687acca
2022-02-10 19:01:00 +09:00
Yan Yan
c35909fa5e Merge "Un-finalize IpSecManager" am: 9ae3337516
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1970081

Change-Id: I6d6ad018c285066f4720389daaf5f3e7a7feeae0
2022-02-10 01:52:47 +00:00
Yan Yan
9ae3337516 Merge "Un-finalize IpSecManager" 2022-02-10 01:37:09 +00:00
Chiachang Wang
e320f1526f Merge "Correct typo in the year of copyright" am: c12919b394
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1978088

Change-Id: I1e9331de72ea28ce492e208f429c0ce70143f2cb
2022-02-09 11:59:32 +00:00
Chiachang Wang
c12919b394 Merge "Correct typo in the year of copyright" 2022-02-09 11:38:50 +00:00
Chiachang Wang
52399c7f7e Correct typo in the year of copyright
Test: m
Change-Id: I68e9925b5b6deb7c5c9d57aa4a397c80f8b8d869
2022-02-09 11:38:37 +00:00
Yan Yan
98a3a0381f Un-finalize IpSecManager
Allows VCN and IKE unit tests to mock IpSecManager and thus stop
depending on the hidden APIs in the Connectivity module
(e.g. IpSecService binder interface). Otherwise, any changes on
these related hidden APIs will require topic changes across multiple
projects.

Bug: 217572993
Test: make update-api
Test: atest IpSecManagerTest, IpSecManagerTunnelTest
Change-Id: I29f3ac96f83b4271f29a7051d33ccf47a0dd6c57
Merged-In: I29f3ac96f83b4271f29a7051d33ccf47a0dd6c57
2022-02-09 03:32:54 +00:00
James Mattis
5af0abd012 Merge "Marking eth network management APIs @SystemApi" am: 6db38c75b0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1969839

Change-Id: Ie76ba54b9339398ed961a02435b17fbb75218106
2022-02-07 21:14:02 +00:00
James Mattis
28547370d4 Marking eth network management APIs @SystemApi
Annotating ethernet network management APIs in EthernetManager
with @SystemApi.

Bug: 210485380
Test: atest EthernetServiceTests
atest CtsNetTestCasesLatestSdk

Change-Id: I10429441fd4d7b9bcaa7437b844420a43a415d72
Merged-In: I10429441fd4d7b9bcaa7437b844420a43a415d72
2022-02-04 17:09:34 -08:00
Treehugger Robot
2c99d9a6eb Merge "Add key / value data structures for IBpfMaps" am: 1661c26cf4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1969201

Change-Id: Id2e9069959402216b52d1d64603eeb9f27cc21ca
2022-02-04 23:57:06 +00:00
Treehugger Robot
1661c26cf4 Merge "Add key / value data structures for IBpfMaps" 2022-02-04 23:39:29 +00:00
James Mattis
a449854c6a Merge "Adding permission for Ethernet Network Management" am: 94ed798c18
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1964543

Change-Id: Ibcd7b1db698c1f1e4b72dbe87c5e69bbd6d8bbc0
2022-02-04 23:12:47 +00:00
James Mattis
94ed798c18 Merge "Adding permission for Ethernet Network Management" 2022-02-04 23:05:27 +00:00
Remi NGUYEN VAN
e61aab1252 Merge "Support discovering services with a NetworkRequest" am: 1d93ed0cce
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1952113

Change-Id: I6ffad96f4e0e662be9b21607d12648f0b4d0aa81
2022-02-04 12:24:03 +00:00
Remi NGUYEN VAN
f28caeb5f0 Merge changes from topic "nsd_serviceinfo_network" am: d4b1ac25a3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1944534

Change-Id: Ia0a3c75269dd5b125292235360e2e7ba0cefd9ca
2022-02-04 12:22:21 +00:00
hepengtao
ce599dcfb7 NSD: Specify on what interface to getAddrInfo am: f6f9aa2b9a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1862673

Change-Id: I436ad4f11c9da27d79628c25eb8a0f6bb532f02f
2022-02-04 12:22:18 +00:00
Patrick Rohr
27e7842a9c Add key / value data structures for IBpfMaps
Add key / value structures for CookieTagMap, StatsMap, and UidStatsMap.
This will be used for deleteTagData.

Test: m
Change-Id: I955ae7f7745d4c5f37eccbad80cdb841ef55ff56
2022-02-04 13:13:02 +01:00
Remi NGUYEN VAN
1d93ed0cce Merge "Support discovering services with a NetworkRequest" 2022-02-04 12:07:58 +00:00
Remi NGUYEN VAN
d4b1ac25a3 Merge changes from topic "nsd_serviceinfo_network"
* changes:
  Support discover/resolve on specific networks
  NSD: Specify on what interface to getAddrInfo
2022-02-04 12:07:38 +00:00
Remi NGUYEN VAN
173a33f259 Support discovering services with a NetworkRequest
A common mistake when using service discovery is to mismanage networks,
expecting to find or be able to access services on networks that may not
be available yet, or may be stale/lost.

This new API allows clients to start service discovery with just a
NetworkRequest, letting NsdManager track networks and notify when
services are found/lost for each network.

Bug: 190249673
Test: atest NsdManagerTest
Change-Id: I12e799aa48fce2d1a35f708c5617386b1cc70f21
2022-02-03 13:04:20 +09:00
Remi NGUYEN VAN
23651306c3 Support discover/resolve on specific networks
This adds a Network member to NsdServiceInfo, allowing discovered
services to report which network they were discovered on, and clients to
specify which network to resolve the service on. If clients use the
discovered NsdServiceInfo to resolve a service, it will be resolved on
the network where it was discovered instead of an unspecified network.

Also add a network parameter to a new overload of
NsdManager#discoverServices, so that clients can discover on specific
networks.

Bug: 190249673
Test: atest NsdManagerTest

Change-Id: Idc4bf9fde0f4b0328204a8cd2eedc12fffbbbdba
2022-02-03 13:04:08 +09:00
James Mattis
07550b5354 Adding permission for Ethernet Network Management
Adding MANAGE_ETHERNET_NETWORKS as a signature level permission
to allow an application to dynamically change ethernet network values.

Bug: 210485380
Test: atest EthernetServiceTests
Change-Id: Icf9c2accc86735cc981adc0d5a24802e0616ffaf
Merged-In: Icf9c2accc86735cc981adc0d5a24802e0616ffaf
2022-02-02 16:34:46 -08:00
James Mattis
b997291bbe Merge "Renaming Ethernet Network Management Classes" am: 525001eeec
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1965622

Change-Id: I6acadd19dfc733dd68b79cd4f79c98633f711240
2022-02-02 20:25:24 +00:00
hepengtao
f6f9aa2b9a NSD: Specify on what interface to getAddrInfo
When discover two different host with same host name
from different network interface, specify on what
 interface to getAddrInfo.

Bug: 203453164
Test: build & manual

Signed-off-by: hepengtao <hept.hept.hept@gmail.com>
Change-Id: Ifaccb7f3fac6b1dd789cc9ce7c8d964102754508
2022-02-02 17:50:50 +09:00
James Mattis
1ecadfa763 Renaming Ethernet Network Management Classes
Renaming InternalNetwork* files and classes related to ethernet network
management to EthernetNetwork* as ethernet is the only trasnport these
particular files are used with.

Bug: 210485380
Test: atest EthernetServiceTests
Change-Id: Ieb3915c032ef5fcd6b36eb09878119de7668bb4b
2022-02-01 21:02:10 -08:00
James Mattis
61808d3281 Merge "InternalNetworkManagementException Changes" am: 27c75f17a6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1952437

Change-Id: I272d569228edf6da00f55601d317b6c182746d89
2022-02-02 00:29:26 +00:00
James Mattis
2ed5ef560c InternalNetworkManagementException Changes
Update to InternalNetworkManagementException in order to allow all
members to be parcelable.

Bug: 210485380
Test: atest EthernetServiceTests
Change-Id: I17f119a66face8a927546657490969aa3073c54b
2022-02-01 09:21:09 -08:00
Lorenzo Colitti
c1d80ec4ac Merge changes from topics "move-kerneltotag", "move-socket-tagging-to-mainline" am: 623d59f6ad
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1964912

Change-Id: I57a58eb215f17da6ce58607600ab322766f00b69
2022-01-31 14:04:58 +00:00
Lorenzo Colitti
0e7a5f6b5a Move kernelToTag to NetworkStatsFactory. am: e91d76c5df
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1964913

Change-Id: Ib763cf77b54e4583e51a337d4261069621e65f56
2022-01-31 14:04:49 +00:00
Lorenzo Colitti
623d59f6ad Merge changes from topics "move-kerneltotag", "move-socket-tagging-to-mainline"
* changes:
  Move socket tagging implementation to mainline.
  Move kernelToTag to NetworkStatsFactory.
2022-01-31 13:35:30 +00:00
Lorenzo Colitti
d2ae7390f5 Move socket tagging implementation to mainline.
Currently, socket tagging is implemented in the framework. The
Java code is in NetworkManagmentSocketTagger.java and the JNI is
in libandroid and loaded by the general framework JNI loader.

- Move the Java implementation to TrafficStats, which is the only
  caller of NetworkManagmentSocketTagger. This simplifies the
  code a bit because a number of methods can be deleted.

- Move the JNI code to a new JNI library in the APEX. The library
  depends only on the NDK and statically links the NDK-only
  version of libnativehelper. Its size is only 5k on ARM and 10k
  on ARM64.

- Temporarily make the framework depend on this library until the
  rest of the T connectivity code moves to the APEX.

Test: atest NetworkUsageStatsTest CtsNetTestCases:TrafficStatsTest
Change-Id: I050c7c515237f68b78d08987bc443f50a7949c06
2022-01-30 15:59:44 +09:00
Lorenzo Colitti
e91d76c5df Move kernelToTag to NetworkStatsFactory.
... to prepare for the deletion of NetworkManagementSocketTagger.

Test: atest FrameworksNetTests
Change-Id: Id3ad67fa640ddb9ab446e10dcf8e6a588d661dd9
2022-01-29 21:54:15 +09:00
Junyu Lai
eaea75c36b Merge "[MS59.3] Expose NetworkStatsDataMigrationUtils" am: c466d1ef9c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1961599

Change-Id: Ia1f7f14a2b53876530c394ade949fc8847eab806
2022-01-29 04:13:53 +00:00
Junyu Lai
c466d1ef9c Merge "[MS59.3] Expose NetworkStatsDataMigrationUtils" 2022-01-29 03:55:41 +00:00