Commit Graph

5351 Commits

Author SHA1 Message Date
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
Erik Kline
828d955393 Merge "Refactor isTetheringSupported() calls"
am: 110d7bfcec

Change-Id: Iecc4e563f151545facc23f4a24a8dbf2d6ab9822
2018-04-02 20:57:43 +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
3c76aae4f2 [automerger skipped] Merge "Add method to NetworkStatsService for UID stats." into pi-dev
am: d197642ba8  -s ours

Change-Id: I4182b2dfad1f40dd29da8c3612cf0dbc4038aa7b
2018-04-02 19:43:54 +00:00
Treehugger Robot
110d7bfcec Merge "Refactor isTetheringSupported() calls" 2018-04-02 18:47:18 +00:00
Pavel Maltsev
a389a03bd5 Add hasUnwantedCapability method
If you put values into the Builder, you should be able to observe
those values on the built object.

Test: atest android.net.cts.NetworkRequestTest

Bug: 74945408
Bug: 72828388
Change-Id: Ib4026b8d7370d570f1b606f0d221d00fed6e787d
2018-04-02 11:10:13 -07:00
TreeHugger Robot
95f4b59348 Merge "Make addUnwantedCapability method public" into pi-dev 2018-04-02 15:07:25 +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
android-build-team Robot
7de561ed04 Snap for 4693955 from d197642ba8 to pi-release
Change-Id: I6e6f83688e11a4b7b20c32e170e39c5f7abbcadb
2018-04-02 07:22:18 +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
android-build-team Robot
9926ed16e3 Snap for 4693621 from 07a75e0f9f93980ea52e3ff337c8f4da504fb8e2 to pi-release
Change-Id: I8e050f7507a6553a58714dc85fcfbf9c30f18b81
2018-04-01 07:24:29 +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
Benedict Wong
a8fa528628 [automerger skipped] Merge changes from topic "encap-api" into pi-dev
am: c37a5742a2  -s ours

Change-Id: I19ea85409c7b8653a734e74afc092959e91a0aad
2018-03-30 22:57:46 +00:00