Commit Graph

8711 Commits

Author SHA1 Message Date
Automerger Merge Worker
05a3496121 Merge "Add separate user consent for Platform VPNs" am: e2684df6ef
Change-Id: I38ceff087e37f6ede6819e706c36ee9129a1cc6b
2020-02-05 00:07:41 +00: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
406c383aa1 Merge "Add separate user consent for Platform VPNs" 2020-02-04 21:04:01 +00:00
Automerger Merge Worker
365808dea8 Merge changes Icb062ffb,I66c4e8f5,I85247411,Id47c19b7,Ib713c4ae, ... am: 0b32981970 am: b4a492f581 am: 59c5f07871
Change-Id: I213d2cdca4187ed30293dc433cfee9e8af782b6e
2020-02-04 13:48:46 +00:00
Automerger Merge Worker
59c5f07871 Merge changes Icb062ffb,I66c4e8f5,I85247411,Id47c19b7,Ib713c4ae, ... am: 0b32981970 am: b4a492f581
Change-Id: Id88e2387eedf611e2347605b97b4ec9031eaada8
2020-02-04 13:41:11 +00:00
Automerger Merge Worker
b4a492f581 Merge changes Icb062ffb,I66c4e8f5,I85247411,Id47c19b7,Ib713c4ae, ... am: 0b32981970
Change-Id: I6b601f88b8411de9d1a5551d9b9b6c3e329087f4
2020-02-04 13:30:03 +00:00
Chalard Jean
7e416aa19e [NS A40] Read current reassignment state instead of global state
The reassignment state has the future value, but is transient
instead of global. With this, the reassignment loop does not
read from global state any more, so it's not affected by the
side effects from the loop.

This means future patches will be able to move the side effects
out of the computation.

Test: atest ConnectivityServiceTest
Change-Id: I43499f19730bcd94b691cfea83aa1ca1d3de75db
2020-02-04 21:18:25 +09:00
Chalard Jean
933ebfa503 [NS A39] Simplification
If newNetwork is satisfying this request, it means it is the old
satisfier. Plain and simple.

Test: ConnectivityServiceTest
Change-Id: Ic1a5d032801bac476b1c1f53da6f1c4c6056bff0
2020-02-04 16:49:54 +09:00
Chalard Jean
b7ebc8a28f [NS A36] Add a test for lost trusted capability
This bug will be drive-by fixed by the next refactoring, so
set up a test to see the difference.

Bug: 113554781
Test: this
Change-Id: Icb062ffbae904d1836a4a16fc5395687c3eda7b6
2020-02-04 16:49:54 +09:00
Chalard Jean
84292aaa46 [NS A38] Fill the initial reassignment
This is more expensive for now but it will allow subsequent patches
to read relevant state from the reassignment instead of from the
global state, which will stop the computation of the reassignment
from reading state that is mutated by the same loop. Eventually
this lets us completely split the computation from the side effects.
The ugly parts of this patch will be cleaned up later as a result,
namely in patches [NS B04] and [NS B05].

Test: ConnectivityServiceTest
Change-Id: I271e7f4d4bc81493c1ea212025b7130619592a8a
2020-02-04 16:49:54 +09:00
Chalard Jean
bf91f5f182 [NS A37] Don't reassign requests multiple times
This is an optimization that skips doing intermediate assignments
of networks to requests that will undergo multiple changes during
the recomputation.
It happens to fix a bug where some of these intermediate states
used to have a visible, transient side effect.

Bug: 113554781
Test: ConnectivityServiceTest
Change-Id: I7af3728152a1cf7571de67f394088a5970ee3c1e
2020-02-04 16:49:54 +09:00
Chalard Jean
04bc807898 [NS A35] Send updated scores to factories at the end.
Test: ConnectivityServiceTests
Change-Id: I66c4e8f52e11bc7e199dd8c12d43b0b136a21f19
2020-02-04 16:49:53 +09:00
Chalard Jean
adf1aafb53 [NS A34] Still more simplification
Test: ConnectivityServiceTest
Change-Id: I85247411eb8fdfb3eae0e7c309ea9537e41cfb80
2020-02-04 16:49:53 +09:00
Chalard Jean
8e382110b8 [NS A33] Unify changing the default network
makeDefault() will be called in rematchAllNetworksAndRequests
in all cases and its first job is to set mDefaultNetwork.

The old code checks if the currently processing request is
the default request and assigns mDefaultNetwork if it is,
doing it earlier than in the new code iff the new default is
not null. However there is no good reason to assign this
member earlier in the non-null case than in the null case,
it's simpler if the same code path is used in both cases.
mDefaultNetwork is also not used between the old place where
it was set and the new place where it is set, so changing
the timing of the assignment has no observable side effects.

Test: ConnectivityServiceTest
Change-Id: Id47c19b73650ba66bff73b07edb8fd95c707e699
2020-02-04 16:49:52 +09:00
Chalard Jean
00419abe9e [NS A32] More simplification
Test: FrameworksNetTests
Change-Id: Ib713c4ae0100c8c242bbba87b2881311c5761869
2020-02-04 16:29:01 +09:00
Chalard Jean
967190ecd0 [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
2020-02-04 16:28:20 +09:00
Chalard Jean
bf021685ca [NS A30] Note linger out of the rematch loop
This doesn't have to be tested every time.

Test: FrameworksNetTests
Change-Id: Ic5702c8b4bd096860fe55c4d9e4c465703561911
2020-02-04 16:24:23 +09:00
Chalard Jean
7c2f15e1a4 [NS A29] Call LOST callbacks at the end of the rematch.
Bug: 113554781
Test: FrameworksNetTests
Change-Id: I72dd210a956545c75b3c702338af779e119d70e7
2020-02-04 16:24:23 +09:00
Chalard Jean
88b2f9ecab [NS A28] Move setting the default network out of the rematch loop.
Bug: 113554781
Test: FrameworkNetTests NetworkStackTests
Change-Id: I02d85f17bf0ea37ae173f306f5a47d7551773c3a
2020-02-04 16:23:58 +09: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
Automerger Merge Worker
dd8b4569b6 Merge changes I446a8595,I68d2293f am: 3914abccce am: 3f8a000e5c
Change-Id: I27a4344fa2e3b91fe31e02bf41f20a2bc11c2ff6
2020-02-03 22:41:20 +00:00
Automerger Merge Worker
3f8a000e5c Merge changes I446a8595,I68d2293f am: 3914abccce
Change-Id: I8422163249ca637ab71b71777feded76e3225c2e
2020-02-03 22:34:25 +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
509cf84538 Merge changes If8c8d1f3,I3a804a9f am: 49c185e487 am: dff0d295a9 am: df7c6a7ab2
Change-Id: I69e6b412f150419baa9dc1860d190d85bfdfc47d
2020-02-03 15:18:41 +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
Automerger Merge Worker
df7c6a7ab2 Merge changes If8c8d1f3,I3a804a9f am: 49c185e487 am: dff0d295a9
Change-Id: I1a0085ad35ca95cab4086d4779ee15322094c2f6
2020-02-03 15:12:20 +00:00
Automerger Merge Worker
cffbf59942 Merge "Update javadocs for ConnectivityDiagnosticsManager." am: 5b6967bc01 am: b14259e0bd
Change-Id: Ie1ee81c6050df22b6e3cf9b752e34a1b01430634
2020-02-03 15:12:13 +00:00
Automerger Merge Worker
7d4ebb11d6 Merge "Add callback registration in ConnectivityService." am: 29edc0ecc9 am: 89a5e805f9
Change-Id: I88ab7b749860a0f94857743ba759bb47270857f6
2020-02-03 15:12:02 +00:00
Automerger Merge Worker
dff0d295a9 Merge changes If8c8d1f3,I3a804a9f am: 49c185e487
Change-Id: I6139500edf9c93d2995b822b19e9e9aaf3beaa7c
2020-02-03 15:07:46 +00:00
Automerger Merge Worker
b14259e0bd Merge "Update javadocs for ConnectivityDiagnosticsManager." am: 5b6967bc01
Change-Id: Ia393d1ee102ae7dfc4a7b5698b5f3b4882605e7c
2020-02-03 15:07:20 +00:00
Automerger Merge Worker
89a5e805f9 Merge "Add callback registration in ConnectivityService." am: 29edc0ecc9
Change-Id: Idf067ebd9299ca036965b7c7f82c13a6f659a821
2020-02-03 15:06:50 +00:00
Treehugger Robot
49c185e487 Merge changes If8c8d1f3,I3a804a9f
* changes:
  [NS A27] Remove useless logs and a useless var
  [NS A26] Move available callbacks out of the rematch computation
2020-02-03 15:06:19 +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
Automerger Merge Worker
c16cd77698 [automerger skipped] Merge changes Iaa6f0d65,I68a16b64 am: ca6e20c5d2 am: 196e334a59 am: b65ee4bbc1 -s ours
am skip reason: Change-Id Iaa6f0d65cab556c24b0a9010427de8e6a02836c1 with SHA-1 c19c94fe9b is in history

Change-Id: I306a831e47c08ac37de93285763500b73a4624ec
2020-01-31 16:47:44 +00:00
Automerger Merge Worker
b65ee4bbc1 Merge changes Iaa6f0d65,I68a16b64 am: ca6e20c5d2 am: 196e334a59
Change-Id: I7e66156659fb88110d2a7f027d488e15499caee2
2020-01-31 16:43:27 +00:00
Automerger Merge Worker
196e334a59 Merge changes Iaa6f0d65,I68a16b64 am: ca6e20c5d2
Change-Id: I687e59f2c25d5c5e2cb5b1574dbcf6f32ec8c817
2020-01-31 16:37:49 +00:00
Automerger Merge Worker
3e7018aa4f Merge "Add tests to services/tests/net test mapping" am: 543ecddcdc am: 9da1147695 am: 81bc04b765
Change-Id: Ib4632d4e3a42e56c5c841f4cc13709d91b4cab10
2020-01-31 16:31:45 +00:00
Automerger Merge Worker
21c0840aa6 [automerger skipped] Merge changes I8b8df509,I856f01f0 am: 5fcfe7cc4f am: ac6f266ef7 am: 7538c0dbdd -s ours
am skip reason: Change-Id I8b8df5096b90ad10545087ab09f68ecae637aa35 with SHA-1 6079c4d8eb is in history

Change-Id: I1fdecfaf7c028ea5999a97298f0649748773001d
2020-01-31 16:31:06 +00:00
Automerger Merge Worker
ace1f433fd [automerger skipped] Make most of NetworkAgent @SystemApi. am: d60481ce20 am: 940b91d9d5 am: ab1fcfae8c -s ours
am skip reason: Change-Id I856f01f02c35c2f6a886d8b98039e5dfbc48148b with SHA-1 980ed12f7f is in history

Change-Id: I9d1f5297925972196fd8bb21afa58f5a1a12ddfd
2020-01-31 16:31:00 +00:00
Automerger Merge Worker
81bc04b765 Merge "Add tests to services/tests/net test mapping" am: 543ecddcdc am: 9da1147695
Change-Id: I8c03db23b28eb231f352b578ca3faa33d519aed8
2020-01-31 16:29:48 +00:00
Automerger Merge Worker
7538c0dbdd Merge changes I8b8df509,I856f01f0 am: 5fcfe7cc4f am: ac6f266ef7
Change-Id: If280205257c6d8d6b0630c483ff307ee39e3ece7
2020-01-31 16:28:44 +00:00
Automerger Merge Worker
ab1fcfae8c Make most of NetworkAgent @SystemApi. am: d60481ce20 am: 940b91d9d5
Change-Id: I3119a05b9db4716cc7c78a7537ecc89a56e88264
2020-01-31 16:28:40 +00:00