Commit Graph

690 Commits

Author SHA1 Message Date
Chalard Jean
48bb49deff Let DnsManager fill in LinkProperties for private DNSes
Test: new tests pass
Bug: 73641539
Change-Id: I971ef4d27b22a435d7459e1c4b31a8715ef6e610
2018-04-23 13:58:42 +09:00
Chalard Jean
2cc723e410 Merge "Add the list of private DNS addresses to LinkProperties" into pi-dev
am: f12a2130a4

Change-Id: I4b739c56e658690532ae9deb0b9a3bc9b2adf8b0
2018-04-20 04:49:43 -07:00
Chalard Jean
3e0a46a439 Add the list of private DNS addresses to LinkProperties
Test: atest android.net.LinkPropertiesTest, also new tests pass
Bug: 73641539
Change-Id: If33a35b1354a67db09411ff098f20064797296ad
2018-04-20 16:48:43 +09:00
Jeff Sharkey
569e8c496b Merge "Revert "Revert "OP_GET_USAGE_STATS should be noted, not checked.""" into pi-dev
am: 687ddf6928

Change-Id: Ie9bcdc9736c04ab787efc193311a20d03718b593
2018-04-16 10:19:39 -07:00
Jeff Sharkey
330f1c0b18 Merge "Revert "OP_GET_USAGE_STATS should be noted, not checked."" into pi-dev
am: 04efa57798

Change-Id: I2cc76316bca81c12e56337d6e36d82b0de6d9ded
2018-04-16 10:07:52 -07:00
Jeff Sharkey
069002e639 Revert "Revert "OP_GET_USAGE_STATS should be noted, not checked.""
This reverts commit d5992e681f.

Reason for revert: ijpedowitz@

Bug: 77662908
Change-Id: I596d330d64942105f447bb613012bb11e281a805
Exempt-From-Owner-Approval: keep tests passing
2018-04-16 16:50:34 +00:00
Jeff Sharkey
d5992e681f Revert "OP_GET_USAGE_STATS should be noted, not checked."
This reverts commit b1296e58da.

Reason for revert: ijpedowitz@

Bug: 77662908
Change-Id: I5dd0ad5038df90ea8a80ba6f583ee46fb24600c2
Exempt-From-Owner-Approval: keep tests passing
2018-04-16 16:39:55 +00:00
Jeff Sharkey
cef9082b02 Merge "OP_GET_USAGE_STATS should be noted, not checked." into pi-dev
am: 64bbb2014e

Change-Id: I38f5aecdb94c8b886ca4eba5908ab1b4a9c1fb89
2018-04-14 18:11:58 -07:00
Jeff Sharkey
b1296e58da OP_GET_USAGE_STATS should be noted, not checked.
Per email feedback, we should be using "noteOp" instead of "checkOp"
when testing if caller holds OP_GET_USAGE_STATS, so that we record
that caller used the operation.

Bug: 77662908
Test: builds, boots
Exempt-From-Owner-Approval: keep tests passing
Change-Id: I3a60345d590534fdbc2c1248e0d30dc85a5d6772
2018-04-13 19:32:25 +00:00
Chalard Jean
33ada883b8 Merge "Add a new ssid field in NetworkCapabilities." into pi-dev
am: f920300665

Change-Id: Ia1f4e51b7c2e9118789242cf6d9e7576c4167cda
2018-04-13 02:14:02 -07:00
Chalard Jean
3ec2c0fc84 Add a new ssid field in NetworkCapabilities.
Bug: 77891227
Test: frameworks-net
Change-Id: Ifba33ecd48ccecce7e8f8d05ff70bb85653f6163
2018-04-13 15:38:35 +09:00
Remi NGUYEN VAN
55c1d94234 Merge "Added tests for MultipathPolicyTracker." into pi-dev
am: 36483a9f2e

Change-Id: I2f47dd30f44722a0611967ce5375aa164f40c718
2018-04-10 20:37:06 -07:00
Remi NGUYEN VAN
36483a9f2e Merge "Added tests for MultipathPolicyTracker." into pi-dev 2018-04-11 02:53:14 +00:00
Remi NGUYEN VAN
b136bfd8eb Added tests for MultipathPolicyTracker.
Test: atest com.android.server.connectivity.MultipathPolicyTrackerTest
Bug: b/72631572
Bug: b/72877610
Change-Id: I33d9cd77948ff76008a125e4e2786fbbc2b03032
2018-04-10 15:27:59 +09:00
dalyk
488df2dfa0 Trigger NetworkCallback events when private DNS usage has changed.
Relies on events sent from netd in aosp/578162.

Test: Added tests to ConnectivityServiceTest. Added a new test
class DnsManagerTest. Built a simple app that appears to
receive onLinkProperties events correctly upon manual changes
to the private DNS settings on a Pixel.
Bug: 71828272

Merged-In: I1e6c54ba016f6a165a302bd135a29d9332aaa235
Merged-In: I7705412803fb9aa707a18ae5a1c50292e084d851
Change-Id: I3223c1285a73d5d531c5051ce70007857caa57e3
(cherry picked from commit 7301aa4140baefb549a737f033fc512e87c55692)
2018-04-09 23:04:20 -07:00
Erik Kline
2651c44654 Merge "Trigger NetworkCallback events when private DNS usage has changed." am: fa1f79ac66
am: bf7f517c51

Change-Id: I1e6c54ba016f6a165a302bd135a29d9332aaa235
2018-04-09 22:13:36 -07:00
Benedict Wong
534cfd2477 Merge "Force creation of Socket upon Transform application" into pi-dev 2018-04-09 20:55:30 +00:00
dalyk
1720e54568 Trigger NetworkCallback events when private DNS usage has changed.
Relies on events sent from netd in aosp/578162.

Test: Added tests to ConnectivityServiceTest. Added a new test
class DnsManagerTest. Built a simple app that appears to
receive onLinkProperties events correctly upon manual changes
to the private DNS settings on a Pixel.
Bug: 71828272
Change-Id: I68665aaf74b7d59182cc6f9586b80b55b0dfe427
2018-04-09 16:45:22 -04:00
Erik Kline
9b43bdba19 Merge "Move the logic of (re)evaluation of Private DNS" into pi-dev 2018-04-06 06:48:25 +00:00
Erik Kline
471ce709e8 Move the logic of (re)evaluation of Private DNS
Moves this out of ConnectivityService and into each NetworkMonitor
(where it's more self-contained).

Test: as follows
    - builds, flashes, boots
    - runtest frameworks-net passes
    - manual testing with working and non-working hostnames behaves
      somewhat (but not entirely) as expected, and not always quickly
Bug: 64133961
Bug: 72345192
Bug: 73872000
Bug: 77140445
Merged-In: I5dc90ecfe6f6f10967b7501645ad8e030cb38982
Merged-In: Ida4967d22f0781524f0f269e30e653b8ec867258
Change-Id: Ic4322af3cb49149f2d975cb31f54b2ac7927f907
(cherry picked from commit 736353a584aa89a29e737e21e29c49fad0d38a63)
2018-04-05 19:18:47 -07:00
Erik Kline
562fc8f50c Merge "Move the logic of (re)evaluation of Private DNS" am: dcabc027b3
am: fbffd3ae17

Change-Id: I5dc90ecfe6f6f10967b7501645ad8e030cb38982
2018-04-05 18:53:08 -07:00
Benedict Wong
d370c857f5 Merge "Update IpSecManager to use InetAddress and prefixLen" into pi-dev
am: b172d5b437

Change-Id: I03c0745662ab8868f719dc65c9ff8502e2ff817c
2018-04-05 17:34:11 -07:00
Erik Kline
9a62f0108e Move the logic of (re)evaluation of Private DNS
Moves this out of ConnectivityService and into each NetworkMonitor
(where it's more self-contained).

Test: as follows
    - builds, flashes, boots
    - runtest frameworks-net passes
    - manual testing with working and non-working hostnames behaves
      somewhat (but not entirely) as expected, and not always quickly
Bug: 64133961
Bug: 72345192
Bug: 73872000
Bug: 77140445
Change-Id: Ic4322af3cb49149f2d975cb31f54b2ac7927f907
2018-04-05 15:17:38 -07:00
Benedict Wong
2ea91aee42 Update IpSecManager to use InetAddress and prefixLen
LinkAddress constructors are currently @hide; this change updates
IpSecManager to use InetAddress and prefixLen, and then construct a
LinkAddress internally. LinkAddress is used over the binder interface to
IpSecService to ensure validity.

Bug: 77528639
Test: CTS, Java unit tests ran on walleye
Change-Id: I19e124adef6d9f4992d8293db3190bcf74c95848
2018-04-05 17:41:11 +00:00
Benedict Wong
218bfc4751 Merge "Force creation of Socket upon Transform application" am: 4acfd60844
am: 1f8c0950b1

Change-Id: I2034448a22461d51728e66bcc0e965821aa4a42f
2018-04-04 12:52:00 -07:00
Benedict Wong
031d447363 Force creation of Socket upon Transform application
This change forces Socket and DatagramSocket to populate the
SocketImpl, ensuring that the socket file descriptor can be
retrieved when applying Transport mode Transforms

This is done by calling getSoLinger(), triggering a getImpl(), which
triggers setImpl() if needed.

Bug: 77491294
Test: Added tests in IpSecManagerTest, ran on walleye
Merged-In: I40da08b031357710eb794e0f866aec5660c79594
Change-Id: I40da08b031357710eb794e0f866aec5660c79594
(cherry picked from commit d175a3d3a01cfdb5ab6d4e61d15950583f8006d6)
2018-04-04 10:33:49 -07:00
TreeHugger Robot
4f58ec4b83 Merge "Mark networks with OEM_PAID always restricted" into pi-dev 2018-04-04 16:54:46 +00:00
Lorenzo Colitti
9b58dd356c Mark networks with OEM_PAID always restricted
Bug: 68762530
Test: runtest -x frameworks/base/tests/net/ -c android.net.NetworkCapabilitiesTest

Cherry-picked from AOSP with no conflicts

Merged-in: I173ee0a3bc1797d03ba34c5f025844eaada87ee4
Change-Id: I173ee0a3bc1797d03ba34c5f025844eaada87ee4
(cherry picked from commit efbacc0ccb70917b2782272e6b8f1a0fb3f56cbe)
2018-04-04 05:35:54 +00:00
Benedict Wong
412ff4144b Force creation of Socket upon Transform application
This change forces Socket and DatagramSocket to populate the
SocketImpl, ensuring that the socket file descriptor can be
retrieved when applying Transport mode Transforms

This is done by calling getSoLinger(), triggering a getImpl(), which
triggers setImpl() if needed.

Bug: 77491294
Test: Added tests in IpSecManagerTest, ran on walleye
Change-Id: I40da08b031357710eb794e0f866aec5660c79594
2018-04-03 17:04:55 -07:00
Nathan Harold
78fd96e934 Merge "Add AppOps Checks for MANAGE_IPSEC_TUNNELS" into pi-dev
am: 80a2bba9a6

Change-Id: Icd1b2cfc699ab44e4ca536b98298d5b23db7372e
2018-04-03 14:41:56 -07:00
Nathan Harold
68a7edf1cb Add AppOps Checks for MANAGE_IPSEC_TUNNELS
Adds support for a new AppOp to permit services to
use IpSec tunnel mode. The IpSecService now needs
a context so change the service mode to a cached
service rather than a static service.

Bug: 66955045
Test: runtest frameworks-net
Change-Id: I17a4a286225b432c3e15ea1587d946189931b4f4
2018-04-03 18:23:11 +00:00
Chalard Jean
fe455cfc35 Merge "Fix PermissionMonitorTest that has been failing." into pi-dev
am: 6e66280d35

Change-Id: Ifb04fdda2b54b0bde8b6eeead3e0240d5cc1ff79
2018-04-02 20:14:29 +00:00
Remi NGUYEN VAN
1720e75aa2 Fix network usage stats on 464xlat tethered.
Usage stats corrections for 464xlat in NetworkStatsFactory are not applied
to tethered traffic. Add adjustments in NetworkStatsService. After
migrating external callers off NetworkStatsFactory, we will be able to
only apply adjustments in NetworkStatsService and remove stacked
interface tracking from NetworkStatsFactory.
Bug: 72107146
Fixes: 72107146
Test: runtest frameworks-net & manual - checked corrected network usage
Merged-In: Ieb25c41c651499fdd01225ae5ac21d95e3d823f5
Merged-In: I016722f3a0ae2ae0a1d48bfacc4fe07ee3578ef7
(cherry-pick of aosp I5ce450e616b4fddf21f2a491fe5d0c9e9f969bda)

Change-Id: Id41cf22a0f9a63cb1832e9375bfb045861f08e52
2018-04-02 13:30:02 +00:00
Chalard Jean
94de1787a4 Fix PermissionMonitorTest that has been failing.
The fail is related to a recent fix to PermissionMonitor
that went into pi-dev only : ag/3799094, which fixed getting
the remote package name for the correct macro user instead of
the default. That fix had broken the test, this change fixes it.

Test: test now passes
Bug: 77315205
Change-Id: I26f8276eafe80478d5fefcff92e7dc2f12128bb4
2018-04-02 07:44:21 +00:00
Remi NGUYEN VAN
d197642ba8 Merge "Add method to NetworkStatsService for UID stats." into pi-dev 2018-04-02 05:40:04 +00:00
Benedict Wong
c37a5742a2 Merge changes from topic "encap-api" into pi-dev
* changes:
  Require explicitly supplied truncation length
  Clarify UDP encapsulation socket API
2018-03-30 20:28:19 +00:00
Remi NGUYEN VAN
ef7e3afa1e Add method to NetworkStatsService for UID stats.
Useful for clients such as BatteryStats which currently rely
on NetworkStatsFactory. Data at that stage is incomplete as
it does not account for tethering, VT data and corresponding
464xlat corrections.

Test: runtest frameworks-net, CTS tests pass.
Bug: b/72107146
Merged-In: I31c5b9b4a7c6e72910152415894a137f000a5858
Merged-In: I2527d95000c7500c824ede70f87ecb38e21ed323
(cherry picked from aosp 088ff6824f13145ea52207bdead0d7e454a6f3ce)

Change-Id: Ie80f1bb21124241f3414f9be77aceac9a44ec6d1
2018-03-30 18:58:18 +09:00
Lorenzo Colitti
3754e152e7 Merge "Mark networks with OEM_PAID always restricted" am: dbc568ceaf
am: e019e0e240

Change-Id: I88500f6add4f1a6c8a77eb976a489c11c7dc5b6d
2018-03-30 09:05:09 +00:00
Chalard Jean
e2a49b5b4e Merge "Limit the number of routes for performance" am: 7f5163f453
am: 554f03dc04

Change-Id: I1fcf34b553b4a7cbadd0a2a7bf697140e948243e
2018-03-30 08:58:44 +00:00
TreeHugger Robot
dd8a3c78c5 Merge "Limit the number of routes for performance" into pi-dev 2018-03-30 08:48:25 +00:00
Lorenzo Colitti
56d68c37ea Merge "Require explicitly supplied truncation length" am: 2db4d5fbda
am: d78344d704

Change-Id: I347bfd43be54d162dea831770ab08d792ea1443f
2018-03-30 07:45:04 +00:00
Lorenzo Colitti
dbc568ceaf Merge "Mark networks with OEM_PAID always restricted" 2018-03-30 07:00:54 +00:00
Pavel Maltsev
8cb5245570 Mark networks with OEM_PAID always restricted
Bug: 68762530
Exempt-From-Owner-Approval: OWNERS have approved, but gerrit doesn't see it
Test: runtest -x frameworks/base/tests/net/ -c android.net.NetworkCapabilitiesTest
Change-Id: Ieadef7c42634d890281543226203530fb18eb0a3
2018-03-30 07:00:39 +00:00
Lorenzo Colitti
57498b9359 Merge "Clarify UDP encapsulation socket API" am: db1e624ee1
am: bdc59ca370

Change-Id: I5fcf79691c670e710e46b3a9eac8a580c44028fb
2018-03-30 06:48:17 +00:00
Chalard Jean
f0473e8650 Limit the number of routes for performance
In evaluating whether "most" of the addressing space is
covered, the list of routes are obtained from a third-party
app, so it's possbile the system service stalls unless
some limit is enforced on how much work it has to do.
This change limits the number of routes to 400, as determined
by time measurement on various devices.

Bug: 74176086
Test: runtest framework-net
Change-Id: Ie4a96098bc044ade87b188839586f14dd101c100
2018-03-30 15:41:50 +09:00
Chalard Jean
7f5163f453 Merge "Limit the number of routes for performance" 2018-03-30 06:40:29 +00:00
Benedict Wong
2e1ebb60e6 Require explicitly supplied truncation length
Instead of providing default truncation lengths (based on RFC or
otherwise), this change imposes a restriction that the truncation length
must be supplied for all auth or aead algorithms.

Bug: 77204048
Test: Updated tests, ran on walleye
Merged-In: I4a0e2e71aa97259e56f44e7c8a2ce53135708d97
Change-Id: I4a0e2e71aa97259e56f44e7c8a2ce53135708d97
(cherry picked from commit bb7f2820f5bcccf8618078c2cbe4ea9836797e3b)
2018-03-29 23:07:42 -07:00
Benedict Wong
c165885206 Clarify UDP encapsulation socket API
This change updates the getSocket() methods for IPsec to improve clarity
of the return types, both for public APIs, and internal-only methods.

Bug: 72473753
Test: APIs updated, CTS + unit tests ran.
Merged-In: I0afebd432c5d04c47c93daa1ce616d712aa323d7
Change-Id: I0afebd432c5d04c47c93daa1ce616d712aa323d7
(cherry picked from commit 4c987ebade580d4abc8a3d549e0df90baab33140)
2018-03-29 23:05:42 -07:00
Lorenzo Colitti
2db4d5fbda Merge "Require explicitly supplied truncation length" 2018-03-30 04:59:22 +00:00
Lorenzo Colitti
db1e624ee1 Merge "Clarify UDP encapsulation socket API" 2018-03-30 04:58:47 +00:00