Commit Graph

73 Commits

Author SHA1 Message Date
Patrick Rohr
6758a5dfff Merge "Add test for EthernetNetworkUpdateRequest" 2022-03-09 09:16:29 +00:00
Patrick Rohr
30d33f4ee3 Add test for EthernetNetworkUpdateRequest
Test: atest EthernetNetworkUpdateRequest
Change-Id: I2aeacca81f07cf2d73814d20fc9e63e9f1a65843
2022-03-08 16:29:43 +01:00
Jean Chalard
fb73190bd6 Merge "Remove unused libraries" am: e4848734a9
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2005450

Change-Id: I831ada348828d28c4abcd961932bdbb7c0c4ec07
2022-03-02 08:21:36 +00:00
Jean Chalard
e4848734a9 Merge "Remove unused libraries" 2022-03-02 07:48:51 +00:00
Chalard Jean
1f3e110ae6 Remove unused libraries
Test: m, TH
Change-Id: I59c0f8ecc94837635758c7667ea6413a5e6a7e81
2022-03-02 14:32:38 +09:00
Remi NGUYEN VAN
97edc959c2 Add JNI stats libraries to connectivity am: d95048929c
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1987449

Change-Id: Ibae3c96be03017135b9aff4caf6f3f5f1a86075a
2022-02-28 06:26:45 +00:00
Remi NGUYEN VAN
d95048929c Add JNI stats libraries to connectivity
Add new symbols to libservice-connectivity loaded on T only, and the
framework libraries to apex and tests.

Bug: 197717846
Test: atest FrameworksNetTests
  (cherry-picked and splitting apex Android.bp to aosp/1994130)
Change-Id: Iae44344701a3267110e5cbf271120201134d59e5
Merged-In: Iae44344701a3267110e5cbf271120201134d59e5
2022-02-28 04:16:17 +00:00
Xin Li
a459e6a12d Merge sc-v2-dev-plus-aosp-without-vendor@8084891
Bug: 214455710
Merged-In: I5894450f3089b2ea105722a18ddf8f1eed1c28a0
Change-Id: If2045705da821c90705f7dd1e6944c0bb92e3289
2022-02-11 06:57:49 +00:00
Maciej Żenczykowski
11ab996252 remove unneeded inclusions of libbpf_android
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I6aedf507e09effd9076de85a0acc7aaf1b8e4a1e
2022-02-09 22:10:22 -08:00
Remi NGUYEN VAN
2ba9dbe163 Split out connectivity-t-pre-jarjar and tests
The pre-jarjar variant is necessary so that service-t can depend on
hidden symbols in framework-t that reference (for example as parameter)
classes that are jarjared.
Without this, when depending on framework-connectivity-tiramisu.impl,
service-connectivity-t would see post-jarjar symbols that do not match
the classnames it uses in its code.

Also split FrameworksNetTestsLib so that the same jarjar rules can be
applied between the tests and the module, avoiding different errors
between FrameworksNetTests and ConnectivityCoverageTests.

Ignore-AOSP-First: Avoiding conflicts; cherry-pick will follow
Bug: 204830222
Test: m
Change-Id: I3d0c081c4a7422e128beee11c0156f01b0377c96
Merged-In: I3d0c081c4a7422e128beee11c0156f01b0377c96
2022-02-09 18:29:30 +08:00
Lorenzo Colitti
0c26c9ed37 Allow using BpfMap and TcUtils in unit tests.
Create a Java library that allows the BpfMap class and the
TcUtils class to find their JNI code when they are jarjard to the
package name we use in our unit tests.

Test: atest ConnectivityServiceTest
Change-Id: I2f17b1c366b2b8164eac34b94c9659bc7c0f68e0
2022-01-27 10:18:35 +00:00
Junyu Lai
bfdd0f3c3c Merge "[MS59.2] Add unit test for NetworkStatsDataMigrationUtils" 2022-01-27 09:20:10 +00:00
Wei Li
8a177f694a Set exclude_kotlinc_generated_files to false explicitly since kotlin reflection is used in some Connectivity test cases kotlin code.
Property "exclude_kotlinc_generated_files" is recently added to exclude some kotlinc generated files that are not needed if kotlin reflection is not used. Currently it defaults to false since there are test failures(b/213966211) which is in FullScoreTest#testToString and FullScoreTest#testMinMaxPolicyConstants that uses kotlin reflection and fails if exclude_kotlinc_generated_files defaults to true. By setting explicitly exclude_kotlinc_generated_files to false on tests like FullScoreTest#testToString, we will be able to finally default this property to true so the kotlinc generated files can be removed for most modules that don't need them.
Bug: 204888276
Bug: 213966211
Test: atest
FrameworksNetTests: com.android.server.connectivity.FullScoreTest
Change-Id: I4ed2d27c27841cb7127f669c8db34c90b4a41b1f
2022-01-26 18:25:23 +00:00
junyulai
a1bb3a36cd [MS59.2] Add unit test for NetworkStatsDataMigrationUtils
Test: atest NetworkStatsDataMigrationUtilsTest
Bug: 204830222
Change-Id: Ia6e8aec9a828072a2a1e63bec600c2e20d3699b3
2022-01-26 16:53:06 +00:00
Maciej Żenczykowski
e1f8ad4d59 Merge changes from topic "libnetworkstats"
* changes:
  Rename libnetdbpf to libnetworkstats
  Copy libnetdbpf from system/net to tethering module
2022-01-25 23:52:06 +00:00
Junyu Lai
3f9584bfda Merge "[MS67.2] Modify tests for registerUsageCallback" 2022-01-25 01:23:45 +00:00
junyulai
f8a1d3e5e6 [MS67.2] Modify tests for registerUsageCallback
Test: atest FrameworksNetTests
Bug: 204830222
Change-Id: Ia4ff535cd703807516d65b582727684cbb670360
2022-01-24 18:59:23 +08:00
Ken Chen
f426b2b287 Rename libnetdbpf to libnetworkstats
Two reason for renaming:
1. Avoid module name collision in sc-mainline-prod branch.
2. The libnetdbpf was misnamed before.

Bug: 202086915
Test: atest libnetworkstats_test FrameworksNetTests
      ConnectivityCoverageTests FrameworksNetSmokeTests
      CtsAppOpsTestCases
Change-Id: I87fcf4b1a9d58780a45743a9aa91b9b936e54266
2022-01-24 11:53:59 +08:00
markchien
adf119a8ed Add unit test for BpfInterfaceMapUpdate
Bug: 215095957
Test: atest FrameworkNetTests

Change-Id: I92d45e5a606f466ce42504629cb3f87fd9e25d22
2022-01-21 23:34:25 +08:00
Paul Hu
a77cad355b Merge "Build framework-connectivity-tiramisu library" 2022-01-20 03:02:56 +00:00
Treehugger Robot
e48a86422a Merge "Rename libbpf to libbpf_bcc" am: e44ea016e1 am: 7bf5e61c37 am: 05d00b50fd
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1906032

Change-Id: Ia0bba1c182fe43b01126e88f86f97c9c09163e59
2021-12-17 01:30:27 +00:00
Treehugger Robot
e44ea016e1 Merge "Rename libbpf to libbpf_bcc" 2021-12-17 00:37:05 +00:00
paulhu
802ab9760f Build framework-connectivity-tiramisu library
- Move nsd APIs and build framework-connectivity-tiramisu library
- Add nsd associated hidden apis
- Build service-connectivity-tiramisu-pre-jarjar library for
  T+ services.
- Move ConnectivityServiceInitialiizer to service-t directory
  to create S+ service instances which can avoid dependency on
  lower sdk library.

Bug: 206893064
Test: atest FrameworksNetTests CtsNetTestCases
CTS-Coverage-Bug: 207804007
Merged-In: I9628716f5c38047ff4ea2346b27589077259c436
Change-Id: I9628716f5c38047ff4ea2346b27589077259c436
2021-12-17 00:04:24 +08:00
Treehugger Robot
23ec69be0f Merge "[MS07.2] Move NetworkStatsCollection/IdentitySet into frameworks" am: 7577131341 am: a9656625d2 am: bb49fe4bef
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1895330

Change-Id: Id03f0efb4d052fd2da6bfd3d50bbb9a94cd299da
2021-12-10 19:35:17 +00:00
Junyu Lai
e9710f0918 [MS07.2] Move NetworkStatsCollection/IdentitySet into frameworks
These files are needed for the data migration util system Api
interfaces. Thus, they need to be moved into frameworks folder.

This change also set the @IgnoreUpTo annotation to S, since
these tests are testing purely platform code on S- devices which
is not really necessary for MTS. Also the tests are still covered
by the unit tests, since they are always verifying HEAD.

Test: TH
Bug: 197717846
Change-Id: I93c19b4860864c724be9f9f889ee2173f4605198
2021-12-09 08:43:16 +00:00
Connor O'Brien
e0a64bb50c Rename libbpf to libbpf_bcc
This is to prevent a name collision with "upstream"
libbpf (external/libbpf) which is built using the same name.

Bug: 203823368
Test: m FrameworksNetTests
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I9a009493fe0482967ab1f92516514715cfd457d6
2021-12-07 23:05:24 +00:00
Remi NGUYEN VAN
d1ed21007a Remove unused service and test dependencies am: f96ecf2708 am: e03f77170a am: 7d865f3e10
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1895317

Change-Id: I22260179985637d82e20b346786bed44148e5dc2
2021-11-19 16:27:47 +00:00
Remi NGUYEN VAN
f96ecf2708 Remove unused service and test dependencies
Nothing uses StateMachine in service-connectivity, and
FrameworksNetTestsLib pulled a lot of unused dependencies with
services.core and services.net.

Remove unused dependencies. This helps measure code coverage more
accurately.

Bug: 207020032
Test: atest ConnectivityCoverageTests
Change-Id: I39857865594a3263c4b1deeda23312c8e4f86a77
2021-11-19 21:14:39 +09:00
Aaron Huang
e75927b122 Merge "Enable/disable FrameworksNetTests" am: d1ed1cb8b7 am: 045f47bc31 am: 3820c8b69c am: c502fa51d4
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1843117

Change-Id: Ic342b4ecb4541c1e58200112dc5bc092b9ab8f2f
2021-10-04 08:46:40 +00:00
Aaron Huang
045f47bc31 Merge "Enable/disable FrameworksNetTests" am: d1ed1cb8b7
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1843117

Change-Id: Ida093c6792bed45d5f65e3ea0e567eb30de74807
2021-10-04 08:07:21 +00:00
Aaron Huang
d1ed1cb8b7 Merge "Enable/disable FrameworksNetTests" 2021-10-04 07:53:09 +00:00
Aaron Huang
1ed8affa72 Enable/disable FrameworksNetTests
Currently, there are some test for classes that are not in
connectivity module. If the platform code has a new change
that the test depends on it, then the test cannot verify the
behavior since the change does not exist in module branch.

This change moves the test for non-module classes out of
FrameworksNetTestsLib so that it doesn't go into coverage tests.
Then add those tests to FrameworksNetTests and use a variable
to enable/disable FrameworksNetTests which could minimize merge
conflicts.

Bug: 201265286
Test: make FrameworksNetTests

Change-Id: Ia9669da2c4d79054710e7f4173bc960e3f77f45a
2021-10-01 19:29:50 +08:00
Luke Huang
df75378ad4 Modify Nsd{Service,Manager}Test to conform to its change
(clean cherry-pick from downstream branch)
Test: atest NsdManagerTest NsdServiceTest
Bug: 191844585
Merged-In: I3cf658498bef5755dcb01127a94fff913b6e6298

Change-Id: I3cf658498bef5755dcb01127a94fff913b6e6298
2021-09-13 10:18:04 +09:00
Christopher Ferris
a0d72de861 Merge "Remove unused libbacktrace library." am: f7e6b7f424 am: 341de04dee am: 1b8a6843d6 am: d577354b20
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1807719

Change-Id: I60ae26b6754657709c9acb1969640becb3707a5b
2021-09-02 22:21:22 +00:00
Christopher Ferris
341de04dee Merge "Remove unused libbacktrace library." am: f7e6b7f424
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1807719

Change-Id: I7781fb81bfe78760334c5cc9301da505b9202d8b
2021-09-02 21:38:38 +00:00
Christopher Ferris
2b63a2f92a Remove unused libbacktrace library.
Bug: 120606663

Test: Builds.
Change-Id: I733defd03670b01a30c4be5742498d62db7a9b6b
2021-08-24 15:57:29 -07:00
Remi NGUYEN VAN
fdfa1572ff Merge "Add overlay options for no internet notifications" am: 4f39cacbc3 am: aca228c07a am: f51a0ded84
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1782433

Change-Id: I77ab8f2aa7ae9a18d4f619c3905bc13084ab557f
2021-08-04 08:08:43 +00:00
Remi NGUYEN VAN
f51a0ded84 Merge "Add overlay options for no internet notifications" am: 4f39cacbc3 am: aca228c07a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1782433

Change-Id: I87238b54c517a4efb11bca6e23cc2484b66f217e
2021-08-04 08:08:20 +00:00
Remi NGUYEN VAN
5dc6ca0318 Add overlay options for no internet notifications
Add an option to display the no internet dialog directly instead of
showing a notification when the notification would have been high
priority (typically when the network was explicitly selected). This is
disabled by default, but allows device manufacturers to use a slightly
more disruptive UX to ensure that the user is aware that the network has
no connectivity, and can take action.

Also add an option to show the same notification as "no internet"
instead of the "partial connectivity" notification. This is also
disabled by default, but allows device manufacturers to use the "no
internet" text if they feel that "partial connectivity" text is hard
to understand for the user.

Bug: 193847396
Test: atest NetworkNotificationManagerTest
Change-Id: Ib5bd74d8cf973bf70d373dd63648c178fae0ebae
2021-08-04 11:23:03 +09:00
Luke Huang
37834ab195 Merge "Modify Nsd{Service,Manager}Test to conform to its change" into sc-dev am: 3c20df39d0 am: c504df3890
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15320525

Change-Id: I9cf3cc5a4cf661f9a4571934d3e26b15c7a96837
2021-07-22 03:31:07 +00:00
Luke Huang
952a55c62d Modify Nsd{Service,Manager}Test to conform to its change
Test: atest NsdManagerTest NsdServiceTest
Bug: 191844585
Change-Id: I3cf658498bef5755dcb01127a94fff913b6e6298
Ignore-AOSP-First: To avoid the side effect caused by automerger.
2021-07-21 08:02:26 +00:00
Remi NGUYEN VAN
168b3d19f1 Add connectivity coverage tests
The coverage tests will allow measuring code coverage for all
Connectivity+Tethering code.

This is a combination of the current TetheringCoverageTests, and
FrameworksNetTests.

Adding min_sdk_version to the test prevents it from using deprecated
IoUtils utilities. Replace it with the non-deprecated alternative.

Bug: 187935317
Test: atest ConnectivityCoverageTests
Original-Change: https://android-review.googlesource.com/1731232
Merged-In: I5366e1cc9cd6ddb41f24718246381cc2b1cc1383
Change-Id: I5366e1cc9cd6ddb41f24718246381cc2b1cc1383
2021-07-05 05:00:36 +00:00
Victor Chang
e4132c8ca0 Merge "Partial cherry-pick to remove IoUtils#deleteContents usage in FrameworksNetTests" into sc-dev 2021-06-29 08:12:04 +00:00
Remi NGUYEN VAN
819045fc60 Partial cherry-pick to remove IoUtils#deleteContents usage in FrameworksNetTests
It's a partial cherry-pick of https://r.android.com/1731232

Bug: 154796679
eest: atest ConnectivityCoverageTests
Merged-In: I5366e1cc9cd6ddb41f24718246381cc2b1cc1383
Change-Id: I23565c4144e665130585a86ce66cee6c2da07b60
2021-06-28 16:53:15 +01:00
Remi NGUYEN VAN
ff55aeb916 Remove ConnectivityServiceTest signature perms use
To allow unit tests to run without platform certificates, remove
signature permission usage in ConnectivityServiceTest.

This mocks permission checks done in ConnectivityService for which the
test assumed that the permission was held, and mocks calls to
BatteryStatsManager. Calls to ActivityManagerService (through
PendingIntent) are done with shell permissions as the test uses real
PendingIntent mechanics.

Bug: 187935317
Test: atest FrameworksNetTests
Merged-In: If309d653ac2e9bbcf1b94bcee6336367289df359
Change-Id: If309d653ac2e9bbcf1b94bcee6336367289df359

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1736615

(cherry picked from commit 595dda3604)

Change-Id: Idb19b0f7cb87bb4d9de7a0b1a0e4128c2d6b9c6d
2021-06-23 08:39:38 +00:00
Remi NGUYEN VAN
b6bf25b91a Merge "Add connectivity coverage tests" am: cc79d7c0f8 am: 68114fe408 am: 3d25f6e8a7
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1731232

Change-Id: Ie9549d26fc4f1246e8959e326d2bd6f834bf222c
2021-06-21 16:23:57 +00:00
Remi NGUYEN VAN
3d25f6e8a7 Merge "Add connectivity coverage tests" am: cc79d7c0f8 am: 68114fe408
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1731232

Change-Id: I6cc7f3a3abe97fccc59e14e77e99a0843f3363bb
2021-06-21 13:56:37 +00:00
Remi NGUYEN VAN
4ca7a11543 Merge "Remove ConnectivityServiceTest signature perms use" am: 54c7434f0d am: 96ad425c5e am: 595dda3604
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1736615

Change-Id: I7dd3c5e7da9097ebedd7f4a836d4e78ef9bf08e5
2021-06-16 11:49:54 +00:00
Remi NGUYEN VAN
595dda3604 Merge "Remove ConnectivityServiceTest signature perms use" am: 54c7434f0d am: 96ad425c5e
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1736615

Change-Id: Ifd8c397644f5fc680b34905882ec287bb43c1e1b
2021-06-16 11:37:53 +00:00
Remi NGUYEN VAN
fe20e1317d Add connectivity coverage tests
The coverage tests will allow measuring code coverage for all
Connectivity+Tethering code.

This is a combination of the current TetheringCoverageTests, and
FrameworksNetTests.

Adding min_sdk_version to the test prevents it from using deprecated
IoUtils utilities. Replace it with the non-deprecated alternative.

Test: atest ConnectivityCoverageTests
Change-Id: I5366e1cc9cd6ddb41f24718246381cc2b1cc1383
2021-06-16 19:45:20 +09:00