Commit Graph

5464 Commits

Author SHA1 Message Date
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
Erik Kline
bf7f517c51 Merge "Trigger NetworkCallback events when private DNS usage has changed."
am: fa1f79ac66

Change-Id: Ibf97fa6dce68a59f69480f668a34a40cecba2a38
2018-04-09 21:17:46 -07:00
Erik Kline
fa1f79ac66 Merge "Trigger NetworkCallback events when private DNS usage has changed." 2018-04-10 03:16:07 +00:00
Jeff Sharkey
a9d7daabce Merge "Disable roaming sanity checking." into pi-dev
am: aacd7eb672

Change-Id: I93bb07583ef90fb8c31c5c9a0c3e2c6e4968f975
2018-04-09 18:15:36 -07:00
Jeff Sharkey
aacd7eb672 Merge "Disable roaming sanity checking." into pi-dev 2018-04-09 23:57:28 +00:00
Jeff Sharkey
ab5f8652d3 Disable roaming sanity checking.
We've traced down all code paths where NetworkInfo.isRoaming() and
NET_CAPABILITY_NOT_ROAMING can disagree, so we're only left with
noise that happens from NetworkAgent race conditions when someone
asks for a NetworkState between pending NetworkInfo and
NetworkCapabilities updates.

We can look at adding a way for a NetworkAgent to update these
two objects atomically, but not for this release.

Bug: 70174865
Test: builds, boots
Change-Id: I830e1fc6dc922e9eb7f8c2698d75181e00aaf7fb
2018-04-09 16:17:23 -06:00
Benedict Wong
ea2dce36ca [automerger skipped] Merge "Force creation of Socket upon Transform application" into pi-dev
am: 534cfd2477  -s ours

Change-Id: I42b4d0c1b40b9ae6df076d5845331a50b93f2dd6
2018-04-09 14:11:21 -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
Pavel Maltsev
47839a0cb4 Remove unwanted capabilitiy from the java-doc
Per API council feedback remove unwanted capaibility from public API
java docs

Bug: 77601789
Test: make docs
Test: build and flash
Change-Id: Ia7fd6d79546bf99448f8f2bda0370c7230ea4527
2018-04-09 13:16:00 -07:00
android-build-team Robot
2c5f5d28d5 Snap for 4706961 from 4f9d750e91061923da90ef174a592fc59d0eff9e to pi-release
Change-Id: I4260634c95472eac375aa3dfc5ec4ec45426897c
2018-04-08 07:28:11 +00:00
Lorenzo Colitti
9c5c37271c Remove unwanted capability code per API council feedback.
am: f4bdf74cd6

Change-Id: I359aad5d7dceb2b188544db18424598decf14c08
2018-04-06 19:56:30 -07:00
Lorenzo Colitti
f4bdf74cd6 Remove unwanted capability code per API council feedback.
The addition of hasUnwantedCapability was late in the release
cycle and does not simplify the API enough to be worth it. The
recommendation is, in a future release, to do something more
complete: not just add something like addUnwantedCapability, but
also deprecate all the NET_CAPABILITY_NOT_xxx constants and add
opposite NET_CAPABILITY_xxx constants for use with it.

Fix: 77601789
Test: builds, boots
Test: atest android.net.cts.NetworkRequestTest
Test: atest android.net.cts.ConnectivityManagerTest
Change-Id: Ib98fb01da4a4a0bae464787b589ad88f45002eb8
2018-04-06 23:02:51 +09:00
Erik Kline
b1d6beee2c [automerger skipped] Merge "Move the logic of (re)evaluation of Private DNS" into pi-dev
am: 9b43bdba19  -s ours

Change-Id: I9a83aad484e84039fafb570cf5c63630144204d5
2018-04-06 00:03:43 -07: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
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
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
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
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
android-build-team Robot
3afda62617 Snap for 4701683 from 7b7e87eeb522c18c9808e6cb03cdc6dd307d7ae2 to pi-release
Change-Id: I8eb9d412604336195a8cfa15cf62e8d753f75618
2018-04-05 07:23:55 +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
1f8c0950b1 Merge "Force creation of Socket upon Transform application"
am: 4acfd60844

Change-Id: Ia19da86a3fa40e309ff7a079307a8a63de8ba796
2018-04-04 12:43:36 -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
Pavel Maltsev
9c8a869f02 Merge "Add hasUnwantedCapability method" into pi-dev
am: 3d735d02d6

Change-Id: I7feec81a3f1525055030ee16f34b8e7251e79b9b
2018-04-04 10:15:10 -07:00
Benedict Wong
4acfd60844 Merge "Force creation of Socket upon Transform application" 2018-04-04 17:14:46 +00:00
Lorenzo Colitti
dfb53c60a4 Merge "Mark networks with OEM_PAID always restricted" into pi-dev
am: 4f58ec4b83

Change-Id: I3fe4d11eec36eb20b44a8fdd2489b5fcdd144dff
2018-04-04 10:09:54 -07:00
TreeHugger Robot
3d735d02d6 Merge "Add hasUnwantedCapability method" into pi-dev 2018-04-04 16:55:14 +00:00
TreeHugger Robot
4f58ec4b83 Merge "Mark networks with OEM_PAID always restricted" into pi-dev 2018-04-04 16:54:46 +00:00
android-build-team Robot
146b4b1631 Snap for 4698807 from b2e6e45d009e7c9148e69bf2c1f0b46917bee7b0 to pi-release
Change-Id: Ie992f5deec4eb1cb35cd1541dac5445a42039394
2018-04-04 07:24:26 +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
Erik Kline
ef22b01095 [automerger skipped] Merge "Support bypassing TLS in the framework" into pi-dev
am: 2bad006b0d  -s ours

Change-Id: I5146ae845469b81dc0aec6838d55be4a33c670ad
2018-04-03 19:33:34 -07: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
9a30db497c 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

Merged-In: I0994b53d24ed25a2eb9e65429c61cf6fa87c7513
Merged-In: I4c49e23d8caa4d485df1c1d2f135a7282d439c0b
Change-Id: I2072c1f68d6978fa0d7e9d8693135a2c51bb0f87
(cherry picked from commit 2140529d9b8e116d88c2a385a0b3179c2ede5ad7)
2018-04-03 15:36:02 -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
Erik Kline
6f8546b8c3 Merge "Support bypassing TLS in the framework" am: aef9956de2
am: 30f8707244

Change-Id: I0994b53d24ed25a2eb9e65429c61cf6fa87c7513
2018-04-03 14:26:39 -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
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
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
android-build-team Robot
c749afbf54 Snap for 4696032 from 18603cdf8156fe3919ef746a561979f611d9f633 to pi-release
Change-Id: Id05697471eceef29b384c2f37ce71ccc60dfc681
2018-04-03 07:21:23 +00:00
Erik Kline
fcd878365d [automerger skipped] Merge "Refactor isTetheringSupported() calls" into pi-dev
am: a9a759bea0  -s ours

Change-Id: I2a970420521d9447d71dedb373bcf3098afd3d02
2018-04-02 21:53:07 -07:00
Remi NGUYEN VAN
d3ad25b311 [automerger skipped] Merge "Fix network usage stats on 464xlat tethered." into pi-dev
am: e4bcfd8889  -s ours

Change-Id: I49845b0bc0183d4d1a6c694a70e30a90a9a59759
2018-04-02 20:15:50 -07:00
TreeHugger Robot
a9a759bea0 Merge "Refactor isTetheringSupported() calls" into pi-dev 2018-04-03 02:25:49 +00:00
Erik Kline
126502d506 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

Merged-In: Ifa121b057f9959ddb980edc940327929e48ea973
Merged-In: Iad6358dc2f1d10b322d22ec90543adc50882962d
Change-Id: Ia64faaadefb4a5d84a50da98bdebd544b6fda101
(cherry picked from commit 465ff3a0c1da8afd5cb13b25ed9a3c95ee0dd2c4)
2018-04-02 16:59:23 -07:00
Remi NGUYEN VAN
e4bcfd8889 Merge "Fix network usage stats on 464xlat tethered." into pi-dev 2018-04-02 23:09:50 +00:00
Pavel Maltsev
2f3f53ee19 Merge "Make addUnwantedCapability method public" into pi-dev
am: 95f4b59348

Change-Id: I6d1676b72f125baf5b72e8718bd331a30b3c3c30
2018-04-02 21:47:22 +00:00
Erik Kline
15ec55e65f Merge "Refactor isTetheringSupported() calls" am: 110d7bfcec
am: 828d955393

Change-Id: Iad6358dc2f1d10b322d22ec90543adc50882962d
2018-04-02 21:08:52 +00:00