Commit Graph

43952 Commits

Author SHA1 Message Date
Mark Chien
8dcc3000fd Merge "Make isTetheringSupported respect all tethering downstreams" 2022-03-07 05:56:20 +00:00
markchien
259d5c08a8 Make isTetheringSupported respect all tethering downstreams
Currently if wifi, usb and bluetooth tethering is not supported,
isTetheringSupported would return false. Then ethernet, ncm tethering
and wifi p2p would also not be supported anymore. Make
isTetheringSupported respect all tethering downstreams after T.

Also remove redundant code:
1. tethering always has upstream configuration, checking whether has
upstream configuration for isTetheringSupported is useless.
2. Remove TetheringDependencies#isTetheringSupported because it don't
have any caller.

Test: atest TetheringTests
Change-Id: I3db5ce410c064d37c9e9e704fce2a2b68705834e
2022-03-07 10:55:51 +08:00
Maciej Żenczykowski
edf80c2da8 Merge "[CLATJ#30] Not allow tagSocket() to tag with uid AID_CLAT" 2022-03-05 08:33:33 +00:00
Maciej Żenczykowski
171db11c5f Merge "[CLATJ#29] Remove the throwaway sockets for dup2 fds" 2022-03-05 08:32:47 +00:00
Maciej Żenczykowski
a63535bfd1 Merge changes from topic "dedup-interfaceparams"
* changes:
  Remove unused InterfaceParams jarjar rule
  Deduplicate InterfaceParams
2022-03-05 08:23:55 +00:00
Patrick Rohr
e0f3847b59 Remove unused InterfaceParams jarjar rule
InterfaceParams has moved to com.android.net.module.util for which a
jarjar rule already exists. It is about to be removed from
android.net.util.

Test: builds
Bug: 222448728
Change-Id: I384bfd3a3def98e16c353c4e599deb84205319cb
2022-03-04 16:53:51 +01:00
Patrick Rohr
9f371f024b Deduplicate InterfaceParams
CS should use InterfaceParams from frameworks/libs/net.

Test: builds
Bug: 222448728
Change-Id: I1f45d3171b265461a8724b4be7b212c030b63fe9
2022-03-04 16:53:51 +01:00
Hungming Chen
436547e368 [CLATJ#30] Not allow tagSocket() to tag with uid AID_CLAT
The process is not allowed to tag socket to AID_CLAT via tagSocket()
which would cause process data usage accounting to be bypassed.

Bug: 218407445
Test: atest BpfHandlerTest
Change-Id: Ia7b071e1065733da25e9f02f34ccd17f63653217
2022-03-04 17:21:23 +08:00
Hungming Chen
e250c95bb8 [CLATJ#29] Remove the throwaway sockets for dup2 fds
Don't need these temporary socket fds anymore because the
posix_spawn_file_actions_adddup2() will clean up the flag
O_CLOEXEC for dup2 fd == new_fd before forking.

Bug: 218407445
Test: connect to ipv6 only network and ping 8.8.8.8
Change-Id: I70b8a03a6a13393a30a8a63599b8d1468347c560
2022-03-04 11:53:25 +08:00
Sudheer Shanka
b52c67d5d7 Dump connectivity trafficcontroller data to diagnose test failures.
Bug: 218308105
Test: atest com.android.cts.net.HostsideRestrictBackgroundNetworkTests
Change-Id: Ifafe7c96122cf4197dd2f12569b6bd9788cfa66c
2022-03-03 22:06:52 +00:00
Mark Chien
9edd999725 Merge "Pass whole TetheringConfiguration to IpServer" 2022-03-03 11:54:59 +00:00
markchien
b961d3d70f Pass whole TetheringConfiguration to IpServer
This is a no-op CL that passing whole TetheringConfiguration to IpServer
to reduce the number of IpServer constructor parameters.

Bug: 170056953
Test: atest TetheringTests
Change-Id: I4ec17f7ecaefd7f275139ad9c7f7551635b192c9
2022-03-03 11:54:24 +00:00
Mark Chien
a3728e97ca Merge "Remove tether_enable_select_all_prefix_ranges flag" 2022-03-03 09:40:27 +00:00
Frank Li
481c0cd100 Merge "[MS68.4] Address comments at aosp/1958144" 2022-03-03 02:26:53 +00:00
Chiachang Wang
978370cb9c Merge "Rename getVpnRequiresValidation to isVpnValidationRequired" 2022-03-03 00:10:54 +00:00
Patrick Rohr
f1fe8ee928 Do not enable ingress rate limit until clsact qdisc exists
The tc police filter attaches to the clsact qdisc, so the rate limit
cannot be enabled before the qdisc is added to the interface.
The clsact qdisc is added as part of INetd#networkAddInterface, which is
called from inside updateLinkProperties.

Test: atest FrameworksNetTests:ConnectivityServiceTest
Change-Id: I0713605ff3684f8271eb3f0e29ab7116561963f1
2022-03-02 20:41:13 +01:00
markchien
23a5f18adb Remove tether_enable_select_all_prefix_ranges flag
The tether_enable_select_all_prefix_ranges is added from M2020-12
for quick roll back the feature. Since feature is landed over a year
without any problem, remove the flag now.

Bug: 171269957
Test: atest TetheringTests
Change-Id: I3ef414a47dd0a1f80ea2d378601ccd7c14067318
2022-03-02 21:58:50 +08:00
Frank Li
8039c85336 Merge "[SUBID01-1]Grow NetworkIdentity to include a new mSubId field" 2022-03-02 12:26:11 +00:00
Jean Chalard
e4848734a9 Merge "Remove unused libraries" 2022-03-02 07:48:51 +00:00
Frank Li
1b87cafbc1 Merge "[DU03-4]Add NETWORK_STACK Permission check for NetworkStatsService API" 2022-03-02 07:48:45 +00:00
Paul Hu
c871c08d8d Merge "Rename framework-connectivity-tiramisu to framework-connectivity-t" 2022-03-02 07:11:25 +00:00
Chalard Jean
1f3e110ae6 Remove unused libraries
Test: m, TH
Change-Id: I59c0f8ecc94837635758c7667ea6413a5e6a7e81
2022-03-02 14:32:38 +09:00
Chiachang Wang
7ec6ae74c8 Rename getVpnRequiresValidation to isVpnValidationRequired
Update API name from getVpnRequiresValidation to
isVpnValidationRequired according to API review feedback.

Test: atest FrameworksNetTests
Bug: 220129160
Change-Id: I1025f4c35b320c14e872eaffd7ed82658a5f3d0c
2022-03-02 01:02:45 +00:00
Frank
eeeb76d3bb [MS68.4] Address comments at aosp/1958144
Test: atest TrafficStatsTest NetworkUsageStatsTest FrameworksNetTests
Bug: 204830222
Ignore-AOSP-First: merge conflict

(cherry-picked from ag/16811186)

Change-Id: I2578e13e2844591adac1d1902f2454ec7079ceea
Merged-In: I2578e13e2844591adac1d1902f2454ec7079ceea
2022-03-02 03:09:09 +08:00
Frank
d8990c334a [DU03-4]Add NETWORK_STACK Permission check for NetworkStatsService API
1. getUidStatsForTransport API

Bug: 210066922
Test: atest BatteryStatsImplTest WifiPowerCalculatorTest
            MobileRadioPowerCalculatorTest NetworkStatsServiceTest
Ignore-AOSP-First: merge conflict resolutions

(cherry-picked from ag/16822075)

Change-Id: I2d4d79e5bce648b9937311f5039619ba191728fd
Merged-In: I2d4d79e5bce648b9937311f5039619ba191728fd
2022-03-02 02:23:33 +08:00
lifr
8ba46d804f [SUBID01-1]Grow NetworkIdentity to include a new mSubId field
In the previous design of NSS and NPMS, those only had IMSI to identify
the cell network. Now the telephony has created the "subId" handle,
which is the preferred mechanism for identifying subscribers.

This commit adds NetworkStats support for subscriberId as a part of
the network identity key

Bug: 80526261
Test: atest NetworkTemplateTest NetworkStatsCollectionTest
            NetworkStatsServiceTest NetworkIdentityTest
Ignore-AOSP-First: merge conflict resolutions

(cherry-picked from ag/16826535)

Change-Id: I8549b11d0fcfc5a9426724d6b90de27b707cb77c
Merged-In: I8549b11d0fcfc5a9426724d6b90de27b707cb77c
2022-03-01 16:43:28 +08:00
Patrick Rohr
4bd0f6bb2a Merge changes I3b7913c5,I9c1d6294
* changes:
  Improve error reporting in RateLimitTest
  Add null checks to RateLimitTest#tearDown improves error reporting
2022-03-01 07:36:09 +00:00
paulhu
537f72061a Rename framework-connectivity-tiramisu to framework-connectivity-t
Bug: 215434166
Test: build, flash, device boot to home.
Merged-In: I9ebedf8813cbfa30d979bc35a3b2306715be682b
Change-Id: I9ebedf8813cbfa30d979bc35a3b2306715be682b
2022-03-01 09:44:21 +08:00
Sudheer Shanka
87db609348 Merge "Add some debugs to diagnose test failure." 2022-03-01 01:05:01 +00:00
Patrick Rohr
3409b2ef6f Improve error reporting in RateLimitTest
This change moves the logic to read /proc/config.gz from the static
initializer to a function that runs the first time setUp is called. This
improves error reporting as exceptions thrown inside
ensureKernelConfigLoaded get reported as test failures.

Test: atest RateLimitTest
Change-Id: I3b7913c567507dec8ecad26602cfccdad3d6f4bd
2022-02-28 14:59:03 +01:00
Patrick Rohr
efa4039d01 Add null checks to RateLimitTest#tearDown improves error reporting
An NullPointerException in tearDown is a symptom of an initialization
error and should not be reported in the test failure result.

Test: atest RateLimitTest
Change-Id: I9c1d6294678cdc9cdf4beae597f8373b92b52077
2022-02-28 14:59:03 +01:00
Patrick Rohr
d239146987 Merge "Move assumptions out of BeforeClass annotated method" 2022-02-28 11:07:04 +00:00
Lorenzo Colitti
cebdfba1bb Merge changes from topic "ms52-movenetstats"
* changes:
  Update API files to unhide MATCH_PROXY.
  Update tests for NetworkStats code move.
  Add setPollForce to module API
  Add JNI stats libraries to apex Android.bp
  Add JNI stats libraries to connectivity
  [MS62.2] Add NetworkStatsService into service initializer
  [MS54.8] Add hiddenapi-unsupported-t.txt to apex Android.bp
  [MS54.3] Move NetworkStats to updatable sources
2022-02-28 05:32:23 +00:00
Lorenzo Colitti
9e066c9faf Update API files to unhide MATCH_PROXY.
Bug: 204830222
Test: m
Ignore-AOSP-First: part of topic with internal-only code
  (cherry-picked from ag/16786006)
Change-Id: I9e11eea30ea9c988498e005c33f173ba2d0a32ec
Merged-In: I9e11eea30ea9c988498e005c33f173ba2d0a32ec
2022-02-28 04:17:19 +00:00
Lorenzo Colitti
3d52172838 Update tests for NetworkStats code move.
NetworkStatsFactory is moving from services.core to
service-connectivity-tiramisu. Update FrameworksNetSmokeTests and
FrameworksNetIntegrationTests to depend on the latter instead of the
former.

Test: atest FrameworksNetSmokeTests FrameworksNetIntegrationTests
Ignore-AOSP-First: part of large internal topic to avoid merge conflicts
  (cherry-picked from ag/16786005)
Change-Id: Ie48dac421decf83440b7c88adea18152e05f03bb
Merged-In: Ie48dac421decf83440b7c88adea18152e05f03bb
2022-02-28 04:17:13 +00:00
Remi NGUYEN VAN
73a61e7c28 Add setPollForce to module API
The API was test API in S, but this is not supported in module API
surfaces. Make it module API instead.

Ignore-AOSP-First: Avoiding merge conflicts. Cherry-pick will follow
Bug: 197717846
Test: Tests already using this API
  (cherry-picked from ag/16780903)
Change-Id: I53959f0ad4c7a41950e9349d539be82b9166b707
Merged-In: I53959f0ad4c7a41950e9349d539be82b9166b707
2022-02-28 04:17:06 +00:00
junyulai
6187e7c79a Add JNI stats libraries to apex Android.bp
This is separated from ag/16766427 to avoid merge
conflict at downstream branches. For some downstream branches,
the library does not exist and this part is commented out.

Bug: 197717846
Test: atest FrameworksNetTests
Merged-In: Idb6da7ce678fbb3f4839604726cbdbdf223144c1
Merged-In: Iae44344701a3267110e5cbf271120201134d59e5
Change-Id: I9d7f6cea1cdb3c8117e677d8c204e3985295ada0
2022-02-28 04:16:58 +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
Junyu Lai
e764686003 [MS62.2] Add NetworkStatsService into service initializer
NetworkStatsService is going to be moved into Connectivity mainlne
module and it will be not visible to SystemServiceResistry after
migration done. Thus, register service in
NetworkStatsServiceInitialalizer and register manager in
ConnectivityFrameworkInitializerTiramisu instead.

Ignore-AOSP-First: Avoiding conflicts; cherry-pick will follow
Test: FrameworksNetTests
      CtsNetTestCases
Bug: 204830222
  (cherry-picked from ag/16727131)
Change-Id: I03d947cc54dd995f6b5b4544ee3bf03cf029d143
Merged-In: I03d947cc54dd995f6b5b4544ee3bf03cf029d143
2022-02-28 04:16:07 +00:00
junyulai
4eccfdec89 [MS54.8] Add hiddenapi-unsupported-t.txt to apex Android.bp
This is separated from ag/16657723 to avoid merge
conflict at downstream branches. For some downstream branches,
the library does not exist and this part is commented out.

Test: TH
Bug: 197717846
Merged-In: I4eeb7ea9cfc3139991caf0fc22474e0052a0391c
Merged-In: I33e0d699086c87ce8e940036c9a52908bbbcf6c5
Change-Id: I031e5687fa47594b50ca1b40570e01cdec356827
2022-02-28 04:15:51 +00:00
Junyu Lai
eb6f4bef96 [MS54.3] Move NetworkStats to updatable sources
This CL builds NetworkStats related codes with the
connectivity module instead of platform.

Test: TH
Bug: 197717846
Change-Id: I4eeb7ea9cfc3139991caf0fc22474e0052a0391c
Merged-In: I4eeb7ea9cfc3139991caf0fc22474e0052a0391c
2022-02-28 03:24:19 +00:00
Taras Antoshchuk
116bd6e1a2 Merge "Fix HostsideVpnTests flakyness" 2022-02-25 12:02:13 +00:00
Mark Chien
cc0dc24205 Merge "Notify linkproperties change in all scenarios" 2022-02-25 11:13:12 +00:00
Pavan Kumar M
68e96aba07 Notify linkproperties change in all scenarios
In scenarios where linkproperties event is received on default internet
callback, linkproperties are cached and network state is updated with
new link properties but Tethering class is notified about the change.
Later when event is received on mobile request or listen all cb, since
the network state is already updated with these linkproperties, change
in link properties will not be notified. This results in tethering
failures where the ip addresses of the tethering interface will not be
updated.

This change handles this issue by triggering the link properties change
in all scenarios.

Update the correponding test case as well.

Tests: Builds, Boots, TetheringTests
Bug: 216281561
Change-Id: I7452ed07d2665843c86141764b71aab0c00417fe
2022-02-25 12:29:10 +05:30
Treehugger Robot
894912c85e Merge "Make sure the right NetworkMonitor start method is called on S-/T+" 2022-02-25 02:23:09 +00:00
Maciej Żenczykowski
333c34c434 Merge "only account for ingress packets addressed to us" 2022-02-24 22:45:52 +00:00
Patrick Rohr
148aea8e69 only account for ingress packets addressed to us
Test: builds && boots
Change-Id: I06c537dc1488e7f36e474760ab49dc299347003d
2022-02-24 14:12:32 +01:00
Treehugger Robot
da5e11c95f Merge "Fix a flake where network caps change innocuously." 2022-02-24 11:53:04 +00:00
Sudheer Shanka
5f09f8da8c Add some debugs to diagnose test failure.
Bug: 218308105
Test: atest com.android.cts.net.HostsideRestrictBackgroundNetworkTests
Change-Id: I096258d8c55cf56478015a655b5f3be19f29ace1
Merged-In: I096258d8c55cf56478015a655b5f3be19f29ace1
2022-02-23 20:37:30 +00:00
Patrick Rohr
a45195924e Merge "Fix rate limit API review comments" 2022-02-23 18:39:23 +00:00