Commit graph

4,721 commits

Message SHA1
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

Chalard Jean   commited 2018-04-02 07:44:21 +00:00
94de1787a4
Merge "Add method to NetworkStatsService for UID stats." into pi-dev
Remi NGUYEN VAN   authored and   Android (Google) Code Review   commited 2018-04-02 05:40:04 +00:00
d197642ba8
Merge changes from topic "encap-api" into pi-dev
* changes:
  Require explicitly supplied truncation length
  Clarify UDP encapsulation socket API

Benedict Wong   authored and   Android (Google) Code Review   commited 2018-03-30 20:28:19 +00:00
c37a5742a2
Merge "Add OEM_PAID capability to system api" into pi-dev
Pavel Maltsev   authored and   Android (Google) Code Review   commited 2018-03-30 16:32:52 +00:00
07019bb20f
Merge "API council requested tweaks to NetworkRequest." into pi-dev
Jeff Sharkey   authored and   Android (Google) Code Review   commited 2018-03-30 16:30:24 +00:00
93fc2b5049
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

Remi NGUYEN VAN   commited 2018-03-30 18:58:18 +09:00
ef7e3afa1e
Merge "Fix socket leaks in various android.net.Network methods." into pi-dev
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2018-03-30 09:47:51 +00:00
f26c5341a5
Merge "Limit the number of routes for performance" into pi-dev
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2018-03-30 08:48:25 +00:00
dd8a3c78c5
Merge "Clarify documentation for getActiveNetworkInfo and friends" into pi-dev
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2018-03-30 08:22:29 +00:00
039947df6a
Merge "Allow null subscriberId in NetworkStatsManager." into pi-dev
Remi NGUYEN VAN   authored and   Android (Google) Code Review   commited 2018-03-30 07:39:23 +00:00
38468e9f2f
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

Chalard Jean   commited 2018-03-30 15:41:50 +09:00
f0473e8650
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)

Benedict Wong   commited 2018-03-29 23:07:42 -07:00
2e1ebb60e6
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)

Benedict Wong   commited 2018-03-29 23:05:42 -07:00
c165885206
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

Chalard Jean   commited 2018-03-30 12:22:06 +09:00
96d10a75b6
Allow null subscriberId in NetworkStatsManager.
Use a MATCH_MOBILE_WILDCARD template to avoid filtering by
subscriberId when querying statistics from NetworkStatsService.

Bug: 74038898
Change-Id: I8296220472a9ba37044dd1a5ede9bdb45d3ed339
Fixes: 74038898
Test: runtest frameworks-net, CTS tests pass
Merged-In: I1e4e283c6eaecf33d12488e41e0c524f6ff83954
Merged-In: Ia84d2c7cc63bf8b8bf30f133e0382fd7103bf490
(cherry-picked from aosp I4b39e7031416cb33b23d89aa36ff0f774eaa942f)

Remi NGUYEN VAN   commited 2018-03-30 12:18:23 +09:00
65ffbafe88
Fix socket leaks in various android.net.Network methods.
Bug: 72124526
Test: make CtsNetTestCases
Change-Id: I3398b67272360f894e01a8cdfbc47b17d77c2330

Paul Jensen   commited 2018-03-29 07:43:01 -04:00
55eaa09f96
Add Network.fromNetworkHandle()
This is the counterpart to Network.getNetworkHandle() and facilitates
native code calling back to Java with network handle values from
getNetworkHandle.

Bug: 77210159
Bug: 64148938
Test: make CtsNetTestCases

Change-Id: I032b959d84180c063a79ddd97c35e7384b0f50a1

Paul Jensen   commited 2018-03-29 07:24:59 -04:00
b895ac0fe6
API council requested tweaks to NetworkRequest.
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
Change-Id: I9aacceb82c98f7881f0eb5e1106d89d469b816a7

Jeff Sharkey   commited 2018-03-28 14:02:00 -06:00
e5886f37ec
Add OEM_PAID capability to system api
Some system apps should be able to request OEM_PAID networks.  This
makes a lot of sense when Android is used as in-vehicle infotainment
systems.

Bug: 68762530

Test: runtest -x frameworks/base/tests/net/ -c android.net.NetworkCapabilitiesTest

Change-Id: Ic916de7522a9f803a2410bc4e3e82101fd9d0dbd

Pavel Maltsev   commited 2018-03-27 23:17:14 -07:00
1868811e8f
Merge "Minor clean-up in NetworkCapabilities" am: 539f85a18d am: b1e2bfe4df
am: 8a956a5141

Bug: 72828388
Test: frameworks/base/tests/net/ -c android.net.NetworkCapabilitiesTest

Change-Id: I2f45d2c70c7c0142ae3b3ce9e6329c5f25b63380
(cherry picked from commit feb8d1498a822730e29cf346fe3382e3f5293a58)

Pavel Maltsev   commited 2018-03-27 22:45:49 +00:00
51f4d8a11d
Merge "Get application info in the correct user id" into pi-dev
Tony Mak   authored and   Android (Google) Code Review   commited 2018-03-26 17:04:47 +00:00
28a696afb4
Merge "Improve ConnectivityManager.getNetworkWatchlistConfigHash() javadoc" into pi-dev
Ricky Wai   authored and   Android (Google) Code Review   commited 2018-03-26 16:46:20 +00:00
2ce1e6ce2a
Merge "add airplane mode shell commands to connectivity" into pi-dev
Michael West   authored and   Android (Google) Code Review   commited 2018-03-26 16:38:03 +00:00
e0c1ee6414
Get application info in the correct user id
Fixes: 76396560

Test: Create work profile and launch hangouts in work profile.
Change-Id: Ic3727ac899153b6a96dd9b6d6921c32ba0bbd93e

Tony Mak   commited 2018-03-26 11:58:38 +00:00
2f6bcd9c06
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
Merged-In: I96f7747b8f0bb38d95579b688b4c2d068f1229cf
Merged-In: Ia4d896c4cc33c02f0c46d5d4c760cc33b13dff0b
Change-Id: Ia4f1905e1fa60e7a468c2246fb809191d2ba796b
(cherry picked from commit e5dac904d361a349f1cfc48500a678d22e3a7316)

Erik Kline   commited 2018-03-23 21:59:24 -07:00
c54b9cb71a
add airplane mode shell commands to connectivity
Fixes: 74410990
Test: Manually checked that commands enable/disable airplane mode.

Change-Id: I942bd4679fcd498a39b9b2cab68e8d3c00ce62d3

mswest46   authored and   Michael West   commited 2018-03-24 01:53:45 +00:00
32928412a2
Merge "Have the status bar listen to all macro-users VPN changes." into pi-dev
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2018-03-23 09:26:46 +00:00
749299b1c5
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

Chalard Jean   commited 2018-03-23 13:37:56 +09:00
38354d1f60
Improve ConnectivityManager.getNetworkWatchlistConfigHash() javadoc
Test: NULL
Bug: 74831039
Change-Id: I227ba1377a51821204cd5830e7da6ff3a15bca02

Ricky Wai   commited 2018-03-22 20:13:05 +00:00
04baf117bf
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

Chalard Jean   commited 2018-03-22 13:25:52 +09:00
7c74b9f311
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
Merged-In: I4c26aea7af817a5d9e54da5db1cdf4f943bcae06
Change-Id: I4c26aea7af817a5d9e54da5db1cdf4f943bcae06
(cherry picked from commit 22795302be4ec35449908cf566aa7c16945df836)

Nathan Harold   commited 2018-03-20 18:29:02 -07:00
bfcc17cc20
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
Merged-In: Idde9d943a5285d2c13c5c6b0f7b8a9faf718e6a5
Change-Id: Idde9d943a5285d2c13c5c6b0f7b8a9faf718e6a5
(cherry picked from commit ecc9f7cc08804e3fa15fea04ae94ea1bc74edbfe)

Benedict Wong   authored and   Nathan Harold   commited 2018-03-20 16:01:27 -07:00
76df78ffbf
Merge "Deprecate most of NetworkInfo." into pi-dev
Chalard Jean   authored and   Android (Google) Code Review   commited 2018-03-10 07:51:11 +00:00
bf7610aa8a
Deprecate most of NetworkInfo.
getType, getTypeName, isConnectedOrConnecting, isConnected,
isAvaisable, isFailover, isRoaming, getState, getDetailedState,
getReason, and the TYPE_* constants in ConnectivityManager
along with methods that use them are now stacked on a boat
bound for the other side of the Styx.

Test: no code changes
Bug: 62844794
Change-Id: Idd70763de5b1af5580b4734cd443ac4b570069cc

Chalard Jean   commited 2018-03-09 16:52:20 +09:00
7eaf3b10e5
Expose CONNECTIVITY_ACTION to Instant Apps
Test: Broadcast is visible to Instant Apps
Bug: 69421898
Change-Id: I8435e7723cf7a722668b97ff087d1f4453d3e7b7

Chad Brubaker   commited 2018-03-08 10:37:09 -08:00
caced413da
Connectivity: Fix map access
Found by Errorprone.

Bug: 73288226
Test: mmma frameworks/base/services
Merged-In: I1c4b35811c72d389e53e28c3eb1b411009471b92
Merged-In: Ice91ac58257551485231da4664027a281237de4b
Merged-In: I7d2f578b54c69139be8b887a2381ac1b2e0673a3
Change-Id: I63edad58dbc909c1e772bde85a1b9dd98c551fb1
(cherry picked from commit 3ba8106c23cdf518527f75beaabb48bf3182fb4d)

Andreas Gampe   authored and   Erik Kline   commited 2018-03-07 11:36:57 +09:00
85c8c3d822
Merge "Extend network request to query networks w/o capabilites" am: 47d4d15483 am: 334cde1ec2
am: fa04c2d802

Change-Id: I3bf776767be61577f1bca0d98d4aaf82a0e45336

Pavel Maltsev   authored and   android-build-merger   commited 2018-03-03 00:14:52 +00:00
1016f7327a
Merge "Extend network request to query networks w/o capabilites" am: 47d4d15483
am: 334cde1ec2

Change-Id: Ie0c4fa4648c235589fecd79a25d28f1e62025fb7

Pavel Maltsev   authored and   android-build-merger   commited 2018-03-03 00:03:37 +00:00
fa04c2d802
Merge "Extend network request to query networks w/o capabilites"
am: 47d4d15483

Change-Id: Id1d86938fa2d5aff4dbf9cde87548d80c76674d9

Pavel Maltsev   authored and   android-build-merger   commited 2018-03-02 23:52:18 +00:00
334cde1ec2
Merge "Extend network request to query networks w/o capabilites"
Treehugger Robot   authored and   Gerrit Code Review   commited 2018-03-02 19:04:31 +00:00
47d4d15483
Merge "Give apps with NETWORK_SETTINGS right to see any VPN." am: faed85f2b0 am: 331e50f601
am: ec7c68cb2b

Change-Id: I9a9d0eb212f6de105abc070a1eb5ff698b4e67bc

Chalard Jean   authored and   android-build-merger   commited 2018-03-02 13:25:02 +00:00
0a8dbc7886
Merge "Give apps with NETWORK_SETTINGS right to see any VPN." am: faed85f2b0
am: 331e50f601

Change-Id: I7f08217c5abc86a8784b91145f1b02d6693b3919

Chalard Jean   authored and   android-build-merger   commited 2018-03-02 13:17:23 +00:00
ec7c68cb2b
Merge "Give apps with NETWORK_SETTINGS right to see any VPN."
am: faed85f2b0

Change-Id: Iab9c8df6071e6dec35b5f492eb8344ba370e0036

Chalard Jean   authored and   android-build-merger   commited 2018-03-02 13:10:45 +00:00
331e50f601
Merge "Give VPNs the INTERNET capability when they route most of the IP space" am: f477aedec5 am: 7506c131c1
am: 941de3f74c

Change-Id: Ifd77149ca2c45249b8776c878c6fac46ae81c2a4

Chalard Jean   authored and   android-build-merger   commited 2018-03-02 12:54:29 +00:00
562e154642
Merge "Give VPNs the INTERNET capability when they route most of the IP space" am: f477aedec5
am: 7506c131c1

Change-Id: I33c6fcc72753e00af601cf915aa78416174a3871

Chalard Jean   authored and   android-build-merger   commited 2018-03-02 12:46:46 +00:00
941de3f74c
Merge "Give VPNs the INTERNET capability when they route most of the IP space"
am: f477aedec5

Change-Id: Icd1466c79d2593fcab5bd2e31a1acb3a36a705da

Chalard Jean   authored and   android-build-merger   commited 2018-03-02 12:34:25 +00:00
7506c131c1
Merge "Give apps with NETWORK_SETTINGS right to see any VPN."
Chalard Jean   authored and   Gerrit Code Review   commited 2018-03-02 11:52:15 +00:00
faed85f2b0
Merge "Give VPNs the INTERNET capability when they route most of the IP space"
Chalard Jean   authored and   Gerrit Code Review   commited 2018-03-02 11:18:10 +00:00
f477aedec5
Give apps with NETWORK_SETTINGS right to see any VPN.
...not only the ones that apply to them.

Bug: 73217368
Test: runtest frameworks-net and CTS
Change-Id: I436972a3e51e98bdd815771b451bcedadf684763

Chalard Jean   commited 2018-03-02 17:10:11 +09:00
9a396cc3c6
Give VPNs the INTERNET capability when they route most of the IP space
Test: manual, plus wrote some new tests for this
Bug: 72765718
Change-Id: I9759da72b752fd8eeb1d0647db9ab341f04c0528

Chalard Jean   commited 2018-03-02 16:20:22 +09:00
9cbc882c08