Commit Graph

4754 Commits

Author SHA1 Message Date
nharold
4e2e3f823b Merge "Fix ConnectivityServiceTest for NATT Keepalive"
am: cab3e6009c

Change-Id: Idbdffc7bbd2d9a96f6e6052810722df04a20a65c
2018-02-20 22:55:38 +00:00
nharold
cab3e6009c Merge "Fix ConnectivityServiceTest for NATT Keepalive" 2018-02-20 19:17:23 +00:00
Chalard Jean
0bf8c2522a Merge changes Ic28c5653,Ic635f97b am: 0ca21cfdfe am: a0402e1baa
am: a9b555cfa1

Change-Id: Ieea9917b3a68e08686c74ebf39e5fed61f641a7a
2018-02-19 08:36:01 +00:00
Chalard Jean
a9b555cfa1 Merge changes Ic28c5653,Ic635f97b am: 0ca21cfdfe
am: a0402e1baa

Change-Id: I6596fae1946bffade125a14b3bd095eda557a7a5
2018-02-19 08:24:47 +00:00
Chalard Jean
a0402e1baa Merge changes Ic28c5653,Ic635f97b
am: 0ca21cfdfe

Change-Id: I38218d8652ec36f2ea076a6806df883a9c9636de
2018-02-19 08:14:19 +00:00
Chalard Jean
0bfcb6c5b2 Merge "Don't refcount TRACK_DEFAULT requests." am: 7207e1a65a am: 04c70248fb
am: e00ba2e603

Change-Id: Ic2b19e9f3f7d8f67cc5854688e5e14ca2a419e66
2018-02-19 04:12:50 +00:00
Chalard Jean
e00ba2e603 Merge "Don't refcount TRACK_DEFAULT requests." am: 7207e1a65a
am: 04c70248fb

Change-Id: Ib3e0e89a9d80546fbf3555cfdf715f2bd8e4ab94
2018-02-19 04:01:17 +00:00
Chalard Jean
04c70248fb Merge "Don't refcount TRACK_DEFAULT requests."
am: 7207e1a65a

Change-Id: I094ad8f9764f5cd657e2fe98c846710c8d241b64
2018-02-19 03:54:25 +00:00
Treehugger Robot
0ca21cfdfe 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
7207e1a65a Merge "Don't refcount TRACK_DEFAULT requests." 2018-02-19 02:13:48 +00:00
Chalard Jean
a23189f7e5 Merge "DO NOT MERGE : fix useless import" am: 67036aacbc -s ours am: 684228821c -s ours
am: 18131d6335  -s ours

Change-Id: I7277bdc2fe3340c01004cd0ec3d4fbee25ffee69
2018-02-19 02:01:41 +00:00
Chalard Jean
9f48d166f6 [LT2] Fix release request while lingering.
Test: runtest framework-net
Change-Id: Ic28c5653d16351903b792e76ba8b199b7ed1f8d4
2018-02-19 11:00:58 +09:00
Chalard Jean
18131d6335 Merge "DO NOT MERGE : fix useless import" am: 67036aacbc -s ours
am: 684228821c  -s ours

Change-Id: I75fc8e73f448ffee44a28149843c1d08399e255e
2018-02-19 01:57:09 +00:00
Chalard Jean
684228821c Merge "DO NOT MERGE : fix useless import"
am: 67036aacbc  -s ours

Change-Id: Ic717c478266a317fab1c618bc2a894e6610ffdd4
2018-02-19 01:51:39 +00:00
Chalard Jean
67036aacbc Merge "DO NOT MERGE : fix useless import" 2018-02-18 23:14:42 +00:00
Nathan Harold
0990bc8b57 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
Jeff Sharkey
6be9ee13d9 Merge "Better handling of NTP-based clocks." 2018-02-16 22:13:01 +00:00
Jeff Sharkey
af8f5f5ebc Better handling of NTP-based clocks.
Now that we have a nice Clock abstraction, we can use it to represent
a clock backed by an NTP fix.  (This makes testing logic much easier
to write.)

We now rely completely on NetworkTimeUpdateService to keep our NTP
fix up to date, instead of trying to refresh in the middle of
critical paths which could trigger random ANRs.

Add internal FallbackClock to make it easier to handle missing NTP
fixes.  Add internal SimpleClock to let implementers focus on single
millis() method.

Test: bit FrameworksNetTests:com.android.server.net.NetworkStatsServiceTest
Test: bit FrameworksServicesTests:com.android.server.NetworkPolicyManagerServiceTest
Bug: 69714690, 72320957
Change-Id: Ic32cdcbe093d08b73b0e4b23d6910b23ea8e1968
Exempt-From-Owner-Approval: approved in previous PS
2018-02-16 22:11:35 +00:00
Benedict Wong
614a50d5d7 Merge "Correct bug in IpSecTransformTest" am: b05d401748 am: 4a52c1438a
am: fb006fa020

Change-Id: Ic29f13053365f3de8d01f9c38f8460d92748a41d
2018-02-16 20:51:37 +00:00
Benedict Wong
fb006fa020 Merge "Correct bug in IpSecTransformTest" am: b05d401748
am: 4a52c1438a

Change-Id: I990729e8592e70898867fe72a3d628fd7f9fdaf0
2018-02-16 20:43:12 +00:00
Benedict Wong
4a52c1438a Merge "Correct bug in IpSecTransformTest"
am: b05d401748

Change-Id: If99a991052a821f43b8238a47d0d2c7e00362bc3
2018-02-16 20:28:18 +00:00
Benedict Wong
b05d401748 Merge "Correct bug in IpSecTransformTest" 2018-02-16 18:32:05 +00:00
Chalard Jean
a7c93b0b5b [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
b0bf117861 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
31cbef1cbc 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
299e793837 Merge "Add missing'}' in javadoc of public API method" am: 8f22a42cf7 am: e7b8b95aa8
am: 8d2c7aa52b

Change-Id: I2cfda60077c57d151fb8599845cd202bbc4e625d
2018-02-16 07:58:57 +00:00
Hugo Benichi
8d2c7aa52b Merge "Add missing'}' in javadoc of public API method" am: 8f22a42cf7
am: e7b8b95aa8

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

Change-Id: I3afcd9a3752ff6d158d68ca3ce19272151c1908c
2018-02-16 07:43:08 +00:00
Treehugger Robot
8f22a42cf7 Merge "Add missing'}' in javadoc of public API method" 2018-02-16 03:19:35 +00:00
Benedict Wong
b7ca6bf4c1 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
d4d611954e 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
74ef4d0b1d Merge changes I3d68dbf8,I6ea524bb,I978d9119 am: 91d3912eab am: 004939fd82
am: d9663d47c5

Change-Id: Ic6d639358c3310820bd925df93d4843d7edffc57
2018-02-15 14:23:57 +00:00
Chalard Jean
d9663d47c5 Merge changes I3d68dbf8,I6ea524bb,I978d9119 am: 91d3912eab
am: 004939fd82

Change-Id: Iebc6a31b975fd7ba429bd9bae89cd9783776d1c3
2018-02-15 13:09:26 +00:00
Chalard Jean
004939fd82 Merge changes I3d68dbf8,I6ea524bb,I978d9119
am: 91d3912eab

Change-Id: I6ffc0a841d0aa8479bb5b6afba49c5130af879da
2018-02-15 12:57:16 +00:00
Chalard Jean
91d3912eab 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
b771edfea4 Merge "Copy IpSecConfig when IpSecTransforms are created" am: 2c8456b22e am: 978037db6c
am: cce3e4687d

Change-Id: I511e6b0cadfc24f24a492ae63c48a8b4baa89edb
2018-02-15 06:01:49 +00:00
Benedict Wong
cce3e4687d Merge "Copy IpSecConfig when IpSecTransforms are created" am: 2c8456b22e
am: 978037db6c

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

Change-Id: I24ac6baa0492a46bf5810bc6bc146d9aaa9eccab
2018-02-14 21:14:19 +00:00
Chalard Jean
52e239618b 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
a23bc9e501 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
2550e069bc 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
159abb6cff 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
1961fb7435 fix isActiveNetworkMetered with VPNs am: 97f679b04f
am: 8fa2e19e73

Change-Id: I177eff1237dd59514ccf91397a3d307148bc37b1
2018-02-09 21:40:42 +00:00
Eric Enslen
8fa2e19e73 fix isActiveNetworkMetered with VPNs
am: 97f679b04f

Change-Id: I8d59bc23e9153c54e64af59816d11301b490c9eb
2018-02-09 21:26:09 +00:00
Eric Enslen
97f679b04f 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
Hugo Benichi
cbfbb3755a Add missing'}' in javadoc of public API method
Bug: 73052508
Test: pure documentation change
Change-Id: I92514629da1b000dd3d1165acd8efcdec75b49b9
2018-02-07 21:17:43 +09:00
Jong Wook Kim
622cda4338 Merge "MacAddress: Use SecureRandom and add a 46 bit randomized MAC generator" am: 028e2a048e am: c7ec0f6fc3
am: 83939e37af

Change-Id: I5f2d395705841b7da03b1552b16507466e47ef84
2018-02-07 09:26:56 +00:00
Jong Wook Kim
83939e37af Merge "MacAddress: Use SecureRandom and add a 46 bit randomized MAC generator" am: 028e2a048e
am: c7ec0f6fc3

Change-Id: I6dba4e244c660d29f107e471250d39e9caafb17e
2018-02-07 05:32:01 +00:00
Jong Wook Kim
c7ec0f6fc3 Merge "MacAddress: Use SecureRandom and add a 46 bit randomized MAC generator"
am: 028e2a048e

Change-Id: If35e07b78b17329a25cf78adbf3d8244af4a4f81
2018-02-07 05:20:19 +00:00
Jong Wook Kim
028e2a048e Merge "MacAddress: Use SecureRandom and add a 46 bit randomized MAC generator" 2018-02-07 02:06:07 +00:00