Commit Graph

5351 Commits

Author SHA1 Message Date
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
android-build-team Robot
b8c0930d3b Snap for 4605948 from ce3f5d00f953203442dfbe07841d1c36a4eba00f to pi-release
Change-Id: Ic9f6a9f833e8022a85cc58d0d5ccf9c18e245d01
2018-02-15 08:21:09 +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
android-build-team Robot
715e736fea Snap for 4598635 from 049ecedd92d91fb692ec424311318cd8b8977b0d to pi-release
Change-Id: Ica483c727fc2da3c722fdf11e521fab348e2ac8a
2018-02-11 08:23:00 +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
android-build-team Robot
804d25996f Snap for 4593582 from e62a57a22f93928a4d78996dbfd0c7112e8074cf to pi-release
Change-Id: Ib40c275ba17406e0764bcb44668a1ddb62d87215
2018-02-08 08:24:53 +00:00
android-build-team Robot
76e92fa294 Snap for 4590521 from 7543974bc6c43e913c827834d85833627675dcaa to pi-release
Change-Id: Ic573f52329f64e17efb2adca2a1cf7e4363a496a
2018-02-07 13:29:57 +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
Jong Wook Kim
93dd5e6964 MacAddress: Use SecureRandom and add a 46 bit randomized MAC generator
Use SecureRandom instead of Random since Random is time based and can
increase the chance of generating same MAC address across multiple
devices.

createRandomUnicastAddress should randomize all bits of the address,
except for locally assigned bit and unicast bit. The previous method
that only randomizes NIC and use Google Base OUI is renamed to
createRandomUnicastAddressWithGoogleBase.

Bug: 72450936
Test: runtest frameworks-net
Change-Id: Icda650638c2c1c9fd90d509a87e86347c0e05f2d
2018-02-07 01:28:46 +00:00
Andreas Gampe
3cdcd5d395 Merge "Frameworks: Mark tests" am: 997937820d am: 043d868185
am: 6ae05e38bd

Change-Id: I55b62b64236937c66a21ec667216f7f1d505a5b5
2018-02-06 09:29:10 +00:00
Andreas Gampe
6ae05e38bd Merge "Frameworks: Mark tests" am: 997937820d
am: 043d868185

Change-Id: I73c717b99b9660a11141b5392c6993ab9aabf85c
2018-02-06 09:14:05 +00:00
Andreas Gampe
043d868185 Merge "Frameworks: Mark tests"
am: 997937820d

Change-Id: I07af71812c623a14bd8df098e9991a331bdecbc2
2018-02-06 09:04:38 +00:00
Treehugger Robot
997937820d Merge "Frameworks: Mark tests" 2018-02-06 06:03:09 +00:00
android-build-team Robot
cb8349b705 Snap for 4577102 from 7c691c606c0e68eea5ddea4a910232df68501332 to pi-release
Change-Id: If47b27c8ac969422b5addf5454007c14c28980cc
2018-01-31 17:24:47 +00:00
Andreas Gampe
3fa5c22fc8 Frameworks: Mark tests
Add @Ignore and @Test to make Errorprone happy.

Bug: 72076216
Test: m javac-check RUN_ERROR_PRONE=true
Test: atest ConnectivityServiceTest
Test: atest WifiManagerTest
Change-Id: Id2423c545eccaa768203faf86e14d0a558d927cd
2018-01-31 01:04:00 +00:00
nharold
4b1ac9cb0c Merge changes from topic "cherry-pick-cell-keepalive" am: 7e8374e9fc am: 86362b4677
am: 16f3959dd0  -s ours

Change-Id: I1852cb11d6d33963b8e463729a952c4c22bc553a
2018-01-30 20:05:03 +00:00
nharold
16f3959dd0 Merge changes from topic "cherry-pick-cell-keepalive" am: 7e8374e9fc
am: 86362b4677

Change-Id: Ib4ba3f739a91ea2700611732f71afec0cc997ae4
2018-01-30 19:52:22 +00:00
nharold
86362b4677 Merge changes from topic "cherry-pick-cell-keepalive"
am: 7e8374e9fc

Change-Id: I3001cd2693b2c57643672fd7f370b5cca2890585
2018-01-30 19:41:53 +00:00
nharold
7e8374e9fc Merge changes from topic "cherry-pick-cell-keepalive"
* changes:
  Rework KeepalivePacketData for Compatibility with Cell
  Add Constants for NATT Keepalive to RILConstants
  Relocate KeepalivePacketData to frameworks/base
2018-01-30 18:39:07 +00:00
android-build-team Robot
d1ba2d4b64 Snap for 4574286 from 848179264302c1a9a24f046e111a385470077952 to pi-release
Change-Id: Ic7743e34d3d71be2b3ccd08786acd93a1f077c25
2018-01-30 08:24:44 +00:00
Hugo Benichi
0cfad8c7bf Merge changes I303d1102,I72c9aa43,If13a5284 am: 1aaf45bf89 am: 5001af80ff
am: bb119158f9

Change-Id: Iad1030a22f25bed92bd9d504fb1a40fc1e1cfdc5
2018-01-30 01:55:28 +00:00
Hugo Benichi
bb119158f9 Merge changes I303d1102,I72c9aa43,If13a5284 am: 1aaf45bf89
am: 5001af80ff

Change-Id: Ida5f28fc0e8e99199ac7129a6e3df0fbe864d90b
2018-01-30 01:47:07 +00:00
Hugo Benichi
5001af80ff Merge changes I303d1102,I72c9aa43,If13a5284
am: 1aaf45bf89

Change-Id: I402de7fe5fc0e9bf56dc42f4c956c511baee78ab
2018-01-30 01:41:23 +00:00
Hugo Benichi
1aaf45bf89 Merge changes I303d1102,I72c9aa43,If13a5284
* changes:
  Fix default network validation overcounting
  Prevent crash in NetworkManagementServiceTest#shutdown()
  Fix ApfTest
2018-01-30 00:26:31 +00:00
gitbuildkicker
47de239e8a merge in pi-release history after reset to master 2018-01-29 14:54:38 -08:00
gitbuildkicker
a3a5090355 merge in pi-release history after reset to master 2018-01-29 11:53:00 -08:00
Nathan Harold
7f8d0be10d Rework KeepalivePacketData for Compatibility with Cell
KeepalivePacketData currently mixes multiple concepts: the
list of parameters that are used to generate a keepalive
packet, the keepalive packet itself, and the parameters that
are needed to send a keepalive packet over an ethernet link.

The KeepalivePacketData is now a parcelable that can be used
generically by any NetworkAgent, regardless of how that Agent
fulfills its duty to initiate and maintain a keepalive session.

Bug: 69063212
Test: verified with SL4A, additional tests pending
Merged-In: I23dc4827ae729583356a8ff0f02e39a2ad2b81f5
Change-Id: I23dc4827ae729583356a8ff0f02e39a2ad2b81f5
(cherry picked from commit 5be3f5a2b1)
2018-01-29 11:20:20 -08:00
Nathan Harold
583c95be3b Relocate KeepalivePacketData to frameworks/base
Due to an issue resolving the boot classpath, the
KeepalivePacketData structure cannot be referenced
by frameworks/opt/telephony while it is in services.

-Move KeepalivePacketData to android.net
-Also, relocate IpUtils without changing the package
 name.

Bug: 38350389
Test: compilation
Merged-In: If5fc63e9ad8b9b2d4c2fee47ff4bab2ab190a05a
Change-Id: If5fc63e9ad8b9b2d4c2fee47ff4bab2ab190a05a
(cherry picked from commit f8a2bc3eee)
2018-01-29 11:19:43 -08:00
Hugo Benichi
11f04e863e Fix default network validation overcounting
When switching from a validated default network to a new validated
default network (typically because of a better score),
DefaultNetworkMetrics would not reset the last validation timestamp.

This would cause the new default network to have a total recorded
validation time overcounted by the validation time of the previous
default network.

The following fix should be applied downstream for consumers of
previously recorded data:

  validation_time = min validation_time, duration_time);

Test: runtest -x frameworks/base/tests/net/../IpConnectivityMetricsTest
Change-Id: I303d11023527c19435f5f5e796a0295ae3f76d9f
2018-01-29 16:07:33 +09:00
Hugo Benichi
f78548d222 Prevent crash in NetworkManagementServiceTest#shutdown()
The shutdown method in NetworkManagementServiceTest was trying to close
the local socket on the test side, causing the NativeDaemonConnector
internal to NetworkManagementService to sometime crash due to the
output stream on NetworkManagementService side to throw on pending
reads.

The correct fix would be to shutdown the NativeDaemonConnector
inside NetworkManagementService and implement NetworkManagementService's
shutdown method, however there is no way to cleanly close a
NativeDaemonConnector.

Instead, this patch doesn't do any cleanup of the listening socket, the
test local socket, and its output stream. These objects' resources get
eventually collected by the system when the test process exits.

Test: runtest frameworks-net
Change-Id: I72c9aa43403754b55e9d23bf4f3ba8b7b4a3e10a
2018-01-29 16:01:56 +09:00