Commit Graph

4482 Commits

Author SHA1 Message Date
Erik Kline
fbffd3ae17 Merge "Move the logic of (re)evaluation of Private DNS"
am: dcabc027b3

Change-Id: Ic510dabd6a2d40cd6d33a21e0128d85a0126127f
2018-04-05 18:38:08 -07:00
Treehugger Robot
dcabc027b3 Merge "Move the logic of (re)evaluation of Private DNS" 2018-04-05 23:52:55 +00: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
1f8c0950b1 Merge "Force creation of Socket upon Transform application"
am: 4acfd60844

Change-Id: Ia19da86a3fa40e309ff7a079307a8a63de8ba796
2018-04-04 12:43:36 -07:00
Benedict Wong
4acfd60844 Merge "Force creation of Socket upon Transform application" 2018-04-04 17:14:46 +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
Erik Kline
30f8707244 Merge "Support bypassing TLS in the framework"
am: aef9956de2

Change-Id: I5b8cc38ec136f10a4e61f7edf7a9b4945b80b595
2018-04-03 14:17:23 -07:00
Erik Kline
0162dba80d Support bypassing TLS in the framework
This change comprises the following parts:

    [1] android.net.dns.ResolvUtil, containing methods that encapsulate the
        use of the high bit in netids used in DNS resolution contexts.

    [2] Updates to captive portal apps to call the ResolvUtil method that
        enables DNS-over-TLS bypass for the captive portal app process.

Test: as follows
    - builds
    - flashes
    - boots
    - runtest frameworks-net passes
Bug: 64133961
Bug: 72345192

Change-Id: I2072c1f68d6978fa0d7e9d8693135a2c51bb0f87
2018-04-03 00:35:30 -07:00
Erik Kline
828d955393 Merge "Refactor isTetheringSupported() calls"
am: 110d7bfcec

Change-Id: Iecc4e563f151545facc23f4a24a8dbf2d6ab9822
2018-04-02 20:57:43 +00:00
Treehugger Robot
110d7bfcec Merge "Refactor isTetheringSupported() calls" 2018-04-02 18:47:18 +00:00
Erik Kline
d8840e4fd3 Refactor isTetheringSupported() calls
Tethering currently wants access to complex isTetheringSupported
logic that is only available in ConnectivityService. Instead of
trying to access that via ConnectivityManager, pass this capability
in to Tethering directly, in the TetheringDependencies object.

Also:
    - ConnectivityManager is only a source of static constants now,
      so "import static" all the constants that are actually used.

Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net works
    - manual USB towards WiFi tethering works
Bug: 68951715

Change-Id: Ia64faaadefb4a5d84a50da98bdebd544b6fda101
2018-03-30 17:24:43 -07:00
Paul Jensen
b581818a4b Merge "Fix socket leaks in various android.net.Network methods."
am: 34ce11f2bd

Change-Id: I1a59fced1f3bcd19bd48150ca215093dff431619
2018-03-30 22:03:22 +00:00
Paul Jensen
6cdb34183b Fix socket leaks in various android.net.Network methods.
Bug: 72124526
Test: make CtsNetTestCases
Merged-In: I2a2254ce65c2176ae0be1d6276034b1bb0cad987
Merged-In: I23150482d6c2ab2eaa2b37732af68af69320792b
Change-Id: I3398b67272360f894e01a8cdfbc47b17d77c2330
(cherry picked from commit 55eaa09f96)
2018-03-30 12:20:35 -07:00
Lorenzo Colitti
e019e0e240 Merge "Mark networks with OEM_PAID always restricted"
am: dbc568ceaf

Change-Id: I4ffcf01e1f79c8a3570ea2b819688b55904939fe
2018-03-30 08:47:25 +00:00
Chalard Jean
554f03dc04 Merge "Limit the number of routes for performance"
am: 7f5163f453

Change-Id: If4de2779b24560f75a7bb977dbb0f996115a0648
2018-03-30 08:42:42 +00:00
Chalard Jean
bc4e495705 Merge "Clarify documentation for getActiveNetworkInfo and friends"
am: b1016fbf14

Change-Id: I167776fb6ec44aff4b35b58378b54e3b55907427
2018-03-30 08:36:58 +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
d78344d704 Merge "Require explicitly supplied truncation length"
am: 2db4d5fbda

Change-Id: I20f7f910f4f0369e38eebd0b7fe6970331763e85
2018-03-30 06:48:22 +00:00
Chalard Jean
7f5163f453 Merge "Limit the number of routes for performance" 2018-03-30 06:40:29 +00:00
Chalard Jean
b1016fbf14 Merge "Clarify documentation for getActiveNetworkInfo and friends" 2018-03-30 06:37:22 +00:00
Lorenzo Colitti
bdc59ca370 Merge "Clarify UDP encapsulation socket API"
am: db1e624ee1

Change-Id: Ie1e7ea81440afee2618211d989989cf5daff3e1e
2018-03-30 06:35:22 +00: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
Chalard Jean
459c9109ca 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-29 18:13:23 +09:00
Chalard Jean
33703ef8a7 Clarify documentation for getActiveNetworkInfo and friends
For VPNs it's unobvious what these methods do, so document that.

Bug: 70917007
Test: Comment changes only. Checkdoc passes.
Change-Id: I31ec1aea356d88d969eaf9fc7d8c2ed13ce924eb
2018-03-29 18:10:56 +09:00
Remi NGUYEN VAN
7ea8c51311 Merge "Fix network usage stats on 464xlat tethered."
am: 83088dcd8e

Change-Id: I0e13c2a6b9f6b5d0701a073ddc835781d5d2aace
2018-03-29 07:36:21 +00:00
Benedict Wong
5f38c02385 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
Change-Id: I4a0e2e71aa97259e56f44e7c8a2ce53135708d97
2018-03-28 18:02:54 -07:00
Remi NGUYEN VAN
c19a5eb8e4 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

Change-Id: I5ce450e616b4fddf21f2a491fe5d0c9e9f969bda
2018-03-28 12:14:14 +09:00
Benedict Wong
a042c3f82b 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.
Change-Id: I0afebd432c5d04c47c93daa1ce616d712aa323d7
2018-03-27 19:46:50 -07:00
Erik Kline
189415933f Merge "Pass all relevant resolver info to netd"
am: ce907ddfc4

Change-Id: If4f46b030fe141a6904a48966e5ab34ffb6b10bc
2018-03-24 01:07:10 +00:00
Treehugger Robot
ce907ddfc4 Merge "Pass all relevant resolver info to netd" 2018-03-23 23:41:11 +00:00
Chalard Jean
cdb95af156 Merge "Have the status bar listen to all macro-users VPN changes."
am: 90988528c3

Change-Id: Icc4fe4fbdb75c90abaaee8009f08f1220536686e
2018-03-23 09:22:36 +00:00
Chalard Jean
3f05f98daa Merge "Have PermissionMonitor arbiter which app can access background networks"
am: 433c0e652f

Change-Id: Ic05e362af58d667b5be84c3bd421c9250927abe2
2018-03-23 08:12:51 +00:00
Chalard Jean
90988528c3 Merge "Have the status bar listen to all macro-users VPN changes." 2018-03-23 07:33:02 +00:00
Erik Kline
286974f384 Pass all relevant resolver info to netd
Test: runtest frameworks-net passes
Test: manual testing of opportunistic and strict mode works
Bug: 34953048
Bug: 64133961
Bug: 72345192
Change-Id: Ia4f1905e1fa60e7a468c2246fb809191d2ba796b
2018-03-22 23:50:13 -07:00
Chalard Jean
433c0e652f Merge "Have PermissionMonitor arbiter which app can access background networks" 2018-03-23 06:15:00 +00:00
Remi NGUYEN VAN
f61f5ff462 Merge "Add method to NetworkStatsService for UID stats."
am: db89ca3c12

Change-Id: I2c6cba3ebbc8c23ade754cfd411ac54a561b020a
2018-03-23 03:54:13 +00:00
Chalard Jean
e64b8d7bce Have PermissionMonitor arbiter which app can access background networks
This will let ConnectivityService send the right callbacks to the
relevant apps.

Test: manual with apps
      runtest frameworks-net
      cts
      new tests for this functionality
Bug: 67408339

Change-Id: I6f08efd9e73c7e191f833d7f307a3bf4c9e2f0b4
2018-03-22 19:03:59 +09:00
Remi NGUYEN VAN
1cb92c713f 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.
Change-Id: I763b77f601c827fd2963204694fb5b45425cc791
2018-03-22 15:31:28 +09:00
Chalard Jean
088588d3fb Have the status bar listen to all macro-users VPN changes.
Bug: 73217368
Test: manual
      Using Datally on work profile. Before this, enabling the VPN
      does not show the key icon. After this it does.

Change-Id: I454eb8f3881a48af1b0187c2b14a2a399d3c2445
2018-03-22 13:25:09 +09:00
nharold
af4c28192c Merge "Check mOwnedByTransform to avoid DELSA on SPI"
am: 94d8fa0da6

Change-Id: Id194eb67947e9dae369b2a2d30b55e7e1cf2d7c8
2018-03-21 03:36:44 +00:00
Nathan Harold
bd12ffffc0 Check mOwnedByTransform to avoid DELSA on SPI
The owned by transform flag prevents the removal
of an SPI from accidentally deleting an associated
SA in the kernel. That flag wasn't actually being
checked, so deleting an SPI would result in the
transform being removed.

The existing code already guarantees that the SA is
deleted when the transform is deleted

Bug: 73258845
Test: runtest frameworks-net
Change-Id: I4c26aea7af817a5d9e54da5db1cdf4f943bcae06
2018-03-20 11:26:29 -07:00
Benedict Wong
c9b0114429 Merge "Added implementation for VTI add/remove address"
am: 3f3410ae6b

Change-Id: Id49ef89d3076c9a6d5257b006965844ab77743ce
2018-03-19 23:45:10 +00:00
Benedict Wong
3f3410ae6b Merge "Added implementation for VTI add/remove address" 2018-03-19 22:05:09 +00:00
Benedict Wong
0da1f39e22 Added implementation for VTI add/remove address
This change adds implementation details for add/remove addresses onto a
VTI.

Bug: 73675031
Test: New tests added, passing on Walleye
Change-Id: Idde9d943a5285d2c13c5c6b0f7b8a9faf718e6a5
2018-03-16 10:25:43 -07:00
Pavel Maltsev
2c36870f3d Merge "Fixing comments in Network Capabilities"
am: b6477d22ca

Change-Id: Iacbcac2e740099ea6b6a6f7a646f046370fd16f5
2018-03-12 07:57:07 +00:00
Treehugger Robot
b6477d22ca Merge "Fixing comments in Network Capabilities" 2018-03-12 07:42:58 +00:00
Pavel Maltsev
1f9f48e1c4 Fixing comments in Network Capabilities
Clean up after aosp/606338

Test: m -j (only comments has been changed)
Change-Id: I2627654450244024c2be92f9067534dfc2a80891
2018-03-09 10:42:32 -08:00
Chalard Jean
97aaa25bf0 Merge "Deprecate most of NetworkInfo."
am: 58ae164c97

Change-Id: I1d12c161f7e388451059a92b68a1511fbf8006a1
2018-03-09 12:57:15 +00:00