Commit graph

7,668 commits

Message SHA1
[NS A32] More simplification
Test: FrameworksNetTests
Change-Id: Ib713c4ae0100c8c242bbba87b2881311c5761869

Chalard Jean   commited 2020-02-04 16:29:01 +09:00
00419abe9e
[NS A31] Simplification
The condition this is testing for cannot actually be false.

The only place where the code writes a null value into this
map is at the end of computeRequestReassignmentForNetwork :
reassignedRequests.put(nri, null).
This proves the code the if() block, which proves that
newNetwork.isSatisfyingRequest(nri.request.requestId) is true.

By definition newNetwork.isSatisfyingRequest(nri) implies that
nri.mSatifier == newNetwork, which proves that
previousSatisfier == newNetwork whenever newSatisfier is null.

Fixes: 146482072
Test: FrameworksNetTests
Change-Id: Ifd6faedce7d49757b82a5f341076ab208b0ccfcb

Chalard Jean   commited 2020-02-04 16:28:20 +09:00
967190ecd0
[NS A30] Note linger out of the rematch loop
This doesn't have to be tested every time.

Test: FrameworksNetTests
Change-Id: Ic5702c8b4bd096860fe55c4d9e4c465703561911

Chalard Jean   commited 2020-02-04 16:24:23 +09:00
bf021685ca
[NS A29] Call LOST callbacks at the end of the rematch.
Bug: 113554781
Test: FrameworksNetTests
Change-Id: I72dd210a956545c75b3c702338af779e119d70e7

Chalard Jean   commited 2020-02-04 16:24:23 +09:00
7c2f15e1a4
[NS A28] Move setting the default network out of the rematch loop.
Bug: 113554781
Test: FrameworkNetTests NetworkStackTests
Change-Id: I02d85f17bf0ea37ae173f306f5a47d7551773c3a

Chalard Jean   commited 2020-02-04 16:23:58 +09:00
88b2f9ecab
Merge changes I446a8595,I68d2293f
* changes:
  Add VpnManager calls to ConnectivityService
  Add basic logic for profile-based VPNs

Benedict Wong   authored and   Gerrit Code Review   commited 2020-02-03 22:31:37 +00:00
3914abccce
Merge changes If8c8d1f3,I3a804a9f
* changes:
  [NS A27] Remove useless logs and a useless var
  [NS A26] Move available callbacks out of the rematch computation

Treehugger Robot   authored and   Gerrit Code Review   commited 2020-02-03 15:06:19 +00:00
49c185e487
Merge "Update javadocs for ConnectivityDiagnosticsManager."
Cody Kesting   authored and   Gerrit Code Review   commited 2020-02-03 14:56:13 +00:00
5b6967bc01
Merge "Add callback registration in ConnectivityService."
Cody Kesting   authored and   Gerrit Code Review   commited 2020-02-03 14:55:54 +00:00
29edc0ecc9
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

Cody Kesting   commited 2020-01-31 09:49:25 -08:00
ad51e01b3c
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

Cody Kesting   commited 2020-01-31 09:42:05 -08:00
73708bff55
Add VpnManager calls to ConnectivityService
This commit adds the relevant calls to ConnectivityService for the
VpnManager API to be functional

Bug: 144246837
Test: VpnManagerTest updated, FrameworksNetTests passing
Change-Id: I446a8595e3583a842a7f89c4f8d74526a85e311c

Benedict Wong   commited 2020-01-30 18:55:07 -08:00
79ea64f963
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

Benedict Wong   commited 2020-01-30 18:41:12 -08:00
df936cf1a7
Merge changes Iaa6f0d65,I68a16b64
* changes:
  Networking: Rename removeDoubleQuotes to sanitizeSsid
  Wifi: Rename removeDoubleQuotes to sanitizeSsid

David Su   authored and   Gerrit Code Review   commited 2020-01-30 22:42:16 +00:00
ca6e20c5d2
Merge "Add tests to services/tests/net test mapping"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2020-01-30 06:20:39 +00:00
543ecddcdc
NetworkAgent: Fix doc build fail by invalid tag
Bug: 138306002
Bug: 139268426
Test: make doc-comment-check-docs

Change-Id: I8b8df5096b90ad10545087ab09f68ecae637aa35
Merged-In: I8b8df5096b90ad10545087ab09f68ecae637aa35

markchien   authored and   Lorenzo Colitti   commited 2020-01-30 03:37:45 +00:00
e1322a8a8e
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)

sqian   commited 2020-01-29 16:45:03 -08:00
d60481ce20
Merge "API changes for IPv6 MTU support"
Sarah Chin   authored and   Gerrit Code Review   commited 2020-01-29 15:56:09 +00:00
b36aaf9fae
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

Sarah Chin   authored and   Lorenzo Colitti   commited 2020-01-30 00:17:19 +09:00
f75d09fac1
[NS A27] Remove useless logs and a useless var
These logs haven't found a bug in a long time and we now have
some structural guarantees that the conditions they check for
can't happen (like the checks that everything is happening on
the same thread).
Maybe we'll reinstate similar checks later, but for now they
are in the way and removing them is a small sacrifice for the
intended benefit.

The local was simply not used any more.

Test: FrameworksNetTests
Change-Id: If8c8d1f3eb883ffcf0fbdb70824b87dd70da507c

Chalard Jean   commited 2020-01-29 19:47:16 +09:00
0c7b9a9eb7
[NS A26] Move available callbacks out of the rematch computation
Bug: 113554781
Test: ConnectivityServiceTest
Change-Id: I3a804a9f6eaf50a3995eaaf6469a1c2b9387be14

Chalard Jean   commited 2020-01-29 19:47:11 +09:00
d8bea3bb90
Merge "Add implementation of getInterfaceHash()"
Paul Trautrim   authored and   Gerrit Code Review   commited 2020-01-29 05:12:12 +00:00
bc2cbc7499
Add implementation of getInterfaceHash()
Exempt-From-Owner-Approval: cherry-pick from internal
Bug: 136065010
Test: m
Change-Id: I314f19aeca82cc8653eab71c9526ea7a208e6b50
Merged-In: I314f19aeca82cc8653eab71c9526ea7a208e6b50

Paul Trautrim   commited 2020-01-29 14:09:56 +09:00
79a9c8cd76
Networking: Rename removeDoubleQuotes to sanitizeSsid
Bug: 145745815
Test: compiles
Change-Id: Iaa6f0d65cab556c24b0a9010427de8e6a02836c1
Merged-In: Iaa6f0d65cab556c24b0a9010427de8e6a02836c1
(clean cherry-pick from internal branch)

David Su   commited 2020-01-27 13:51:56 -08:00
0a4391d4f3
Merge changes I0ac8c022,Ia6ce0608,Ibc030d2a
* changes:
  Fixed the documentation and unit tests
  Disabled the tests
  Added expiration time and deprecation time support

Treehugger Robot   authored and   Gerrit Code Review   commited 2020-01-27 06:39:38 +00:00
055202128f
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)

Jack Yu   commited 2020-01-26 21:37:36 -08:00
d956e5b326
Disabled the tests
Will re-enable after fixing the negative time issue

Test: LinkAddressTest

Bug: 148257086
Merged-In: Ia6ce0608a2ce95be980e4f9ea62315076c4453be
Change-Id: Ia6ce0608a2ce95be980e4f9ea62315076c4453be
(cherry picked from commit d40e5498d0)

Jack Yu   commited 2020-01-26 21:34:00 -08:00
632771fd43
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)

Jack Yu   commited 2020-01-26 21:32:12 -08:00
590d408a06
Merge "Fix javadoc build break s/line/link/"
Cody Kesting   authored and   Gerrit Code Review   commited 2020-01-24 18:37:51 +00:00
08efffc46e
Merge "Add API for apps to check if they are the network owner"
Qingxi Li   authored and   Gerrit Code Review   commited 2020-01-24 18:12:52 +00:00
78433a68ee
Fix javadoc build break s/line/link/
Bug: 148248781
Test: compilation
Change-Id: I9df208a9b063b71b2f6cc3099005d1ab38044cd2
Merged-in: I9df208a9b063b71b2f6cc3099005d1ab38044cd2

Nathan Harold   authored and   Cody Kesting   commited 2020-01-24 09:43:03 -08:00
74f0fb8d4e
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

Qingxi Li   commited 2020-01-24 17:28:23 +00:00
bb8da980ae
Merge "Add AIDL for registering ConnectivityDiagnosticCallbacks."
Cody Kesting   authored and   Gerrit Code Review   commited 2020-01-24 16:38:22 +00:00
680cce79b9
Merge "Define ConnectivityDiagnosticsCallback IBinder impl."
Cody Kesting   authored and   Gerrit Code Review   commited 2020-01-24 16:38:08 +00:00
54600d7b00
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

Lorenzo Colitti   authored and   Gerrit Code Review   commited 2020-01-24 16:23:18 +00:00
6a0bafdb58
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

markchien   authored and   Lorenzo Colitti   commited 2020-01-24 23:39:50 +09:00
91c78e57df
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

markchien   authored and   Lorenzo Colitti   commited 2020-01-24 23:39:49 +09:00
6ae63e5232
Add AIDL for registering ConnectivityDiagnosticCallbacks.
ConnectivityService needs to allow for registering and unregistering
ConnectivityDiagnosticsCallbacks as part of ConnectivityDiagnostics API.
These methods will be used by ConnectivityDiagnosticsManager so that
privileged applications can receive notifications on network events by
the system.

Bug: 146444622
Test: compiles
Change-Id: Id00b30af5692db5eef47d0d948897148578d3b32

Cody Kesting   commited 2020-01-23 11:30:04 -08:00
d199a9db39
Define ConnectivityDiagnosticsCallback IBinder impl.
An IBinder implementation of the ConnectivityDiagnosticsCallback AIDL is
needed so that apps can receive notfications with their registered
callbacks for callbacks coming from ConnectivityService.

Bug: 143187964
Bug: 147848028
Test: compiles
Test: atest FrameworksNetTests
Change-Id: Ie62678f794d81e1edee68977ec684a911b5070b7

Cody Kesting   commited 2020-01-23 11:30:04 -08:00
3e7fb38355
Merge "Add list of Administrator UIDs to NetworkCapabilities."
Cody Kesting   authored and   Gerrit Code Review   commited 2020-01-23 17:52:58 +00:00
452ccae317
Merge "Define Bundle keys for ConnectivityDiagnostics."
Nathan Harold   authored and   Gerrit Code Review   commited 2020-01-23 16:34:16 +00:00
eedaa1f471
Define Bundle keys for ConnectivityDiagnostics.
ConnectivityDiagnosticsManager defines several callbacks that can be
invoked for registered ConnectivityDiagnosticsCallback instances.
onConnectivityReport and onDataStallSuspected include ConnectivityReport
and DataStallReport, respectively, both of which contain a
PersistableBundle to be used for passing information from the
NetworkStack module to the registered callback. When values will be
consistently passed inside these bundles, their keys are defined inside
ConnectivityReport and DataStallReport.

Bug: 147249364
Test: compiles
Test: atest FrameworksNetTests
Change-Id: Icc6bd4337865692b6ca7c18eacabff59ba3a5bb9

Cody Kesting   authored and   Nathan Harold   commited 2020-01-23 00:49:17 -08:00
d6ad3365fa
Add list of Administrator UIDs to NetworkCapabilities.
Adds a list of administrator UIDs to NetworkCapabilties. The carrier
privilege permission model allows multiple uids to be granted
network-management privileges via certificates stored on a SIM card or
in CarrierConfigManager. The current NetworkCapabilities only allows a
single uid to be stored to track the owner of the network - this change
remedies that discrepancy.

Bug: 147903575
Test: atest FrameworksNetTests
Change-Id: I3169d31e0270c976a720e80363cb268cbafd0455

Cody Kesting   commited 2020-01-22 23:59:56 -08:00
896939854b
Merge "Fix generic inferred type argument."
Treehugger Robot   authored and   Gerrit Code Review   commited 2020-01-23 06:39:57 +00:00
7e5cce2c67
Fix generic inferred type argument.
Test: compiles.
Test: atest FrameworksNetTests
Change-Id: I0dffb3f44fb465ac8bae3c41f26176e86f65e825

Cody Kesting   commited 2020-01-22 20:26:08 -08:00
ec88fda4a8
Add VpnManger API surface
This change adds the VpnManager, which will be used by apps to install
profiles for all platform VPN types (currently only IKEv2).

Bug: 143325939
Test: Compiles, FrameworksNetTests passing.
Change-Id: I57f854d0a5b18358f3541c24ca0cd8aed03fd7a1

Benedict Wong   commited 2020-01-22 19:24:24 -08:00
80240acd3f
Add Ikev2VpnProfile as public API
This change adds configuration classes for Platform VPNs, with the
extensibility for further platform VPNs to be added in future.

Profile validity is checked upon construction, and upon changing
conversion from VpnProfile instances. Internal storage and method calls
all use VpnProfiles to allow for reuse of existing infrastructure.
However, when Platform VPN implementations are started, the internal
VpnProfile will be converted back into the respective
PlatformVpnProfile for validity checking.

Bug: 143325939
Test: Compiles, FrameworksNetTests passing.
Change-Id: I3c375fb08c132fc062e893c375f5c36460122162

Benedict Wong   commited 2020-01-22 19:23:01 -08:00
5642043367
Add additional fields to VpnProfile for profile-based IKEv2/IPsec VPNs
This commit adds the fields required to support IKEv2/IPsec VPNs. Other
fields will be reused where possible.

Bug: 143221465
Test: Compiles, new tests written for parcel/unparcel, encode/decode
Change-Id: I4c0e8fb934e75548424a15bbfb35c2ea9a3a57bc

Benedict Wong   commited 2020-01-22 19:23:00 -08:00
d439f790c3
Merge changes from topic "connectivity-diagnostics-system-server"
* changes:
  Add ConnectivityDiagnosticsManager to System Server.
  Make DataStallReport Parcelable.
  Make ConnectivityReport Parcelable.

Cody Kesting   authored and   Gerrit Code Review   commited 2020-01-23 01:56:33 +00:00
880e0654e7
Merge "Add API for CaptivePortalData"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2020-01-22 15:55:17 +00:00
1c42b174ed