Commit Graph

2078 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
Automerger Merge Worker
e67473517a Merge "Use framework-tethering-stub instead of framework-tethering" am: 7fa9971ec6
Change-Id: I2caaa5f804a510bcc18822b784c129e9b058ea03
2020-02-19 09:54:51 +00:00
markchien
2e6ba526c9 Use framework-tethering-stub instead of framework-tethering
The non-updatable part of the platform now is built with
framework-tethering-stub, which is a stub library of
framework-tethering.

Bug: 147200698
Test: m
Change-Id: I97ef83f7f9b4c1376f373713036f5256318f1050
Merged-In: I97ef83f7f9b4c1376f373713036f5256318f1050
2020-02-19 15:10:44 +08:00
Chalard Jean
333ca0ceec Merge changes I32c12702,I688593cc
* changes:
  [NS D04] Implement a simple speed comparison between scores.
  [NS D03] Migrate the bad wifi avoidance policy
2020-02-18 10:51:26 +00:00
Chalard Jean
1355c8b255 [NS D04] Implement a simple speed comparison between scores.
This is not used yet to avoid making the change too big to review,
but D05 will use this. Refer to D05 for how this is going to be
used.

Test: ConnectivityServiceTest
Change-Id: I32c12702c8bce959682b02f157946d3f37b12a0c
2020-02-18 16:15:22 +09:00
Benedict Wong
ea18b70ca6 Merge changes Ide9daebc,Id47ada57 am: d07db8a8da am: 3dbd79190c am: 6ed815786c
Change-Id: Iaacfbe8b221d79e3d06d0d7ea81528db13e4611a
2020-02-18 06:35:06 +00:00
Chalard Jean
d2f82a2cc3 Merge "[NS D02] Mix in the ignore on wifi policy." 2020-02-18 05:46:33 +00:00
Benedict Wong
3dbd79190c Merge changes Ide9daebc,Id47ada57 am: d07db8a8da
Change-Id: Ied52fed05566a0d75e82007170210205db7832a8
2020-02-17 22:01:24 +00:00
Chalard Jean
7a56387e2c [NS D02] Mix in the ignore on wifi policy.
Ultimately ConnectivityService and its satellites should mix in
some measurements to NetworkScore, but in the immediate future
they'll just use this to mix in at the new format the policy it
used to managed in an ad-hoc way.

As a first mix-in, this adds mixing in the IGNORE_ON_WIFI policy,
which so far used to be handled in Connectivity as the avoidBadWifi
bit. Ultimately this should move to Telephony.

Bug: 113554781
Test: ConnectivityServiceTest
Change-Id: I4869d5eb9ea74679e57c087005ed3d9b8119fed2
2020-02-17 14:58:31 +09:00
Isabelle Taylor
a4474bd4d0 Merge "Revert "Remove framework code that has moved to frameworks/libs/net"" am: 50e2cbde28
Change-Id: I5e0b4e50352428ca5886a808b5667daffb4f2e4c
2020-02-14 13:51:45 +00:00
Isabelle Taylor
50e2cbde28 Merge "Revert "Remove framework code that has moved to frameworks/libs/net"" 2020-02-14 13:42:37 +00:00
Isabelle Taylor
175627fafb Revert "Remove framework code that has moved to frameworks/libs/net"
Revert "Use createRandomUnicastAddress from MacAddressUtils"

Revert "Add net-utils-framework-net to telephony-common"

Revert submission 1191997-net-utils-framework-net

Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=git_qt-qpr1-dev-plus-aosp&target=aosp_taimen-userdebug&lkgb=6208131&lkbb=6208273&fkbb=6208273, bug b/149551544
Reverted Changes:
Ib1c807d64:Use createRandomUnicastAddress from MacAddressUtil...
I9e0f297e0:Add net-utils-framework-net to telephony-common
Ieb8927f9a:Remove framework code that has moved to frameworks...

Change-Id: I2824f781babd9f7e0bb9df524dadf6b8397dcaa1
2020-02-14 13:09:16 +00:00
Aaron Huang
2deb148476 Merge "Remove framework code that has moved to frameworks/libs/net" am: 0122cf102f
Change-Id: I20b8398f1fe410819f18a0afcd8646c75c594fb8
2020-02-14 09:53:36 +00:00
Aaron Huang
0122cf102f Merge "Remove framework code that has moved to frameworks/libs/net" 2020-02-14 09:42:49 +00:00
Benedict Wong
0bd4bba07a Enforce restricted user, getConnectionOwnerUid checks
This CL adds checks to ensure restricted users cannot change or
start/stop platform VPNs. In addition, this also adds checks to the
ConnectivityManager#getConnectionOwnerUid() to ensure that only
VpnService based VPNs can identify connections

Bug: 148040659
Test: FrameworksNetTests run
Change-Id: Id47ada5766036bfc84f3ba47f66f2d2683af916d
2020-02-14 00:09:47 -08:00
Roshan Pius
02d8578fc3 Merge "RELAND: NetworkRequest: Embed requestor uid & packageName" 2020-02-14 01:57:49 +00:00
Automerger Merge Worker
3c43c37a44 Merge "Add Intdef annotation for eventId in logEvent" am: 2ed536a7b6 am: ef5b92c7d2 am: dd26691339
Change-Id: I7caa207fb35e8088e50de0651a72a6d9628e7ce2
2020-02-13 11:24:43 +00:00
Automerger Merge Worker
ef5b92c7d2 Merge "Add Intdef annotation for eventId in logEvent" am: 2ed536a7b6
Change-Id: Ic9b5ea605164340d5c2461eb7a1a752bb5b36bad
2020-02-13 10:56:35 +00:00
Chiachang Wang
2ed536a7b6 Merge "Add Intdef annotation for eventId in logEvent" 2020-02-13 10:44:57 +00:00
Automerger Merge Worker
9dd19a4b83 Merge "Add permission check for CaptivePortal#reevaluateNetwork" am: d0f3cb625e
Change-Id: I2f9de2582025c8fc3782870b8c561ce2002abaf8
2020-02-13 06:54:50 +00:00
Chiachang Wang
d0f3cb625e Merge "Add permission check for CaptivePortal#reevaluateNetwork" 2020-02-13 06:41:53 +00:00
Chiachang Wang
2520c650cd Add Intdef annotation for eventId in logEvent
Follow API guide.

Bug: 148379628
Test: make test-api-stubs-docs-update-current-api \
      system-api-stubs-docs-update-current-api

Change-Id: I410ef06b2fa82d8ef35513086733b0fc2cf0fe06
2020-02-13 06:26:35 +00:00
Chiachang Wang
c3c1334243 Merge "Add permission check for CaptivePortal#reevaluateNetwork" 2020-02-13 06:25:32 +00:00
Roshan Pius
08c94fb8a9 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-12 16:58:36 -08:00
Automerger Merge Worker
9e1c910fff Merge "Revert "NetworkRequest: Embed requestor uid & packageName"" am: 948f0f9878
Change-Id: I00dd341f699d2a22cc3d190b43314a49bee9062a
2020-02-12 23:55:00 +00:00
Roshan Pius
948f0f9878 Merge "Revert "NetworkRequest: Embed requestor uid & packageName"" 2020-02-12 23:36:13 +00:00
Roshan Pius
d85de75bfa Revert "NetworkRequest: Embed requestor uid & packageName"
This reverts commit d499517306.

Reason for revert: b/149425896
Bug: b/149425896

Change-Id: I9fe31509c040cc421ccb00ea60f15e6f199e8bc6
2020-02-12 23:33:43 +00:00
Automerger Merge Worker
e6f588ab90 Merge "NetworkRequest: Embed requestor uid & packageName" am: 7b59ec507c
Change-Id: Ic4f9247e18a9d1cc22b26500b47da1af2d9b011d
2020-02-12 18:51:59 +00:00
Qingxi Li
7b59ec507c Merge "NetworkRequest: Embed requestor uid & packageName" 2020-02-12 18:43:32 +00:00
Automerger Merge Worker
9a0752cc57 Merge "Include NetworkCapabilities and LinkProperties in DataStallReport." am: 287c4adbc9 am: d876b4ef76 am: c4cf86b9ad
Change-Id: Iae8c37ceeae1616b2b0edc43248e72f3de082f20
2020-02-12 17:50:39 +00:00
Cody Kesting
d876b4ef76 Merge "Include NetworkCapabilities and LinkProperties in DataStallReport."
am: 287c4adbc9

Change-Id: If2157b0dd7d62560c77318b76e0d7d2a66c09644
2020-02-12 09:16:41 -08:00
Cody Kesting
287c4adbc9 Merge "Include NetworkCapabilities and LinkProperties in DataStallReport." 2020-02-12 16:38:38 +00:00
Chiachang Wang
f7a0f125db Add permission check for CaptivePortal#reevaluateNetwork
CaptivePortal#reevaluateNetwork is added as a system API which
requires a proper permission check.

Bug: 148379628
Test: Manually check with captive portal
Test: atest FrameworksNetTests
Test: make test-api-stubs-docs-update-current-api \
      system-api-stubs-docs-update-current-api

Change-Id: I3f974339d5bd53a6f6ecb0842c02a8264dc3a5f9
Merged-In: I559d42089aeb09801d14c251c5165fca793c3cb3
2020-02-12 11:29:24 +00:00
Chiachang Wang
ca2105f597 Add permission check for CaptivePortal#reevaluateNetwork
CaptivePortal#reevaluateNetwork is added as a system API which
requires a proper permission check.

Bug: 148379628
Test: Manually check with captive portal
Test: atest FrameworksNetTests
Test: make test-api-stubs-docs-update-current-api \
      system-api-stubs-docs-update-current-api

Change-Id: I559d42089aeb09801d14c251c5165fca793c3cb3
2020-02-12 11:28:55 +00:00
Automerger Merge Worker
54a520d22f Merge changes Ibc9b1965,I288ea32f am: 7fa63afe6d
Change-Id: I6eb675ddfa609dcc3031e916ce49959e42cf53f6
2020-02-12 06:25:49 +00:00
Automerger Merge Worker
1021194560 Add a systemapi constructor for NetworkAgent am: 0900154ef5
Change-Id: I3fa3ec32d3c580ba0b7f2d515e08d27dd6af5bcd
2020-02-12 06:25:42 +00:00
Aaron Huang
c2b200e46b Fix invalid usage of javadoc
CP from ag/10125651

Test: this change removes invalid usage
Change-Id: Ibc9b1965ec7aa545c0dae71d741c3802d3a9fa12
Merged-In: I35fc4a814238635fa95981649c27230dda319afa
2020-02-12 06:10:10 +00:00
Roshan Pius
d499517306 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
Change-Id: I207c446108afdac7ee2c25e6bbcbc37c4e3f6529
Merged-In: I207c446108afdac7ee2c25e6bbcbc37c4e3f6529
2020-02-12 04:42:58 +00:00
Cody Kesting
f2852480a0 Include NetworkCapabilities and LinkProperties in DataStallReport.
DataStallReport is updated to include the NetworkCapabilities and Link
Properties for the Network being reported on. This provides a more
complete picture of the Network conditions when the suspected data stall
was detected.

Bug: 148966398
Test: atest FrameworksNetTests
Change-Id: I913cf18c348b9f688f9d2a3d25a71bc94eb8f000
2020-02-11 08:50:59 -08:00
Chalard Jean
0900154ef5 Add a systemapi constructor for NetworkAgent
Bug: 138306002
Bug: 139268426
Test: atest FrameworksNetTests FrameworksWifiTests FrameworksTelephonyTests
      make doc-comment-check-docs
Change-Id: I288ea32fac07a9a486e2ea451a2c9b098446a74c
Merged-In: I288ea32fac07a9a486e2ea451a2c9b098446a74c
2020-02-11 16:26:10 +08:00