Commit graph android_packages_modules_Co.../tests/net/java
Message SHA1
Add a new ssid field in NetworkCapabilities.
Clean cherry-pick of ag/3887737

Bug: 77891227
Test: frameworks-net
Change-Id: Icefe1657bca52b913a72b56705342a7285769658
Merged-In: Ia1f4e51b7c2e9118789242cf6d9e7576c4167cda
Merged-In: I6dd1aba6fde5a502b4a9145cf16393d8ce623c89

Chalard Jean   commited 2018-06-06 08:23:52 +00:00
390bee5f2c
Merge "Migrating remaining core networking tests to Junit4"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2018-05-25 03:27:39 +00:00
bbfe4d043f
Merge changes I3b3bcbbd,I18b3f263,I3c416c1a
* changes:
  Use CaptivePortalProbeSpec method in portal app
  Add configurable captive portal probes
  Move CaptivePortalProbeResult to its own file

Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2018-05-24 07:53:00 +00:00
3f6d2b08ad
Migrating remaining core networking tests to Junit4
Bug: 62918393
Test: runtest frameworks-net
Merged-In: I30f7eaa0307b8fad5a8de7a0da235a4f76c18677
(clean cherry-pick of I30f7eaa0307b8fad5a8de7a0da235a4f76c18677)

Change-Id: I272fea0bb4a9e7f6252bb3bd14a6b769a082039e

Hugo Benichi   authored and   Remi NGUYEN VAN   commited 2018-05-24 16:24:47 +09:00
e17657c0f1
Move CaptivePortalProbeResult to its own file
This is necessary to resolve visibility issues for the next change.

Bug: b/79499239
Test: runtest frameworks-net
Merged-In: Ia48b32307a51a66f2672d7112f71166dd6db41b1
Merged-In: I5df7ee9f16bc6be4f02353d40a843a383dd4cbd9
(Clean cherry-pick of pi-dev I50bc96afe6ae88c8f58a693f0a4e821f1f9b3299)

Change-Id: I3c416c1a91ebfdf914fd528ff8ab73e3eb490562

Remi NGUYEN VAN   commited 2018-05-24 12:04:27 +09:00
f3eae13de9
Merge "Fix testRegisterUsageCallback"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2018-05-08 07:55:42 +00:00
899283d833
Fix testRegisterUsageCallback
noteOp (introduced in go/ag/3897834) checks that the calling uid matches
the calling package, which is not correct when using a fake calling
package. Use the real package of the test so permissions are checked
properly.

The test currently only fails this way in pi-dev as noteOp is only used
in pi-dev.
Change-Id: I9ac3717af9335ba9efa0b8842a2df0d7b69ec9ab
Test: Fixed test now passes in pi-dev
Bug: b/78487385

Remi NGUYEN VAN   commited 2018-05-02 16:51:13 +09:00
b1ff5a381e
Remove the unused file parsing function
With the new xt_bpf support for iface stats. We no longer need to parse
the per interface stats from /proc/net/dev. And since the old xt_qtaguid
code path also not depend on it, we can completly remove that helper
function since no caller is depending on it now.

Bug: 72111305
Test: runtest frameworks-net -c com.android.internal.net.NetworkStatsFactoryTest
Change-Id: Icb7eaeef0eeb9fdffd32a90316c76ee05bafffbe

Chenbo Feng   commited 2018-05-01 14:13:55 -07:00
84c1437111
Let DnsManager fill in LinkProperties for private DNSes
(clean cherry-pick from ag/3880157)

Test: new tests pass
Bug: 73641539
Change-Id: I971ef4d27b22a435d7459e1c4b31a8715ef6e610
Merged-In: I837df61e3c277ae08ebf4fdcd4c4e9ac8c550811
Merged-In: I72ecaa4f7d7320ffa2e0ba82fadafc947c8a6981

Chalard Jean   commited 2018-04-27 13:32:10 +09:00
70be7a9dd0
Add the list of private DNS addresses to LinkProperties
(clean cherry-pick from ag/3874803)

Test: atest android.net.LinkPropertiesTest, also new tests pass
Bug: 73641539
Change-Id: If33a35b1354a67db09411ff098f20064797296ad
Merged-In: I4b739c56e658690532ae9deb0b9a3bc9b2adf8b0
Merged-In: I6bdbef78d078d68534c8e07e9af031ce374560ef

Chalard Jean   commited 2018-04-27 13:32:10 +09:00
299d856143
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

dalyk   commited 2018-04-09 16:45:22 -04:00
1720e54568
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

Erik Kline   commited 2018-04-05 15:17:38 -07:00
9a62f0108e
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

Benedict Wong   commited 2018-04-03 17:04:55 -07:00
412ff4144b
Merge "Mark networks with OEM_PAID always restricted"
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2018-03-30 07:00:54 +00:00
dbc568ceaf
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

Pavel Maltsev   authored and   Lorenzo Colitti   commited 2018-03-30 07:00:39 +00:00
8cb5245570
Merge "Limit the number of routes for performance"
Chalard Jean   authored and   Gerrit Code Review   commited 2018-03-30 06:40:29 +00:00
7f5163f453
Merge "Require explicitly supplied truncation length"
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2018-03-30 04:59:22 +00:00
2db4d5fbda
Merge "Clarify UDP encapsulation socket API"
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2018-03-30 04:58:47 +00:00
db1e624ee1
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-29 18:13:23 +09:00
459c9109ca
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

Benedict Wong   commited 2018-03-28 18:02:54 -07:00
5f38c02385
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

Remi NGUYEN VAN   commited 2018-03-28 12:14:14 +09:00
c19a5eb8e4
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

Benedict Wong   commited 2018-03-27 19:46:50 -07:00
a042c3f82b
Merge "Pass all relevant resolver info to netd"
Treehugger Robot   authored and   Gerrit Code Review   commited 2018-03-23 23:41:11 +00:00
ce907ddfc4
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

Erik Kline   commited 2018-03-22 23:50:13 -07:00
286974f384
Merge "Have PermissionMonitor arbiter which app can access background networks"
Chalard Jean   authored and   Gerrit Code Review   commited 2018-03-23 06:15:00 +00:00
433c0e652f
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-22 19:03:59 +09:00
e64b8d7bce
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

Remi NGUYEN VAN   commited 2018-03-22 15:31:28 +09:00
1cb92c713f
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

Nathan Harold   commited 2018-03-20 11:26:29 -07:00
bd12ffffc0
Merge "Added implementation for VTI add/remove address"
Benedict Wong   authored and   Gerrit Code Review   commited 2018-03-19 22:05:09 +00:00
3f3410ae6b
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

Benedict Wong   commited 2018-03-16 10:25:43 -07:00
0da1f39e22
Fixing comments in Network Capabilities
Clean up after aosp/606338

Test: m -j (only comments has been changed)
Change-Id: I2627654450244024c2be92f9067534dfc2a80891

Pavel Maltsev   commited 2018-03-09 10:42:32 -08:00
1f9f48e1c4
Merge "Minor clean-up in NetworkCapabilities"
Treehugger Robot   authored and   Gerrit Code Review   commited 2018-03-07 21:06:59 +00:00
1dd43b192c
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: I4b39e7031416cb33b23d89aa36ff0f774eaa942f
Fixes: 74038898
Test: runtest frameworks-net, CTS tests pass

Remi NGUYEN VAN   commited 2018-03-06 13:28:19 +09:00
a08eb7203b
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."
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
Minor clean-up in NetworkCapabilities
Follow up clean up for aosp/606338

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

Pavel Maltsev   commited 2018-03-01 18:06:25 -08:00
15e839f111
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"
Treehugger Robot   authored and   Gerrit Code Review   commited 2018-02-28 07:06:00 +00:00
2501283064
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
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
* 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
[LT2] Fix release request while lingering.
Test: runtest framework-net
Change-Id: Ic28c5653d16351903b792e76ba8b199b7ed1f8d4

Chalard Jean   commited 2018-02-19 11:00:58 +09:00
9f48d166f6
Fix ConnectivityServiceTest for NATT Keepalive
Fix test breakages I caused when adding cell
support for NATT keepalives.

-Make the minimum keepalive interval a constant in
 ConnectivityManager and use it in tests.
-Re-Disallow IPv6 Keepalives

Bug: 73327535
Test: 'runtest -x ConnectivityServiceTest' now passes
Change-Id: I5ec4367d250ee371014e65c897c3897a25a05e2d

Nathan Harold   commited 2018-02-16 16:34:50 -08:00
0990bc8b57
[LT1] Add a test for release request while lingering
Test: runtest framework-net
Change-Id: Ic635f97bf3dad8b695b3b8cc32c1a8b891166f9f

Chalard Jean   commited 2018-02-16 18:09:42 +09:00
a7c93b0b5b
Correct bug in IpSecTransformTest
testCreateTransformsWithSameConfigEqual used assertFalse rather than
assertTrue

Bug: 69385347
Test: Passing on walleye
Change-Id: I8caa26e184e8bfc3e8acc9061d85c22d27ebf448

Benedict Wong   commited 2018-02-15 18:52:07 -08:00
b7ca6bf4c1
Add OEM_PAID network capability
Bug: 68762530

Test: runtest -x frameworks/base/tests/net/

Change-Id: I51c07e0c2211d631e90b27468c26b599e7b07bc8

Pavel Maltsev   commited 2018-02-15 10:46:00 -08:00
d4d611954e
Merge changes I3d68dbf8,I6ea524bb,I978d9119
* changes:
  Deprecate CONNECTIVITY_ACTION.
  Publish FOREGROUND and add NOT_SUSPENDED capabilities.
  Send null UIDs to apps instead of single-uid lists.

Chalard Jean   authored and   Gerrit Code Review   commited 2018-02-15 11:25:36 +00:00
91d3912eab
Publish FOREGROUND and add NOT_SUSPENDED capabilities.
NOT_SUSPENDED and FOREGROUND are capabilities that need to
be public so as to reach feature parity with what information
can be gotten through the use of CONNECTIVITY_ACTION and
synchronous calls to ConnectivityManager. This change makes
them public, and wires up the NOT_SUSPENDED capability.
This deprecates in effect the old onSuspended and onResumed
callbacks, but these have never been public.

This also converts the onAvailable path from a multiple
binder call design to a simpler, single binder call. This
is only for internal convenience

Test: runtest frameworks-net
Test: cts
Test: also manual testing
Change-Id: I6ea524bb361ecef0569ea2f9006c1e516378bc25

Chalard Jean   commited 2018-02-14 15:14:41 +09:00
a23bc9e501