Commit Graph

8634 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
449c8fd974 Merge "Ignore NetworkAgentConfigTest on Q" into rvc-dev 2020-03-10 00:59:50 +00:00
Remi NGUYEN VAN
6137e3cd42 Merge "Skip LinkAddress tests that are R-specific on Q" into rvc-dev 2020-03-10 00:59:32 +00:00
Remi NGUYEN VAN
70bb7064cf Merge "Ignore testReevaluateNetwork until Q" into rvc-dev 2020-03-10 00:59:12 +00:00
Cody Kesting
5f3c53a268 Clear UIDs when sharing NetworkCapabilties for ConnectivityDiagnostics.
ConnectivityDiagnostics shares NetworkCapabilities in
ConnectivityReports and DataStallReports. These NetworkCapabilities need
to have their UIDs scrubbed before they are shared with callbacks.

Bug: 148942124
Test: atest FrameworksNetTests
Change-Id: I5bde5a8116f7e36b8f4de49adf4cab8ec45a5aa4
Merged-In: I5bde5a8116f7e36b8f4de49adf4cab8ec45a5aa4
(cherry picked from commit 3de243265558fb5505b4daabe715a5090104450f)
2020-03-09 08:27:10 -07:00
Automerger Merge Worker
911106c17c Merge NetworkStatsService handler changes.
=====
Remove the need of accessing handler in NSS unit test

Currently, to wait for handler becomes idle, specific message
is used and the test would wait for condition variable to be
open when the message is processed.

However, this is already done in the HandlerUtils. Thus,
there is no need to post such message manually in the handler.

Test: atest FrameworksNetTests
Bug: 150664039

Change-Id: Iab32b2dbab01634ca159dcb90fc9f929d1fed1a2
=====
Remove setHandler in NetworkStatsService

Currently, internal handler is set by setHandler after
constructing NSS object. This was introduced in ag/866187 to
access the handler in the unit test.

However, the design put NSS in a bad situation where all classes
that need handler or executor could not be final and need to be
dynamically allocated in order to get a valid handler.

Thus, since the usage of handler is removed in previous patch,
this change eliminate setHandler by initializing the handler in
the constructor.

Test: atest FrameworksNetTests
Bug: 150664039

Change-Id: I794a24d00b0ca9fdc78091e7b9ab7307e0f034b7
=====

Bug: 150664039
Change-Id: If256ed4437ddcbcc72a6f766cff2f4cc512ee3f7
Merged-In: If256ed4437ddcbcc72a6f766cff2f4cc512ee3f7
(cherry picked from commit 2a6439d7e2a3926e10a0b9a4dc730b1a022d8138)
2020-03-09 07:59:27 +00:00
Automerger Merge Worker
d7e80c1f34 Ignore testReevaluateNetwork until Q
The method did not exist until Q, so the test is not relevant on such
devices.

Test: atest CtsNetTestCasesLatestSdk:android.net.CaptivePortalTest on Q
          and R devices
Bug: 150918852
Merged-In: I913b6eaa61bfd4f1964b324dcb4dd272aa8cc583
(cherry picked from commit 4d166d7bd95d9582335aafaa03fb242206449054)

Change-Id: I2ddeee53d4ef63f01b791e3e95161194e29d3978
2020-03-09 06:34:01 +00:00
Automerger Merge Worker
890f021f5a Skip LinkAddress tests that are R-specific on Q
Address lifetime was added in R so tests for it should not be run on Q.

Test: CtsNetTestCasesLatestSdk:android.net.LinkAddressTest on both
          devices
Bug: 150918852
Merged-In: I98b14727eabcf569829eee8df34afc057eba6f93
(cherry picked from commit 4e00259d220590acf781382de0542cbae75ec16f)

Change-Id: I9599afa8ae64bb13c93d5f26ebedf3f8dedff6d9
2020-03-09 06:33:28 +00:00
Automerger Merge Worker
78d504da06 Ignore NetworkAgentConfigTest on Q
NetworkAgentConfig did not exist on Q.

Test: atest CtsNetTestCasesLatestSdk:android.net.NetworkAgentConfigTest
          on Q and R devices
Bug: 150918852
Merged-In: I5414d7767c39327ff41673ff13ccd34982e10742
(cherry picked from commit d7fedf26d03759cb26a19a6558cf39189b66a681)

Change-Id: I868398148d80afb73659df4d7312f1c2e245ead9
2020-03-09 06:32:14 +00:00
Automerger Merge Worker
de03bda1c3 Remove polling of TetheringManager in ConnectivityManager.
Test: manual

Bug: 144742179
Merged-In: I7d88b38eb3d741534e980b7d1e226a411b71fae2
(cherry picked from commit f8a55a19faa938b4e58310f9a90926276b7936ea)

Change-Id: I5cc4231bfb9a0709d677acbb317ee98af31bd041
2020-03-09 06:29:22 +00:00
Chalard Jean
e34d090bce Merge "Remove the NetworkScore class." into rvc-dev 2020-03-09 05:54:30 +00:00
Automerger Merge Worker
e58e7a4d85 Add more assertions to testStackedLinkProperties.
Check all routes that are added and removed instead of just some
of them. This is in preparation of an upcoming change that
switches to adding and creating routes by issuing direct calls to
netd.

Also rename the misleading ipv4Default route variable to
ipv4Subnet, which is what it actually is.

Bug: 142892223
Test: test-only change
Change-Id: I7d111382be215a926a7d7d4701bd3c3e94372b99
Merged-In: I7d111382be215a926a7d7d4701bd3c3e94372b99
(cherry picked from commit dcb35cb9a5d1c250e6564b6e66a4b436dd11c795)
2020-03-09 03:48:15 +00:00
Automerger Merge Worker
76eead56aa Remove the NetworkScore class.
This class is useless at this point and introduces overhead.

Bug: 113554781
Test: FrameworksNetTests
Change-Id: Ib5f540070222865260c16c7182cc13c710a243c2
Merged-In: Ib5f540070222865260c16c7182cc13c710a243c2
(cherry picked from commit c3489ad3a6ce98218ce223cea877586781025b98)
2020-03-09 03:46:34 +00:00
Automerger Merge Worker
13a85611f8 test: ConnectivityService: Validate Route Add/Del
Validate route addition and deletion after linkProperties are
changed.

Bug: 142892223
Test: atest ConnectivityServiceTest#testStackedLinkProperties
Change-Id: I18296b933e856a0f8a4c1dbd75bd35024853bfbb
Merged-In: I18296b933e856a0f8a4c1dbd75bd35024853bfbb
(cherry picked from commit a22a979a0caf3e3533ede410d48127084052aec5)
2020-03-09 03:36:10 +00:00
Automerger Merge Worker
87cdb7c771 test: LinkProperties: Unique Route Destinations
Routes will always have unique destinations. Update tests
to use unique destinations when adding multiple routes.

Bug: 142892223
Test: treehugger
Change-Id: I238899b0643407a1be29eb66d28728ca5d5dbc80
Merged-In: I238899b0643407a1be29eb66d28728ca5d5dbc80
(cherry picked from commit 891ea460b10c3ee3c74298dad828bd550e66b81f)
2020-03-09 03:33:03 +00:00
lucaslin
73f992fd80 Remove redundant connected notification
Remove the old connected notification since there is a new file
- NetworkStackNotifier.java which will send the connected
notification when captive portal validated.

Bug: 149883761
Test: 1. atest FrameworksNetTests
      2. Sign-in a captive portal and see if there is a redundant
      connected notification.

Change-Id: Id11a9b99dd04772a92af8d527104906c47bf64cd
Merged-In: Id11a9b99dd04772a92af8d527104906c47bf64cd
2020-03-05 06:48:12 +00:00
Chalard Jean
fdb872c4ed Revert "Add public fields to NetworkScore and make it @SystemApi"
This reverts commit 511f7e3792.

Bug: 113554781
Test: FrameworksNetTests FrameworksTelephonyTests FrameworksWifiTests
Change-Id: Ie1e84bd2a16f088307b195f924f4e49335cbe367
2020-02-28 06:26:27 +00:00
Chalard Jean
4c2f233f6b Merge changes Ia91b3b3c,Id9ecdac5,I4b17d1b1
* changes:
  Revert "[NS D01] Remove candidates that don't satisfy the request."
  Revert "[NS D02] Mix in the ignore on wifi policy."
  Revert "Address comments on ag/10316753"
2020-02-21 11:06:55 +00:00
Automerger Merge Worker
f76bed30a9 Merge "Remove useless thread checks" am: 269d32a0fa am: bb87d5aeb5 am: 374e1adce8
Change-Id: Ib091ec185495184867b77528aee7492b9b571ada
2020-02-21 10:21:50 +00:00
Automerger Merge Worker
374e1adce8 Merge "Remove useless thread checks" am: 269d32a0fa am: bb87d5aeb5
Change-Id: I7a1fe60971b733cb6bc3c848eeed8624210d97ff
2020-02-21 10:00:45 +00:00
Automerger Merge Worker
bb87d5aeb5 Merge "Remove useless thread checks" am: 269d32a0fa
Change-Id: I1dc9ce4e5ef5ca2012264fdb736606a36f20c8a3
2020-02-21 09:37:21 +00:00
Chalard Jean
d15ca10d6d Revert "[NS D01] Remove candidates that don't satisfy the request."
This reverts commit a19115d482.

Reason for revert: The feature was punted out of R.

Change-Id: Ia91b3b3c55f735dae64ffa3194614a6f2631a087
2020-02-21 09:29:00 +00:00
Chalard Jean
1d9a206bca Revert "[NS D02] Mix in the ignore on wifi policy."
This reverts commit 7a56387e2c.

Reason for revert: The feature was punted out of R.

Change-Id: Id9ecdac5292eeddf7c12f2330421248b0f8355a9
2020-02-21 09:28:18 +00:00
TreeHugger Robot
7bcd12e7d2 Merge changes from topic "revert-10338939-YCRBMILGZV"
* changes:
  Revert "[NS D03] Migrate the bad wifi avoidance policy"
  Revert "[NS D04] Implement a simple speed comparison between scores."
2020-02-21 08:51:09 +00:00
Chalard Jean
99ae3ad2e5 Remove useless thread checks
Because we liked to be really sure.

Test: ConnectivityServiceTests
Change-Id: I8d66257777d4c5b6ca097a5f2575d0872fae05dd
2020-02-21 17:00:49 +09:00
TreeHugger Robot
e60c52cb89 Merge changes from topic "revert-10343065-HRWTWGOFZV"
* changes:
  Revert "[NS D05] Rework how to tear down networks"
  Revert "[NS D06] Implement more policies"
  Revert "[NS D07] Use the unmodified legacy score"
2020-02-21 07:53:30 +00:00
Chalard Jean
7b6b7ecc19 Revert "[NS D03] Migrate the bad wifi avoidance policy"
Revert submission 10338939

Reason for revert: The feature was punted out of R.
Reverted Changes:
I32c12702c:[NS D04] Implement a simple speed comparison betwe...
I688593cc0:[NS D03] Migrate the bad wifi avoidance policy

Change-Id: I640635a1ed94bed3b53466abe2a988caf0eca2b0
2020-02-21 06:47:35 +00:00
Chalard Jean
6f677ac620 Revert "[NS D04] Implement a simple speed comparison between scores."
Revert submission 10338939

Reason for revert: The feature was punted out of R.
Reverted Changes:
I32c12702c:[NS D04] Implement a simple speed comparison betwe...
I688593cc0:[NS D03] Migrate the bad wifi avoidance policy

Change-Id: I28172721d3f3af82ac79ef2c8f61df39943d997b
2020-02-21 06:46:06 +00:00
Chalard Jean
b3ce7501b7 Revert "[NS D05] Rework how to tear down networks"
Revert submission 10343065

Reason for revert: This is part of a feature that was punted out of R.
Reverted Changes:
Ic9a3d3363:[NS D05] Rework how to tear down networks
I7d815f873:[NS D06] Implement more policies
I561098476:[NS D07] Use the unmodified legacy score

Change-Id: I8d2696d15999265d79abfc9163e7e5ccad873cfe
2020-02-20 07:32:12 +00:00
Chalard Jean
751e5a1c37 Revert "[NS D06] Implement more policies"
Revert submission 10343065

Reason for revert: This is part of a feature that was punted out of R.
Reverted Changes:
Ic9a3d3363:[NS D05] Rework how to tear down networks
I7d815f873:[NS D06] Implement more policies
I561098476:[NS D07] Use the unmodified legacy score

Change-Id: I378449443f99eb0a7f01f31f53398b8f55ce87f1
2020-02-20 07:32:12 +00:00
Chalard Jean
b104cd7c12 Revert "[NS D07] Use the unmodified legacy score"
Revert submission 10343065

Reason for revert: This is part of a feature that was punted out of R.
Reverted Changes:
Ic9a3d3363:[NS D05] Rework how to tear down networks
I7d815f873:[NS D06] Implement more policies
I561098476:[NS D07] Use the unmodified legacy score

Change-Id: I184817e3aa290afdbe6721a7c36332b940434d3a
2020-02-20 07:32:12 +00:00
Automerger Merge Worker
589d8b524e Merge "Sanitize owner UID iff owning app does not have location permissions." am: 4d95254cb3 am: aba23b3f43 am: a06f220d24
Change-Id: I9b8fb3ff8d907ecda918a8a926edb133b742c8f1
2020-02-20 05:59:35 +00:00
Automerger Merge Worker
a06f220d24 Merge "Sanitize owner UID iff owning app does not have location permissions." am: 4d95254cb3 am: aba23b3f43
Change-Id: Ib99af41b78dc9539f2a553231e13549d348b72db
2020-02-20 05:48:02 +00:00
Automerger Merge Worker
aba23b3f43 Merge "Sanitize owner UID iff owning app does not have location permissions." am: 4d95254cb3
Change-Id: Ie5876d063d7440aacc57d48cb4573798303910ea
2020-02-20 05:30:20 +00:00
Qingxi Li
4d95254cb3 Merge "Sanitize owner UID iff owning app does not have location permissions." 2020-02-20 05:20:27 +00:00
Automerger Merge Worker
c3c2ef4641 Merge "Update NetworkMonitor integration test constructor" am: 488af7c7d2 am: 3114fc2310 am: f737906f24
Change-Id: Ifc184f8262b33ddbbad1ccc7a1ef0b67259f2e55
2020-02-20 04:31:39 +00:00
Automerger Merge Worker
71c303b424 [automerger skipped] Merge "DO NOT MERGE: RELAND: NetworkRequest: Embed requestor uid & packageName" into stage-aosp-master am: be37378755 -s ours am: 074d8a34f3 -s ours
am skip reason: subject contains skip directive

Change-Id: Ifdd6d655de499c5e64f59e7ae0ca9ae2fad62e62
2020-02-20 04:31:25 +00:00
Automerger Merge Worker
52ef685d36 [automerger skipped] Merge "DO NOT MERGE: RELAND: NetworkRequest: Embed requestor uid & packageName" into qt-qpr1-dev-plus-aosp am: ab0a3ea5f6 -s ours
am skip reason: subject contains skip directive

Change-Id: I9fb0affe108fe4656d1fafad8b04bea4bdcd3cc2
2020-02-20 04:29:03 +00:00
Automerger Merge Worker
f737906f24 Merge "Update NetworkMonitor integration test constructor" am: 488af7c7d2 am: 3114fc2310
Change-Id: Ibd4c6ad05acf81513b54b41341b6ed0203480471
2020-02-20 01:38:04 +00:00
Automerger Merge Worker
3114fc2310 Merge "Update NetworkMonitor integration test constructor" am: 488af7c7d2
Change-Id: Idc27d7900d98eaa8ab3265d6ad6ad82b075197e5
2020-02-20 01:24:58 +00:00
Automerger Merge Worker
074d8a34f3 [automerger skipped] Merge "DO NOT MERGE: RELAND: NetworkRequest: Embed requestor uid & packageName" into stage-aosp-master am: be37378755 -s ours
am skip reason: Change-Id I207c446108afdac7ee2c25e6bbcbc37c4e3f6529 with SHA-1 d499517306 is in history

Change-Id: Iac17ca3df5826eb235fbc7ef02c0a5de4f06f44e
2020-02-20 01:19:31 +00:00
Chalard Jean
488af7c7d2 Merge "Update NetworkMonitor integration test constructor" 2020-02-20 01:13:05 +00:00
Qingxi Li
b274810c34 Sanitize owner UID iff owning app does not have location permissions.
This change adds permission checking to ensure that the following
conditions are enforced in order for apps to receive the owner UID:
1. The app must be the owner of the network
2. The app must hold the FINE_LOCATION permission/appop
3. The user must have their location toggle enabled.

Bug: 142072839
Test: atest FrameworksNetTests
Change-Id: I7a981a82f1219828ee89c8c96eb9d2efd153377f
2020-02-20 01:02:42 +00:00
Roshan Pius
bc7e37d0f4 DO NOT MERGE: RELAND: NetworkRequest: Embed requestor uid & packageName
Add the requestorUid & requestorPackageName fields to
NetworkCapabilities. This is populated by CS when
a new network request is received.
These 2 requestor fields are also optionally used for network
matching. All of the regular app initiated requests will have the
requestor uid and package name set by connectivity service. Network
agents can optionally set the requestorUid and requestorPackageName
to restrict the network created only to the app that requested the network.

This will help removing the necessity for the various specifiers to embed
the uid & package name info in the specifier for network matching.

Note: NetworkSpecifier.assertValidFromUid() is deprecated & removed in
favor of setting the uid/package name on the agent to restrict the
network to a certain app (useful for wifi peer to peer API & wifi aware).

Bug: 144102365
Test: Verified that wifi network request related CTS verifier tests
pass.
Test: Device boots up and connects to wifi networks
Merged-In: I207c446108afdac7ee2c25e6bbcbc37c4e3f6529

Change-Id: I58775e82aa7725aac5aa27ca9d2b5ee8f0be4242
2020-02-19 23:12:32 +00:00
Roshan Pius
246d8d6416 DO NOT MERGE: RELAND: NetworkRequest: Embed requestor uid & packageName
Add the requestorUid & requestorPackageName fields to
NetworkCapabilities. This is populated by CS when
a new network request is received.
These 2 requestor fields are also optionally used for network
matching. All of the regular app initiated requests will have the
requestor uid and package name set by connectivity service. Network
agents can optionally set the requestorUid and requestorPackageName
to restrict the network created only to the app that requested the network.

This will help removing the necessity for the various specifiers to embed
the uid & package name info in the specifier for network matching.

Note: NetworkSpecifier.assertValidFromUid() is deprecated & removed in
favor of setting the uid/package name on the agent to restrict the
network to a certain app (useful for wifi peer to peer API & wifi aware).

Bug: 144102365
Test: Verified that wifi network request related CTS verifier tests
pass.
Test: Device boots up and connects to wifi networks
Merged-In: I207c446108afdac7ee2c25e6bbcbc37c4e3f6529

Change-Id: I58775e82aa7725aac5aa27ca9d2b5ee8f0be4242
2020-02-19 23:12:28 +00:00
Automerger Merge Worker
85c9b4749b [automerger skipped] Merge "Use framework-tethering-stub instead of framework-tethering" am: 7fa9971ec6 am: e67473517a am: e457375dba -s ours
am skip reason: Change-Id I97ef83f7f9b4c1376f373713036f5256318f1050 with SHA-1 273a3e1c54 is in history

Change-Id: I1771917998eeda2d18abb1f576e5091828651ea0
2020-02-19 23:09:23 +00:00
Automerger Merge Worker
fbcdf41d67 Merge changes from topic "settings-vpn" am: 70f90282ef am: 1758c298d0 am: 3d6f91ed37
Change-Id: Idac6e83bab50b818e2776f28da380f08000e2a42
2020-02-19 23:08:32 +00:00
Automerger Merge Worker
81fe1b0e79 [automerger skipped] Add always-on VPN support for platform VPNs am: 16e0e33c71 am: 5c1e7a12c5 am: 45493c1a50 -s ours
am skip reason: Change-Id I5eda88e5b406a0e425eb7424665cf702e0979324 with SHA-1 fb68c52267 is in history

Change-Id: Id27267529b42f1b1be90613574f91e5fe7c780e4
2020-02-19 23:08:21 +00:00
Chalard Jean
4bb5b45830 [NS D07] Use the unmodified legacy score
Ranking used to make use of the various adjustments in
ConnectivityService. These are now implemented in policy.

Test: ConnectivityServiceTest

Change-Id: I56109847678ea5cda1752511123ba652c0f4fe36
2020-02-19 22:17:13 +09:00
Chalard Jean
c736e76394 [NS D06] Implement more policies
Namely :
• Explicitly selected policy
• VPN policy
• Validated policy

These go together to avoid breaking any test, because multiple
tests rely on all of these working.

Test: ConnectivityServiceTest

Change-Id: I7d815f87320c2becbfc93a60a3c54346ff4f47c9
2020-02-19 22:17:12 +09:00
Chalard Jean
822a150c03 [NS D05] Rework how to tear down networks
Networks are torn down if they don't satisfy requests but only if
they are found unable to ever do so. This is important because
general-purpose networks typically turn up unvalidated, which
means they would get torn down immediately in the presence of
some worse network that is already validated.

Note that functionally it's the same as before for the existing
scores, except that
• An exiting network that doesn't satisfy any request is always
  torn down immediately – this is WAI
• An unmetered network is never torn down when compared to a
  metered network – this is a bugfix (previously the platform
  would tear down an unmetered cellular on grounds that it
  could not beat the performance of a metered Ethernet, but
  that's wrong ; the bug was never realized because Android
  always thinks Ethernet is unmetered)
• An unvalidated network will not be torn down if the current
  satisfier is also unvalidated, even if the satisfier is much
  faster. This is the reason for the change in the test. It's
  wrong to tear down in this case because even if much slower
  the slower network should win if it validates and the other
  doesn't.

Test: ConnectivityServiceTest
Change-Id: Ic9a3d336306a25d1272976ce467aa7c908af7bef
2020-02-19 21:27:22 +09:00