Commit Graph

2332 Commits

Author SHA1 Message Date
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
Aaron Huang
100e0b9a51 Merge "Fix review comments on aosp/1213524" 2020-02-11 03:33:08 +00:00
Chalard Jean
75a6104e2a Fix review comments on aosp/1213524
This is necessary to avoid subsequent conflicts.

Test: none needed
Change-Id: I6e2cd9188e0e4bd7c71c6c56635f192dce73f325
Merged-In: I621cfbe165996c67b201ca2dd2f95a5ab9af10ee
2020-02-10 08:28:04 +00:00
Automerger Merge Worker
a026c149f3 Merge "Fix typo in ConnectivityDiagnosticsManager constant." am: 1e304edffd am: 80b276cbae am: d8dd480bbf
Change-Id: I0677a6a31defcb6412f132dcbbfd54f02c82baf7
2020-02-07 17:37:44 +00:00
Cody Kesting
1e304edffd Merge "Fix typo in ConnectivityDiagnosticsManager constant." 2020-02-07 16:57:19 +00:00
TreeHugger Robot
188bf74fd6 Merge "Use framework-tethering-stub instead of framework-tethering" 2020-02-07 11:32:23 +00:00
markchien
273a3e1c54 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
2020-02-07 00:27:26 +08:00
Roshan Pius
a098ec4171 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
2020-02-06 07:36:29 -08:00
Cody Kesting
e10545c736 Merge "Implement INetworkMonitorCallbacks#notifyNetworkTestedWithExtras." 2020-02-05 19:55:05 +00:00
Cody Kesting
83bb5fa762 Implement INetworkMonitorCallbacks#notifyNetworkTestedWithExtras.
INetworkMonitorCallbacks defines notifyNetworkTestedWithExtras() for
notifying ConnectivityService of networks being tested along with a
PersistableBundle of extras. A new event is introduced for
NetworkStateTrackerHandler to notify the ConnectivityDiagnosticsHandler
before continuing with the normal processing for "network tested"
notifications. The event is also used in the
ConnectivityDiagnosticsHandler.

Bug: 143187964
Bug: 147391402
Test: compiles.
Test: atest CtsNetTestCases FrameworksNetTests
Change-Id: Iab29da790c0f5faae68227770bc3a84bbc94f124
Merged-In: Iab29da790c0f5faae68227770bc3a84bbc94f124
2020-02-05 18:48:12 +00:00
Cody Kesting
c95f96910b Fix typo in ConnectivityDiagnosticsManager constant.
This change fixes a typo in the value assigned to the constant
KEY_NETWORK_PROBES_ATTEMPTED_BITMASK, which is defined in
ConnectivityDiagnosticsManager.ConnectivityReport.

Bug: 148939502
Test: compiles
Change-Id: I63863efa8c69593012bf4e95d896db192c6bfb5c
2020-02-05 08:56:48 -08:00
Benedict Wong
e2684df6ef Merge "Add separate user consent for Platform VPNs" 2020-02-04 23:56:16 +00:00
Cody Kesting
c8e5bf6eff Implement INetworkMonitorCallbacks#notifyNetworkTestedWithExtras.
INetworkMonitorCallbacks defines notifyNetworkTestedWithExtras() for
notifying ConnectivityService of networks being tested along with a
PersistableBundle of extras. A new event is introduced for
NetworkStateTrackerHandler to notify the ConnectivityDiagnosticsHandler
before continuing with the normal processing for "network tested"
notifications. The event is also used in the
ConnectivityDiagnosticsHandler.

Bug: 143187964
Bug: 147391402
Test: compiles.
Test: atest CtsNetTestCases FrameworksNetTests
Change-Id: Iab29da790c0f5faae68227770bc3a84bbc94f124
(cherry picked from commit c5326407d592490783259a48a8ca653c4ff13122)
2020-02-04 13:55:08 -08:00
Benedict Wong
a73199168b Add separate user consent for Platform VPNs
This change adds a new VPN user consent flow (using the same text) for
granting the lesser OP_ACTIVATE_PLATFORM_VPN. A new
PlatformVpnConfirmDialog is created as a subclass to preserve all logic,
but ensure the right appop is granted for the relevant dialog.

Intent extras were considered, but are inherently unsafe, since the
caller may add any extras that they would want.

Bug: 144246835
Test: FrameworksNetTests passing
Change-Id: Ia6f36207d43c3748f938430c2780dcf29e5623f3
Merged-In: Ia6f36207d43c3748f938430c2780dcf29e5623f3
2020-02-04 21:05:36 +00:00
Benedict Wong
5cb7ef9f08 Add separate user consent for Platform VPNs
This change adds a new VPN user consent flow (using the same text) for
granting the lesser OP_ACTIVATE_PLATFORM_VPN. A new
PlatformVpnConfirmDialog is created as a subclass to preserve all logic,
but ensure the right appop is granted for the relevant dialog.

Intent extras were considered, but are inherently unsafe, since the
caller may add any extras that they would want.

Bug: 144246835
Test: FrameworksNetTests passing
Change-Id: Ia6f36207d43c3748f938430c2780dcf29e5623f3
2020-02-03 19:05:23 -08:00
Automerger Merge Worker
23976cad40 Merge changes I446a8595,I68d2293f am: 3914abccce am: 3f8a000e5c am: dd8b4569b6
Change-Id: I99a531ab5ed8645d3eb3d15a3cd4ed6ef30c89ab
2020-02-03 22:53:15 +00:00
Benedict Wong
3914abccce Merge changes I446a8595,I68d2293f
* changes:
  Add VpnManager calls to ConnectivityService
  Add basic logic for profile-based VPNs
2020-02-03 22:31:37 +00:00
Automerger Merge Worker
71f6713369 Merge "Update javadocs for ConnectivityDiagnosticsManager." am: 5b6967bc01 am: b14259e0bd am: cffbf59942
Change-Id: Icd75afae770c93ac6fdb611e220d8723c07771ac
2020-02-03 15:18:32 +00:00
Automerger Merge Worker
e91b906438 Merge "Add callback registration in ConnectivityService." am: 29edc0ecc9 am: 89a5e805f9 am: 7d4ebb11d6
Change-Id: I596d4788f6d35f1adf110d8edd390f5632b4dc06
2020-02-03 15:18:18 +00:00
Cody Kesting
5b6967bc01 Merge "Update javadocs for ConnectivityDiagnosticsManager." 2020-02-03 14:56:13 +00:00
Cody Kesting
29edc0ecc9 Merge "Add callback registration in ConnectivityService." 2020-02-03 14:55:54 +00:00
Aaron Huang
5ff8baa340 Remove framework code that has moved to frameworks/libs/net
Add srcs to framework and change import path.
Remove the codes which are moved to frameworks/libs/net.

Bug: 139268426
Bug: 135998869
Bug: 138306002
Bug: 143925787
Test: atest FrameworksNetTests
      atest FrameworksTelephonyTests
      ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Change-Id: Ieb8927f9af7f87a5ae038bd6c7daeb3d70117fef
Merged-In: Ieb8927f9af7f87a5ae038bd6c7daeb3d70117fef
2020-02-03 08:16:43 +00:00
Cody Kesting
ad51e01b3c Update javadocs for ConnectivityDiagnosticsManager.
ConnectivityDiagnosticsManager comments for
registerConnectivityDiagnosticsCallback and
unregisterConnectivityDiagnosticsCallback are updated to reflect several
changes.

For register calls, any app will be able to register callbacks, but only
permissioned applications will have their callbacks invoked (and only
for networks managed by the application). Additionally, only the
registering app (uid) will be able to unregister a callback once
registered.

Bug: 143187964
Test: docs change only. compiles.
Change-Id: Ie7ae86a1afccb22d6c84027dbac49d7b8e431e8c
2020-01-31 09:49:25 -08:00
Cody Kesting
73708bff55 Add callback registration in ConnectivityService.
ConnectivityDiagnosticsManager will send callbacks to
ConnectivityService for registering and unregistering them with the
system. ConnectivityService needs to do the processing for persisting
(and deleting) these callbacks on the ConnectivityService Thread, so
messages are sent to the Connectivity Diagnostics  Handler, which runs
on the ConnectivityService Thread.

Bug: 146444622
Bug: 143187964
Bug: 147848028
Test: compiles
Test: atest FrameworksNetTests
Change-Id: Ia5c8f90a60c050504e8676de9564a7607a9b03bc
2020-01-31 09:42:05 -08:00
Chalard Jean
9eece865c0 Merge "Add public fields to NetworkScore and make it @SystemApi" 2020-01-31 03:06:16 +00:00
Benedict Wong
df936cf1a7 Add basic logic for profile-based VPNs
This change adds stubs for the Platform built-in VPNs, along with
implementing some basic permissions checks.

Bug: 144246837
Test: FrameworksNetTests passing, new tests added
Change-Id: I68d2293fc1468544f0d9f64d02ea7e1c80c8d18c
2020-01-30 18:41:12 -08:00
Chalard Jean
511f7e3792 Add public fields to NetworkScore and make it @SystemApi
Bug: 113554781
Bug: 146583853
Test: FrameworksNetTests
Change-Id: I19d965c0146196cb67b3417eb1790ccd90ce3233
2020-01-30 18:45:52 +09:00
markchien
e1322a8a8e NetworkAgent: Fix doc build fail by invalid tag
Bug: 138306002
Bug: 139268426
Test: make doc-comment-check-docs

Change-Id: I8b8df5096b90ad10545087ab09f68ecae637aa35
Merged-In: I8b8df5096b90ad10545087ab09f68ecae637aa35
2020-01-30 03:37:45 +00:00
sqian
d60481ce20 Make most of NetworkAgent @SystemApi.
Bug: 138306002
Bug: 139268426
Test: atest FrameworksNetTests FrameworksWifiTests FrameworksTelephonyTests
Test: atest android.net.cts.ConnectivityManagerTest
Change-Id: I856f01f02c35c2f6a886d8b98039e5dfbc48148b
Merged-In: I856f01f02c35c2f6a886d8b98039e5dfbc48148b
(cherry picked from commit 980ed12f7f)
2020-01-29 16:45:03 -08:00
Sarah Chin
f75d09fac1 API changes for IPv6 MTU support
Change mtu->mtuV4 and add mtuV6 for DataProfile and DataCallResult
Add mtu to RouteInfo and update test

Test: atest FrameworksTelephonyTests
Bug: 146668814
Change-Id: I43c7e088e46e40f38d8114548e0fc4e39d7f91cb
Merged-In: I43c7e088e46e40f38d8114548e0fc4e39d7f91cb
2020-01-30 00:17:19 +09:00
Jack Yu
d956e5b326 Fixed the documentation and unit tests
Fixed the documentation and re-eanble the
broken unit tests.

Test: LinkAddressTest
Bug: 142949345
Merged-In: I0ac8c022f70cdf9305c183996c2464a8e04ba5ae
Change-Id: I0ac8c022f70cdf9305c183996c2464a8e04ba5ae
(cherry picked from commit b67261b01c)
2020-01-26 21:37:36 -08:00
Jack Yu
590d408a06 Added expiration time and deprecation time support
Added link address deprecation time and expiration
time for SSC mode 3 support.

Bug: 135717900
Bug: 142949345
Test: LinkAddressTest

Merged-In: Ibc030d2a70ded66e00dd3bdae209609b9118de78
Change-Id: Ibc030d2a70ded66e00dd3bdae209609b9118de78
(cherry picked from commit 05d5b3b59f)
2020-01-26 21:32:12 -08:00
Jack Yu
b67261b01c Fixed the documentation and unit tests
Fixed the documentation and re-eanble the
broken unit tests.

Test: LinkAddressTest
Bug: 142949345
Change-Id: I0ac8c022f70cdf9305c183996c2464a8e04ba5ae
2020-01-26 16:01:28 -08:00
Automerger Merge Worker
ca9f47ace7 Merge "Add API for apps to check if they are the network owner" am: 78433a68ee am: 3836f2f7cb am: 091626b927
Change-Id: Ibe4cc2bd1d588dcbccd83f53ee3da9d067ae85b6
2020-01-24 18:47:28 +00:00
Cody Kesting
08efffc46e Merge "Fix javadoc build break s/line/link/" 2020-01-24 18:37:51 +00:00
Qingxi Li
78433a68ee Merge "Add API for apps to check if they are the network owner" 2020-01-24 18:12:52 +00:00
Nathan Harold
74f0fb8d4e Fix javadoc build break s/line/link/
Bug: 148248781
Test: compilation
Change-Id: I9df208a9b063b71b2f6cc3099005d1ab38044cd2
Merged-in: I9df208a9b063b71b2f6cc3099005d1ab38044cd2
2020-01-24 09:43:03 -08:00
Qingxi Li
bb8da980ae Add API for apps to check if they are the network owner
This CL extends NetworkCapabilities#mEstablishingVpnAppUid
to the network owner app UID and introduces a new public API
to get this owner app's UID.

Bug: 142072839
Test: atest FrameworksNetTests
Change-Id: Id83cdea62b89b586aff74e51e3fee60e53d37d4c
2020-01-24 17:28:23 +00:00
Automerger Merge Worker
d164fea641 Merge "Add AIDL for registering ConnectivityDiagnosticCallbacks." am: 680cce79b9 am: 346cc58d29 am: 7c0628505b
Change-Id: Iec4dcf4c39edb8994ed72b9550845ea5962e836a
2020-01-24 17:16:19 +00:00
Automerger Merge Worker
0461816497 Merge "Define ConnectivityDiagnosticsCallback IBinder impl." am: 54600d7b00 am: f94fb42850 am: 1d7b1dddd4
Change-Id: I5a77211d1f940166c02c4aac31c9add9466c76b1
2020-01-24 17:15:46 +00:00
Cody Kesting
680cce79b9 Merge "Add AIDL for registering ConnectivityDiagnosticCallbacks." 2020-01-24 16:38:22 +00:00
Cody Kesting
54600d7b00 Merge "Define ConnectivityDiagnosticsCallback IBinder impl." 2020-01-24 16:38:08 +00:00
Lorenzo Colitti
6a0bafdb58 Merge changes I7065d081,Ic7c3a331,Ia432057b
* changes:
  Add API for tethering clients change
  Allows the caller to specify configuration by TetheringRequest
  Make TetheringManager to system API
2020-01-24 16:23:18 +00:00
markchien
91c78e57df Allows the caller to specify configuration by TetheringRequest
This is initial work to allow caller to pass their prefered
configuration to start tethering. Caller may able to specify the
downstream interface ipv4 address with dhcp server disabled for
static IP configuration, or able to exempt entitlement check if
they have permission in follow up CL.

Bug: 141256482
Test: -atest TetheringTest
      -ON/OFF wifi tethering

Change-Id: Ic7c3a33195bbd7e72f9b8e73fa148be476b87bf3
Merged-In: Ic7c3a33195bbd7e72f9b8e73fa148be476b87bf3
2020-01-24 23:39:50 +09:00
markchien
6ae63e5232 Make TetheringManager to system API
Also deprecated tethering APIs in ConnectivityManager.
Will have follow up change to remove @hide tethering function in
ConnectivityManager.

Bug: 145093446
Bug: 148038547
Test: -build, flash, boot
      -atest TetheringTests

Change-Id: Ia432057bf9056727c4a0ca97d160a49274d33581
Merged-In: Ia432057bf9056727c4a0ca97d160a49274d33581
2020-01-24 23:39:49 +09:00
Automerger Merge Worker
a223fbd6be Merge "Add list of Administrator UIDs to NetworkCapabilities." am: 452ccae317 am: 347f56c836 am: f11b5198ad
Change-Id: Idcd07e357703f7ae3f2c09de33b80b328e6bd384
2020-01-24 08:06:14 +00:00
Automerger Merge Worker
b00a05654c Merge "Define Bundle keys for ConnectivityDiagnostics." am: eedaa1f471 am: e049dc0e3d am: bfd81af9ef
Change-Id: Iad2482b4599ce9d2c21baf9359cbacd5fff9a88f
2020-01-24 08:03:39 +00:00