Commit graph android_packages_modules_Co.../tests/net/java
Message SHA1
Add tests for getActiveNetwork.
Bug: 77737389
Test: runtest frameworks-net
Change-Id: I03ae2bbb08559f2cd44979e291c1f5d50eb215da

Chalard Jean   commited 2018-04-24 15:23:28 +09:00
fd424b90be
Let DnsManager fill in LinkProperties for private DNSes
Test: new tests pass
Bug: 73641539
Change-Id: I971ef4d27b22a435d7459e1c4b31a8715ef6e610

Chalard Jean   commited 2018-04-23 13:58:42 +09:00
48bb49deff
Add the list of private DNS addresses to LinkProperties
Test: atest android.net.LinkPropertiesTest, also new tests pass
Bug: 73641539
Change-Id: If33a35b1354a67db09411ff098f20064797296ad

Chalard Jean   commited 2018-04-20 16:48:43 +09:00
3e0a46a439
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

Jeff Sharkey   commited 2018-04-16 16:50:34 +00:00
069002e639
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

Jeff Sharkey   commited 2018-04-16 16:39:55 +00:00
d5992e681f
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

Jeff Sharkey   commited 2018-04-13 19:32:25 +00:00
b1296e58da
Add a new ssid field in NetworkCapabilities.
Bug: 77891227
Test: frameworks-net
Change-Id: Ifba33ecd48ccecce7e8f8d05ff70bb85653f6163

Chalard Jean   commited 2018-04-13 15:38:35 +09:00
3ec2c0fc84
Merge "Added tests for MultipathPolicyTracker." into pi-dev
Remi NGUYEN VAN   authored and   Android (Google) Code Review   commited 2018-04-11 02:53:14 +00:00
36483a9f2e
Added tests for MultipathPolicyTracker.
Test: atest com.android.server.connectivity.MultipathPolicyTrackerTest
Bug: b/72631572
Bug: b/72877610
Change-Id: I33d9cd77948ff76008a125e4e2786fbbc2b03032

Remi NGUYEN VAN   commited 2018-04-10 15:27:59 +09:00
b136bfd8eb
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)

dalyk   authored and   Erik Kline   commited 2018-04-09 23:04:20 -07:00
488df2dfa0
Merge "Force creation of Socket upon Transform application" into pi-dev
Benedict Wong   authored and   Android (Google) Code Review   commited 2018-04-09 20:55:30 +00:00
534cfd2477
Merge "Move the logic of (re)evaluation of Private DNS" into pi-dev
Erik Kline   authored and   Android (Google) Code Review   commited 2018-04-06 06:48:25 +00:00
9b43bdba19
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)

Erik Kline   commited 2018-04-05 19:18:47 -07:00
471ce709e8
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

Benedict Wong   authored and   Nathan Harold   commited 2018-04-05 17:41:11 +00:00
2ea91aee42
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)

Benedict Wong   commited 2018-04-04 10:33:49 -07:00
031d447363
Merge "Mark networks with OEM_PAID always restricted" into pi-dev
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2018-04-04 16:54:46 +00:00
4f58ec4b83
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)

Lorenzo Colitti   authored and   Pavel Maltsev   commited 2018-04-04 05:35:54 +00:00
9b58dd356c
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

Nathan Harold   commited 2018-04-03 18:23:11 +00:00
68a7edf1cb
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

Remi NGUYEN VAN   commited 2018-04-02 13:30:02 +00:00
1720e75aa2
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
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 "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
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
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
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
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
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
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 "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"
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 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 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
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
Extend network request to query networks w/o capabilites
Add another bit mask into NetworkCapabilities class that represents
unwanted capabilities and corresponding methods to add and remove them.

Bug: 72828388
Bug: 68762530

Test: runtest -x frameworks/base/tests/net/
Change-Id: Ie291167eb74fdb696c7ee145c8cc46ea8115d6ba

Pavel Maltsev   commited 2018-03-01 17:52:02 -08:00
7c600431b5
Merge "Add OEM_PAID network capability" am: 2501283064 am: 82fdea2d7b
am: 5cb05a12bd

Change-Id: Id64d288764dc5a556b60f5e3b866b40792647ac0

Pavel Maltsev   authored and   android-build-merger   commited 2018-02-28 08:42:24 +00:00
013f8a445f
Merge "Add OEM_PAID network capability"
Treehugger Robot   authored and   Gerrit Code Review   commited 2018-02-28 07:06:00 +00:00
2501283064
Merge "Frameworks: Annotate JUnit4 test with @Test" am: 4d9bec6b4a am: a7c5afafe3
am: 0bf88228ca

Change-Id: I0c611c22eedda2d849bd16ef2e2bb7e2e60e0a5a

Andreas Gampe   authored and   android-build-merger   commited 2018-02-27 19:39:51 +00:00
5781efe42a
Frameworks: Annotate JUnit4 test with @Test
Mollify Errorprone.

Bug: 72076216
Test: m javac-check RUN_ERROR_PRONE=true
Test: atest IpSecServiceParameterizedTest
Change-Id: Ia3a253c4c5994937efc0f498ac047c5fb4eee3e9

Andreas Gampe   commited 2018-02-26 08:09:26 -08:00
94bb3f9b9e
Name specific app for rapid data usage.
When a single app is responsible for more than half of the data usage
that caused us to trigger a "rapid usage" alert, name that app in the
notification.  Tests to verify.

Move NPMS->NSS direct calls to "Internal" pattern, following
best-practices to avoid unnecessary AIDL exposure.

Remove 3G/4G split mobile plan support, which has been deprecated for
years and was never supported in a shipping product.

Move MultipathPolicyTracker in tree to reflect its package name.

Test: bit FrameworksNetTests:*
Test: bit FrameworksServicesTests:com.android.server.NetworkPolicyManagerServiceTest
Bug: 69263587, 64221505, 73431080, 72746951
Exempt-From-Owner-Approval: approved in previous PS
Change-Id: I3e4ec1ae2222d51b232f76f32faca93d4f8cd272

Jeff Sharkey   commited 2018-02-23 16:27:39 +00:00
d7fce6abbd
Merge "Fix ConnectivityServiceTest for NATT Keepalive" am: cab3e6009c am: 4e2e3f823b
am: 3a5a4efd8a

Change-Id: I2ce9d740b82f591b847150ec1eaffa39bfbd0241

nharold   authored and   android-build-merger   commited 2018-02-20 23:21:59 +00:00
2b1592206b
Merge "Fix ConnectivityServiceTest for NATT Keepalive"
nharold   authored and   Gerrit Code Review   commited 2018-02-20 19:17:23 +00:00
cab3e6009c
Merge changes Ic28c5653,Ic635f97b am: 0ca21cfdfe am: a0402e1baa
am: a9b555cfa1

Change-Id: Ieea9917b3a68e08686c74ebf39e5fed61f641a7a

Chalard Jean   authored and   android-build-merger   commited 2018-02-19 08:36:01 +00:00
0bf8c2522a
Merge changes Ic28c5653,Ic635f97b
* changes:
  [LT2] Fix release request while lingering.
  [LT1] Add a test for release request while lingering

Treehugger Robot   authored and   Gerrit Code Review   commited 2018-02-19 03:45:27 +00:00
0ca21cfdfe