Commit Graph

4491 Commits

Author SHA1 Message Date
Chalard Jean
d98aec5eee Merge "Give VPNs the INTERNET capability when they route most of the IP space" am: ef307293e5
am: 58c3355b8f

Change-Id: I33c6fcc72753e00af601cf915aa78416174a3871
2018-03-02 12:46:46 +00:00
Chalard Jean
58c3355b8f Merge "Give VPNs the INTERNET capability when they route most of the IP space"
am: ef307293e5

Change-Id: Icd1466c79d2593fcab5bd2e31a1acb3a36a705da
2018-03-02 12:34:25 +00:00
Chalard Jean
ef307293e5 Merge "Give VPNs the INTERNET capability when they route most of the IP space" 2018-03-02 11:18:10 +00:00
Chalard Jean
687546ed4d Give VPNs the INTERNET capability when they route most of the IP space
Test: manual, plus wrote some new tests for this
Bug: 72765718
Change-Id: I9759da72b752fd8eeb1d0647db9ab341f04c0528
2018-03-02 16:20:22 +09:00
Chalard Jean
7f245b1f71 Merge "Fix up NetworkCapabilities' toString" am: ef16e8daab
am: 2e4c0bf13c

Change-Id: I2f1578589232c49574dbf401d7f4becfa350a1c0
2018-03-01 05:56:33 +00:00
Chalard Jean
2e4c0bf13c Merge "Fix up NetworkCapabilities' toString"
am: ef16e8daab

Change-Id: I21e66bc78a763f9e37725f50ca8b406ac7259518
2018-03-01 05:48:14 +00:00
Chalard Jean
ef16e8daab Merge "Fix up NetworkCapabilities' toString" 2018-03-01 04:01:16 +00:00
Chalard Jean
8337e58db2 Fix up NetworkCapabilities' toString
Test: manual
Change-Id: I3bcec6a6873e8ec7ced0820d3d5b92249b19fe0a
2018-02-28 19:47:48 +09:00
Pavel Maltsev
fe1ed24e15 Merge "Add OEM_PAID network capability" am: 230f251155
am: 35999ae101

Change-Id: Ie0377fea66f784c910bd0a06f87543cc5cf82c84
2018-02-28 08:28:25 +00:00
Pavel Maltsev
35999ae101 Merge "Add OEM_PAID network capability"
am: 230f251155

Change-Id: I2fb8825bc1038783ef45907846b52192b6fe5d18
2018-02-28 08:14:48 +00:00
Treehugger Robot
230f251155 Merge "Add OEM_PAID network capability" 2018-02-28 07:06:00 +00:00
Andreas Gampe
19a31611ce Merge "Frameworks: Annotate JUnit4 test with @Test" am: 4d9bec6b4a
am: 3a3bcf699f

Change-Id: I70e11136f6e261cccf4ce57f757f97999f74b402
2018-02-27 19:19:01 +00:00
Andreas Gampe
3a3bcf699f Merge "Frameworks: Annotate JUnit4 test with @Test"
am: 4d9bec6b4a

Change-Id: I0c684a434a0f43fcae1a766c6c84a756115d9dcb
2018-02-27 19:07:49 +00:00
Andreas Gampe
71510464df Frameworks: Annotate JUnit4 test with @Test
Mollify Errorprone.

Bug: 72076216
Test: m javac-check RUN_ERROR_PRONE=true
Test: atest IpSecServiceParameterizedTest
Change-Id: Ia3a253c4c5994937efc0f498ac047c5fb4eee3e9
2018-02-26 08:09:26 -08:00
nharold
137c833e70 Merge "Fix ConnectivityServiceTest for NATT Keepalive" am: f6bbc21688
am: 4f00de4aad

Change-Id: I3c28cbb55f8226776792df9cacf1b5e527389157
2018-02-20 23:07:53 +00:00
nharold
4f00de4aad Merge "Fix ConnectivityServiceTest for NATT Keepalive"
am: f6bbc21688

Change-Id: Idbdffc7bbd2d9a96f6e6052810722df04a20a65c
2018-02-20 22:55:38 +00:00
nharold
f6bbc21688 Merge "Fix ConnectivityServiceTest for NATT Keepalive" 2018-02-20 19:17:23 +00:00
Chalard Jean
21a3501037 Merge changes Ic28c5653,Ic635f97b am: ba40cd6083
am: 5d82ce61c4

Change-Id: I6596fae1946bffade125a14b3bd095eda557a7a5
2018-02-19 08:24:47 +00:00
Chalard Jean
5d82ce61c4 Merge changes Ic28c5653,Ic635f97b
am: ba40cd6083

Change-Id: I38218d8652ec36f2ea076a6806df883a9c9636de
2018-02-19 08:14:19 +00:00
Chalard Jean
aedde0d17b Merge "Don't refcount TRACK_DEFAULT requests." am: 5be0159188
am: 0f0f42cf2a

Change-Id: Ib3e0e89a9d80546fbf3555cfdf715f2bd8e4ab94
2018-02-19 04:01:17 +00:00
Chalard Jean
0f0f42cf2a Merge "Don't refcount TRACK_DEFAULT requests."
am: 5be0159188

Change-Id: I094ad8f9764f5cd657e2fe98c846710c8d241b64
2018-02-19 03:54:25 +00:00
Treehugger Robot
ba40cd6083 Merge changes Ic28c5653,Ic635f97b
* changes:
  [LT2] Fix release request while lingering.
  [LT1] Add a test for release request while lingering
2018-02-19 03:45:27 +00:00
Chalard Jean
5be0159188 Merge "Don't refcount TRACK_DEFAULT requests." 2018-02-19 02:13:48 +00:00
Chalard Jean
6c8ee08f04 [LT2] Fix release request while lingering.
Test: runtest framework-net
Change-Id: Ic28c5653d16351903b792e76ba8b199b7ed1f8d4
2018-02-19 11:00:58 +09:00
Chalard Jean
b861cdd0ac Merge "DO NOT MERGE : fix useless import" am: 1da02e25a4 -s ours
am: 2ed0569b88  -s ours

Change-Id: I75fc8e73f448ffee44a28149843c1d08399e255e
2018-02-19 01:57:09 +00:00
Chalard Jean
2ed0569b88 Merge "DO NOT MERGE : fix useless import"
am: 1da02e25a4  -s ours

Change-Id: Ic717c478266a317fab1c618bc2a894e6610ffdd4
2018-02-19 01:51:39 +00:00
Chalard Jean
1da02e25a4 Merge "DO NOT MERGE : fix useless import" 2018-02-18 23:14:42 +00:00
Nathan Harold
e8ae0ebed3 Fix ConnectivityServiceTest for NATT Keepalive
Fix test breakages I caused when adding cell
support for NATT keepalives.

-Make the minimum keepalive interval a constant in
 ConnectivityManager and use it in tests.
-Re-Disallow IPv6 Keepalives

Bug: 73327535
Test: 'runtest -x ConnectivityServiceTest' now passes
Change-Id: I5ec4367d250ee371014e65c897c3897a25a05e2d
2018-02-16 16:34:50 -08:00
Benedict Wong
6c5785160d Merge "Correct bug in IpSecTransformTest" am: 99e01bc44d
am: 97b59dca81

Change-Id: I990729e8592e70898867fe72a3d628fd7f9fdaf0
2018-02-16 20:43:12 +00:00
Benedict Wong
97b59dca81 Merge "Correct bug in IpSecTransformTest"
am: 99e01bc44d

Change-Id: If99a991052a821f43b8238a47d0d2c7e00362bc3
2018-02-16 20:28:18 +00:00
Benedict Wong
99e01bc44d Merge "Correct bug in IpSecTransformTest" 2018-02-16 18:32:05 +00:00
Chalard Jean
03a2fd1c26 [LT1] Add a test for release request while lingering
Test: runtest framework-net
Change-Id: Ic635f97bf3dad8b695b3b8cc32c1a8b891166f9f
2018-02-16 18:09:42 +09:00
Chalard Jean
3c4c8cf5cf Don't refcount TRACK_DEFAULT requests.
This has no concrete impact on the behavior of ConnectivityService,
but in principle TRACK_DEFAULT requests should not be counted toward
requests that make a network foreground. It does not have an impact
because only VPNs could be affected by this, and VPNs are always in
the foreground by definition.

Test: runtest frameworks-net
Test: cts
Change-Id: Id2ae6b5c9d542fe168e64ed713b6ec0a04062c82
2018-02-16 17:59:29 +09:00
Chalard Jean
a3e497c580 DO NOT MERGE : fix useless import
This was added to avoid a merge conflict at a sensitive time.
It can (and should) go.

Test: no code change
Change-Id: I11d73e2d988ae61a168aa0f1cc7c2c506f509d30
2018-02-16 17:21:39 +09:00
Hugo Benichi
ede2444697 Merge "Add missing'}' in javadoc of public API method" am: 21c11c37b1
am: e7c45d2c8a

Change-Id: I51ad1f6b8d42f4c791c07d41297f02d3e798ccd9
2018-02-16 07:50:57 +00:00
Hugo Benichi
e7c45d2c8a Merge "Add missing'}' in javadoc of public API method"
am: 21c11c37b1

Change-Id: I3afcd9a3752ff6d158d68ca3ce19272151c1908c
2018-02-16 07:43:08 +00:00
Treehugger Robot
21c11c37b1 Merge "Add missing'}' in javadoc of public API method" 2018-02-16 03:19:35 +00:00
Benedict Wong
f430c89e18 Correct bug in IpSecTransformTest
testCreateTransformsWithSameConfigEqual used assertFalse rather than
assertTrue

Bug: 69385347
Test: Passing on walleye
Change-Id: I8caa26e184e8bfc3e8acc9061d85c22d27ebf448
2018-02-15 18:52:07 -08:00
Pavel Maltsev
3d5e45dc38 Add OEM_PAID network capability
Bug: 68762530

Test: runtest -x frameworks/base/tests/net/

Change-Id: I51c07e0c2211d631e90b27468c26b599e7b07bc8
2018-02-15 10:46:00 -08:00
Chalard Jean
3ea90e3152 Merge changes I3d68dbf8,I6ea524bb,I978d9119 am: bc388ae1a9
am: d6b4143b67

Change-Id: Iebc6a31b975fd7ba429bd9bae89cd9783776d1c3
2018-02-15 13:09:26 +00:00
Chalard Jean
d6b4143b67 Merge changes I3d68dbf8,I6ea524bb,I978d9119
am: bc388ae1a9

Change-Id: I6ffc0a841d0aa8479bb5b6afba49c5130af879da
2018-02-15 12:57:16 +00:00
Chalard Jean
bc388ae1a9 Merge changes I3d68dbf8,I6ea524bb,I978d9119
* changes:
  Deprecate CONNECTIVITY_ACTION.
  Publish FOREGROUND and add NOT_SUSPENDED capabilities.
  Send null UIDs to apps instead of single-uid lists.
2018-02-15 11:25:36 +00:00
Benedict Wong
ba6e5dc1d2 Merge "Copy IpSecConfig when IpSecTransforms are created" am: 2c8456b22e
am: 7d843254b8

Change-Id: I041cd94be9cefc997b95478444661b557d95e3dc
2018-02-14 21:25:08 +00:00
Benedict Wong
7d843254b8 Merge "Copy IpSecConfig when IpSecTransforms are created"
am: 2c8456b22e

Change-Id: I24ac6baa0492a46bf5810bc6bc146d9aaa9eccab
2018-02-14 21:14:19 +00:00
Chalard Jean
ae2424a97b Deprecate CONNECTIVITY_ACTION.
That was its destiny.
Use NetworkCallbacks instead.

Test: runtest frameworks-net, but this is only doc changes
Change-Id: I3d68dbf817de92c66d899a7cc4519c5639e4c049
2018-02-14 15:14:44 +09:00
Chalard Jean
b6a0c6dc07 Publish FOREGROUND and add NOT_SUSPENDED capabilities.
NOT_SUSPENDED and FOREGROUND are capabilities that need to
be public so as to reach feature parity with what information
can be gotten through the use of CONNECTIVITY_ACTION and
synchronous calls to ConnectivityManager. This change makes
them public, and wires up the NOT_SUSPENDED capability.
This deprecates in effect the old onSuspended and onResumed
callbacks, but these have never been public.

This also converts the onAvailable path from a multiple
binder call design to a simpler, single binder call. This
is only for internal convenience

Test: runtest frameworks-net
Test: cts
Test: also manual testing
Change-Id: I6ea524bb361ecef0569ea2f9006c1e516378bc25
2018-02-14 15:14:41 +09:00
Chalard Jean
b70f7cc467 Send null UIDs to apps instead of single-uid lists.
Prior to this change ConnectivityManager used to patch in the UID
of the requesting app inside the NetworkCapabilities sent to it.
The rationale was that the app may not know what other apps may
use the network, so the view it should have of the network should
always say the network only applies to that app.

But this has an unfortunate side effect : apps can't match the
received network against a default NetworkCapabilities. Ostensibly
this only applies to the system because all involved calls are
@hide, but still : system code would get some NetworkCapabilities,
for example using networkCapabilitiesForType, and then try to
match the capabilities of an available network using
satisfiedByNetworkCapabilities. Because the passed network is
declared to only apply to one's own UID and the UIDs of the
NetworkCapabilities are set to null meaning "I need this network
to apply to all UIDs", the answer will be "false".

While this is WAI in a sense, it is very counter-intuitive that
code trying to match a network would be required to patch in its
own UIDs.
There are three ways of fixing this :
1. Require all apps to do the above. It's correct, but it's
   cumbersome and counterintuitive. Multiple places in existing
   code needs to be fixed, Tethering is an example.
2. Write the UIDs of the caller in any NetworkCapabilities object
   that is created. This is not very practical, because it imposes
   the converse requirement on all NetworkAgents, which would then
   have to clear the UIDs before they send the capabilities to
   ConnectivityService. All NetworkAgents need to be fixed.
3. Instead of sending an object with a list of one UID to apps,
   send a null list. The drawback is that the networks nominally
   look to apps like they apply to all apps. I argue this does
   not matter ; what matters is that the UID lists do not leak.
   Clients just see a null list of UIDs (and third party can't
   even access them without using reflection). No other changes
   are required besides this two-line patch.

This patch implements 3. I believe it is the saner approach, with
both the most intuitive behavior and the best backward compatibility
characteristics, as well as the easiest change.

This does not encroach on the future plans to make the actual
UID list available to apps with NETWORK_SETTINGS.

Test: runtest frameworks-net
Change-Id: I978d91197668119e051c24e1d04aafe1644a41cf
2018-02-14 12:47:15 +09:00
Benedict Wong
86e8477175 Copy IpSecConfig when IpSecTransforms are created
This change prevents IpSecTransforms from being inadvertently modified
by changes to the IpSecConfig. Specifically, once the transform is
created, it takes a copy of the config, rather than a reference.

Bug: 69385347
Test: New tests added, and all test passing
Change-Id: I89b8660c175ca20aa70352dcda893434ff7fd42b
2018-02-13 23:23:13 +00:00
Eric Enslen
3a1b08fea1 fix isActiveNetworkMetered with VPNs
am: 6c5fe7befa

Change-Id: I8d59bc23e9153c54e64af59816d11301b490c9eb
2018-02-09 21:26:09 +00:00
Eric Enslen
6c5fe7befa fix isActiveNetworkMetered with VPNs
Bug: 72871435
Test: flashed and verified, also ran runtest framework-net

Change-Id: I69319a7db269489053426bb2d41574180be2d43d
2018-02-08 17:53:13 +00:00