Commit Graph

8393 Commits

Author SHA1 Message Date
Automerger Merge Worker
af8f19e364 Merge "Use waitForIdle() to wait for Threaded processing." am: a67124b1af am: cfa95efc78 am: 3fd040a4f2
Change-Id: I0d7cbe58f55e25e552f6ae17ffd19cb79f86fe45
2020-02-06 16:38:11 +00:00
Automerger Merge Worker
a9342e09c3 [automerger skipped] Merge "Fire ConnectivityDiagnostics callbacks on Connectivity reported." am: bd021eb75e am: e42c0bbb01 am: 8d58f46d52 -s ours
am skip reason: Change-Id Icc6bcf7a2411133d8ecd7477bc351dad9333f24f with SHA-1 b8effbdfb8 is in history

Change-Id: If371a1a419404433930dbc732d4c84037b6fa0d5
2020-02-06 16:37:18 +00:00
Automerger Merge Worker
6d1cda9009 [automerger skipped] Merge "Implement INetworkMonitorCallbacks#notifyDataStallSuspected." am: d0045a1064 am: 08850cb3fb am: e183639edf -s ours
am skip reason: Change-Id I70320bdda9855dced31e08e6a0b25329fb5cb535 with SHA-1 4d8ecafb5e is in history

Change-Id: I2f2eef92341a4341a7fb8a20c32aec3c11e2d442
2020-02-06 16:37:01 +00:00
Automerger Merge Worker
3fd040a4f2 Merge "Use waitForIdle() to wait for Threaded processing." am: a67124b1af am: cfa95efc78
Change-Id: I1d648dd7d700230afab893336ef853a41717ba80
2020-02-06 16:23:10 +00:00
Automerger Merge Worker
8d58f46d52 Merge "Fire ConnectivityDiagnostics callbacks on Connectivity reported." am: bd021eb75e am: e42c0bbb01
Change-Id: I44d75efacebae77914eda6da7efaaf11676e71fc
2020-02-06 16:22:50 +00:00
Automerger Merge Worker
e183639edf Merge "Implement INetworkMonitorCallbacks#notifyDataStallSuspected." am: d0045a1064 am: 08850cb3fb
Change-Id: Iebcb87445b9bb7b36052c62160b4069b76432a18
2020-02-06 16:21:44 +00:00
Automerger Merge Worker
cfa95efc78 Merge "Use waitForIdle() to wait for Threaded processing." am: a67124b1af
Change-Id: Ida71ad5d045f87dd11877dc93d42885333bba336
2020-02-06 16:10:28 +00:00
Automerger Merge Worker
e42c0bbb01 Merge "Fire ConnectivityDiagnostics callbacks on Connectivity reported." am: bd021eb75e
Change-Id: I60d418afb145238981c17cc9a29ff57dc42c1ff0
2020-02-06 16:10:05 +00:00
Automerger Merge Worker
08850cb3fb Merge "Implement INetworkMonitorCallbacks#notifyDataStallSuspected." am: d0045a1064
Change-Id: I20aab2e77056df67df5bf9e9d6bd1888cf17a558
2020-02-06 16:08:33 +00:00
Cody Kesting
a67124b1af Merge "Use waitForIdle() to wait for Threaded processing." 2020-02-06 15:54:53 +00:00
Cody Kesting
bd021eb75e Merge "Fire ConnectivityDiagnostics callbacks on Connectivity reported." 2020-02-06 15:54:06 +00:00
Cody Kesting
d0045a1064 Merge "Implement INetworkMonitorCallbacks#notifyDataStallSuspected." 2020-02-06 15:47:26 +00:00
Automerger Merge Worker
970f9f6609 Merge "[NS A40] Read current reassignment state instead of global state" am: 9af866f454 am: ee850dc0c2 am: a43b0b1379
Change-Id: Ib34a50288317259cb3e3f7d631dff614485129a5
2020-02-06 04:42:10 +00:00
Automerger Merge Worker
a43b0b1379 Merge "[NS A40] Read current reassignment state instead of global state" am: 9af866f454 am: ee850dc0c2
Change-Id: I897076fedc74a810e4eaeb530c496219e26ebbf1
2020-02-06 04:26:56 +00:00
Automerger Merge Worker
ee850dc0c2 Merge "[NS A40] Read current reassignment state instead of global state" am: 9af866f454
Change-Id: I12ca40b29588c651c77d272bcde87fdbe8037f60
2020-02-06 04:23:11 +00:00
Chalard Jean
9af866f454 Merge "[NS A40] Read current reassignment state instead of global state" 2020-02-06 04:14:43 +00:00
Cody Kesting
1bae54ccb1 Use waitForIdle() to wait for Threaded processing.
Unit testing for ConnectivityDiagnostics API in ConnectivityServiceTest
is updated to use HandlerUtilsKt#waitForIdle. In the general case, this
takes the same time to run as verify-with-timeout (used previously).
However, test failures due to messages not being enqueued on the handler
(backed by the ConnectivityService Thread) won't incur the timeout
delay, as the thread will be idle sooner. This shortens the delay in the
event of a programming error.

Bug: 143187964
Test: atest FrameworksNetTests
Change-Id: Iae66309501bb83449ca735dfa5e972a9852cbcd0
2020-02-05 15:05:29 -08:00
Cody Kesting
a58c07c71e Fire ConnectivityDiagnostics callbacks on Connectivity reported.
When ConnectivityService#reportNetworkTested is called, the platform
needs to fire ConnectivityDiagnostics callbacks for registered callbacks
that are permissioned for the network being reported on. This adds a new
event to ConnectivityDiagnosticsHandler for invoking these callbacks.

Bug: 143187964
Test: compiles
Test: atest CtsNetTestCases ConnectivityServiceTest
Change-Id: Icc6bcf7a2411133d8ecd7477bc351dad9333f24f
Merged-In: Icc6bcf7a2411133d8ecd7477bc351dad9333f24f
2020-02-05 15:05:29 -08:00
Cody Kesting
1d326387e4 Implement INetworkMonitorCallbacks#notifyDataStallSuspected.
INetworkMonitorCallbacks defines notifyDataStallSuspected() for
notifying ConnectivityService of networks encountering a potential data
stall. A new event is introduced for ConnectivityDiagnosticsHandler to
process the notification and invoke the relevant
ConnectivityDiagnosticsCallbacks.

Bug: 143187964
Test: compiles
Test: atest CtsNetTestCases FrameworksNetTests
Change-Id: I70320bdda9855dced31e08e6a0b25329fb5cb535
Merged-In: I70320bdda9855dced31e08e6a0b25329fb5cb535
2020-02-05 15:05:28 -08:00
Automerger Merge Worker
c56b597b5a [automerger skipped] Merge "Implement INetworkMonitorCallbacks#notifyNetworkTestedWithExtras." am: b68115afb8 am: dcc253f9a5 am: 36922216ad -s ours
am skip reason: Change-Id Iab29da790c0f5faae68227770bc3a84bbc94f124 with SHA-1 980971150f is in history

Change-Id: Id9bb3a105949c34234f9f8f5ae1043e5d70613a5
2020-02-05 20:35:29 +00:00
Automerger Merge Worker
36922216ad Merge "Implement INetworkMonitorCallbacks#notifyNetworkTestedWithExtras." am: b68115afb8 am: dcc253f9a5
Change-Id: I3b32a91106646e98cf52b4ca48eeb4ebacd164db
2020-02-05 20:23:52 +00:00
Automerger Merge Worker
dcc253f9a5 Merge "Implement INetworkMonitorCallbacks#notifyNetworkTestedWithExtras." am: b68115afb8
Change-Id: I39b74228c6c2a48ace7ad36dba995fa6f91bfbb5
2020-02-05 20:09:32 +00:00
Cody Kesting
b68115afb8 Merge "Implement INetworkMonitorCallbacks#notifyNetworkTestedWithExtras." 2020-02-05 19:55:05 +00:00
Cody Kesting
d292a330c1 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
b8effbdfb8 Fire ConnectivityDiagnostics callbacks on Connectivity reported.
When ConnectivityService#reportNetworkTested is called, the platform
needs to fire ConnectivityDiagnostics callbacks for registered callbacks
that are permissioned for the network being reported on. This adds a new
event to ConnectivityDiagnosticsHandler for invoking these callbacks.

Bug: 143187964
Test: compiles
Test: atest CtsNetTestCases ConnectivityServiceTest
Change-Id: Icc6bcf7a2411133d8ecd7477bc351dad9333f24f
(cherry picked from commit 3d57b0f4ff5b56780c79df6062dfaf2b9fa5ae3c)
2020-02-05 07:10:47 -08:00
Cody Kesting
4d8ecafb5e Implement INetworkMonitorCallbacks#notifyDataStallSuspected.
INetworkMonitorCallbacks defines notifyDataStallSuspected() for
notifying ConnectivityService of networks encountering a potential data
stall. A new event is introduced for ConnectivityDiagnosticsHandler to
process the notification and invoke the relevant
ConnectivityDiagnosticsCallbacks.

Bug: 143187964
Test: compiles
Test: atest CtsNetTestCases FrameworksNetTests
Change-Id: I70320bdda9855dced31e08e6a0b25329fb5cb535
(cherry picked from commit 6c51dc9de39d7963a6bc6d03eacadf2ba2131e20)
2020-02-05 07:10:47 -08:00
Cody Kesting
1ea6b2ac75 Merge "Implement INetworkMonitorCallbacks#notifyNetworkTestedWithExtras." 2020-02-05 15:01:55 +00:00
Automerger Merge Worker
d34bf3f2ee Merge changes Ic1a5d032,I271e7f4d,I7af37281 am: 775babe0c6 am: f011628969 am: 4ea20ef2f0
Change-Id: Ic56ae1463dc4229e01f60d2c9afcbb7f6337a97d
2020-02-05 01:14:50 +00:00
Automerger Merge Worker
4ea20ef2f0 Merge changes Ic1a5d032,I271e7f4d,I7af37281 am: 775babe0c6 am: f011628969
Change-Id: If59fd7e540dbb2fa49cb10e5193ad3b5e044b39e
2020-02-05 01:03:09 +00:00
Automerger Merge Worker
f011628969 Merge changes Ic1a5d032,I271e7f4d,I7af37281 am: 775babe0c6
Change-Id: Ia1ec0ddbe841536f6525a9b5579603af620dae56
2020-02-05 00:59:17 +00:00
Chalard Jean
775babe0c6 Merge changes Ic1a5d032,I271e7f4d,I7af37281
* changes:
  [NS A39] Simplification
  [NS A38] Fill the initial reassignment
  [NS A37] Don't reassign requests multiple times
2020-02-05 00:53:28 +00:00
Automerger Merge Worker
ae5cf1933c [automerger skipped] Merge "Add separate user consent for Platform VPNs" am: 53bc29df86 am: 1784e620b6 am: 735f90f644 -s ours
am skip reason: Change-Id Ia6f36207d43c3748f938430c2780dcf29e5623f3 with SHA-1 b3e30be7e4 is in history

Change-Id: I7906d933b8e5e0a11d5ac800de9ef2c098323aaf
2020-02-05 00:38:40 +00:00
Automerger Merge Worker
735f90f644 Merge "Add separate user consent for Platform VPNs" am: 53bc29df86 am: 1784e620b6
Change-Id: If2d856c62b77da4bc8ea99335b1e89170f24fbca
2020-02-05 00:24:10 +00:00
Automerger Merge Worker
1784e620b6 Merge "Add separate user consent for Platform VPNs" am: 53bc29df86
Change-Id: I38ceff087e37f6ede6819e706c36ee9129a1cc6b
2020-02-05 00:07:41 +00:00
Benedict Wong
53bc29df86 Merge "Add separate user consent for Platform VPNs" 2020-02-04 23:56:16 +00:00
Cody Kesting
980971150f 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
6458ddff18 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
f6263953a3 Merge "Add separate user consent for Platform VPNs" 2020-02-04 21:04:01 +00:00
Automerger Merge Worker
91fa2079f3 Merge changes Icb062ffb,I66c4e8f5,I85247411,Id47c19b7,Ib713c4ae, ... am: 0b32981970 am: e8f922bf04 am: ebf43a3221
Change-Id: I213d2cdca4187ed30293dc433cfee9e8af782b6e
2020-02-04 13:48:46 +00:00
Automerger Merge Worker
ebf43a3221 Merge changes Icb062ffb,I66c4e8f5,I85247411,Id47c19b7,Ib713c4ae, ... am: 0b32981970 am: e8f922bf04
Change-Id: Id88e2387eedf611e2347605b97b4ec9031eaada8
2020-02-04 13:41:11 +00:00
Automerger Merge Worker
e8f922bf04 Merge changes Icb062ffb,I66c4e8f5,I85247411,Id47c19b7,Ib713c4ae, ... am: 0b32981970
Change-Id: I6b601f88b8411de9d1a5551d9b9b6c3e329087f4
2020-02-04 13:30:03 +00:00
Chalard Jean
7431e20d9f [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
1ade57a05c [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
3b270131c0 [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
3e5aaf2430 [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
69369aae29 [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
af4bcc61b7 [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
b0e2af767e [NS A34] Still more simplification
Test: ConnectivityServiceTest
Change-Id: I85247411eb8fdfb3eae0e7c309ea9537e41cfb80
2020-02-04 16:49:53 +09:00
Chalard Jean
337a8035ef [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
744fd0c773 [NS A32] More simplification
Test: FrameworksNetTests
Change-Id: Ib713c4ae0100c8c242bbba87b2881311c5761869
2020-02-04 16:29:01 +09:00