Commit graph

5,644 commits

Message SHA1
Replace Handler with Executor for async DNS API
Bug: 124882626
Test: built, flashed, booted
      atest DnsResolverTest DnsPacketTest

Change-Id: Ie1dc27643d4767f2a8a39da755edf388a00962d5

Luke Huang   commited 2019-03-16 18:53:07 +08:00
dfd2e4da29
Refactor answer callback for async DNS query JAVA API
1. refactor AnswerCallback with a generic type
2. support onError in AnswerCallback
3. Fix minor problem reported from API Review

Bug: 124882626
Test: built, flashed, booted
      atest DnsResolverTest DnsPacketTest

Change-Id: I685c9989f8401acb63d2e83f552b2d5b20c41af0

Luke Huang   commited 2019-03-16 18:53:05 +08:00
6d72b2c073
Merge "Moved transport to IntDef"
Treehugger Robot   authored and   Gerrit Code Review   commited 2019-03-15 23:21:29 +00:00
122c557701
Merge "Integrate testNetworkService and Manager with Connectivity stack"
Benedict Wong   authored and   Gerrit Code Review   commited 2019-03-15 17:41:02 +00:00
546bcbb218
Moved transport to IntDef
Moved out from the sub class per API review feedback.

Test: Build
Bug: 128607082
Merged-In: I1b513bcaaa0ebf47c14593d962579ed48a7c6db0
Change-Id: I1b513bcaaa0ebf47c14593d962579ed48a7c6db0

Jack Yu   commited 2019-03-14 20:32:16 -07:00
7e0f9143e6
[KA02.5] Use binder thread and executor to invoke callback
Currently, client side of keepalive event handling rely on a
newly created thread, looper, messenger and handler per object.

However, by creating oneway AIDL interface with the executor,
the callbacks can be invoked on the binder thread with user
specified context, which not only greatly simplify the design
but also reduce the cost of current thread modeling.

Bug: 114151147
Bug: 123969871
Test: 1. atest FrameworksNetTests --generate-new-metric 10
      2. atest-deflake.sh

Change-Id: I27504074cd28d5b5eb94a7ec0e97ebaaaaa1ae3d

junyulai   commited 2019-03-14 19:24:12 +08:00
070f9ff460
Merge "Rename entitlement callback to adhere to API guidelines."
Treehugger Robot   authored and   Gerrit Code Review   commited 2019-03-13 04:48:24 +00:00
9e77cca082
Integrate testNetworkService and Manager with Connectivity stack
This change adds TestAPIs for tests to retrive an instance of
ConnectivityManager, allowing it to build test TUN interfaces, as well
as test networks.

This also integrates the TestNetwork types with ConnectivityManager,
creating virtual networks if the network agent is a test agent.

Bug: 72950854
Test: Compiles, CTS tests using this passing correctly
Change-Id: Ic1a04aa66014d1c66a74e65dbace3218437403ae
Merged-In: I741ef9cdf4bd4125d9129af3a030edf32f438e4f

Benedict Wong   commited 2019-03-13 02:26:30 +00:00
493e04b932
Merge "Tell the factory it is already serving a request."
Chalard Jean   authored and   Gerrit Code Review   commited 2019-03-13 02:07:29 +00:00
11230da789
Merge "Temporarily disable flaky test."
Ian Kasprzak   authored and   Gerrit Code Review   commited 2019-03-13 01:52:21 +00:00
89351e03ed
Merge "[KA13]: add unit test for exposed TCP socket keepalive API."
Xiao Ma   authored and   Gerrit Code Review   commited 2019-03-13 01:13:08 +00:00
87b73b01df
Temporarily disable flaky test.
Test: None
Bug: 128426024
Change-Id: Id88bf452f41f512703d5831e357d9ba72dc5b911

Lorenzo Colitti   commited 2019-03-13 09:23:54 +09:00
321475fe7e
Rename entitlement callback to adhere to API guidelines.
The method for OnTetheringEntitlementResultListener needs to be
onTetheringEntitlementResult in order to meet our API guidelines:

"Use Listener when there is a single callback method and there will
never be any others. It should be an interface whose name is the same
as the callback method plus Listener."

Bug: 126392011
Change-Id: I9a883765541ae853c4eb3bd52c9d93a7af16e661
Test: Manual build

Jeremy Klein   commited 2019-03-12 13:36:21 -07:00
7e7c742ad7
Tell the factory it is already serving a request.
This is a cherry-pick of ag/607226 that has been rebased on
top of four years of changes and with comments addressed.

Gives each factory a serial number and propagates it to every
NetworkAgent so when a score comes back indicating a request is
being handled the factory can account for it properly.

Without this, a new request that's already handled by a network
offered by a factory will not cause an increment of the factorys
ref count. Concretely this results in issues like the RAT icon
not being displayed in spite of the network actually being up
and usable.

This will be ported to AOSP as soon as possible, but immediately
some master-only WiFi tests need to be adjusted with this change
which would not let me submit to AOSP.

Bug: 18637384
Bug: 29030667
Test: manual
Test: atest frameworks/opt/telephony/tests/telephonytests
Test: atest frameworks-net
Test: atest CtsNetTestCases CtsHostsideNetworkTests
Change-Id: I597ac588f76dd507512ff02868fd1310b7e63f7e
Merged-In: I597ac588f76dd507512ff02868fd1310b7e63f7e

Chalard Jean   commited 2019-03-12 21:47:21 +09:00
29d06db64b
Merge "[CS] Support "instant failure" from factories"
Chalard Jean   authored and   Gerrit Code Review   commited 2019-03-12 12:04:46 +00:00
dce527fbd6
[KA13]: add unit test for exposed TCP socket keepalive API.
Bug: 123987272
Test: atest FrameworksNetTests
Change-Id: I543d8f00ae539b706592a149981e3e8992999284

Xiao Ma   commited 2019-03-12 17:30:47 +09:00
fcd1ab6aaf
Merge "Check if network has partial connectivity"
Lucas Lin   authored and   Gerrit Code Review   commited 2019-03-12 08:11:14 +00:00
2d3cc4577a
Check if network has partial connectivity
In some networks, network validation may only get success
result for http probe but fail result for https probe.
For this kind of network, it may still work at some websites
or apps, but user didn't know about that. In order to fix this
issue, we will check if network has partial connectivity and
notify user to make a choice if they want to use this partial
connectivity or not.

Bug: 113450764
Test: 1. Build pass.
      2. Fake partial connectivity case for testing.
      3. atest FrameworksNetTests
      4. atest NetworkStackTests

Change-Id: I69ed00ac4850904ff708c9fef22e148879a10e92

lucaslin   authored and   Lucas Lin   commited 2019-03-12 07:37:33 +00:00
2240ef679d
Merge "Improve keepalive offload documentation and error handling"
Junyu Lai   authored and   Gerrit Code Review   commited 2019-03-12 05:11:50 +00:00
a0b880c9e8
[CS] Support "instant failure" from factories
Add a mechanism by which a factory can declare "instant failure" for
a request - which would result in it getting an OnUnavailable()
(even without a timeout).

Factories may only do this iff:
1. They know they are the only factory which may fulfill this
   request (common for transport-specific requests).
2. The know that the request can definitely not be
   fulfilled at any point in the future.

Bug: 31382922
Test: atest ConnectivityServiceTest
Merged-In: I9bce0f4d85fa8cad7f8a9998819f945b778c5ac5
Change-Id: I9bce0f4d85fa8cad7f8a9998819f945b778c5ac5

Etan Cohen   commited 2019-03-11 16:15:43 -07:00
fbfdd84e7c
Merge "Add tethering event callback API"
Chalard Jean   authored and   Gerrit Code Review   commited 2019-03-11 17:04:57 +00:00
80c8a33c95
Merge "[PT17.5] Revert to booleans for send/not send broadcast constants."
Treehugger Robot   authored and   Gerrit Code Review   commited 2019-03-11 11:07:21 +00:00
4e9a6e4c53
[PT17.5] Revert to booleans for send/not send broadcast constants.
In PT17, for security of the patch these two constants have been
switched from boolean to enum values. While this is nice for making
sure a patch is correct, it's also pretty wasteful. Now that it's
certain that the values of these fields don't matter, they can be
set to logical values (as opposed to reversed as it was the case
before PT17.

Test: runtest
Change-Id: I93a0780e23c2f658687be066dc16f27529baaa86

Chalard Jean   commited 2019-03-11 15:58:31 +09:00
2a67906ec5
Merge "Convert tests/**/Android.mk files to Android.bp"
Treehugger Robot   authored and   Gerrit Code Review   commited 2019-03-08 22:54:11 +00:00
ef59cd5d8b
Add tethering event callback API
Provide OnTetheringEventCallback for system app to know
tethering's upstream.

Bug: 125583822
Test: -build, flash, boot
      -atest FrameworksNetTests

Change-Id: I7ca81b27c9b805cc01884509f5b20d9d0a24cd36
Merged-in: I7ca81b27c9b805cc01884509f5b20d9d0a24cd36

markchien   commited 2019-03-09 00:35:55 +08:00
4ef53e8819
Merge "Minor changes to the async DNS query JAVA API"
Luke Huang   authored and   Gerrit Code Review   commited 2019-03-08 03:19:55 +00:00
06ef4a5bc4
Convert tests/**/Android.mk files to Android.bp
See build/soong/README.md for more information.

Note: tests/ImfTest/Android.mk causes conflict as it hasn't been yet
ported to internal master. Do it later.
Note: the conversion in the following directories has to be done in the
internal master first because of the conflicts:
* tests/ActivityManagerPerfTests
* tests/AppLaunch
* tests/AppLaunchWear
* tests/BackgroundDexOptServiceIntegrationTests
* tests/Camera2Tests/CameraToo
* tests/Camera2Tests/SmartCamera/SimpleCamera
* tests/Compatibility
* tests/Internal
* tests/RcsTests
* tests/ServiceCrashTest
* tests/UsbTests

Bug: 122332340
Test: treehugger
Change-Id: Ie17590c6a96aee5caa80d38092a3de5c1b6efe8d

Sasha Smundak   commited 2019-03-07 16:14:00 -08:00
2e39455210
Merge changes Ie66ba631,Ic42c09a3
* changes:
  Implement TestNetworkService
  Add shell TestNetworkManager and Service

Benedict Wong   authored and   Gerrit Code Review   commited 2019-03-07 23:32:55 +00:00
6525e97ea5
Merge "Fix TetheringEntitlementValueListener related API"
Mark Chien   authored and   Gerrit Code Review   commited 2019-03-07 13:21:53 +00:00
cdfb2b941d
Minor changes to the async DNS query JAVA API
1. refine the naming in DnsPacket and add more comment
2. add comment in DnsResolver

Test: built, flashed, booted
      atest DnsResolverTest DnsPacketTest

Change-Id: Ib482d079d6823fd1d9bff163427b7aad38374199

Luke Huang   commited 2019-03-07 16:40:49 +08:00
1244835690
Improve keepalive offload documentation and error handling
Bug: 123987401
Test: atest FrameworksNetTests
Change-Id: Id651cfb743f02b05ca3845af3c393eaf5762bb20

junyulai   commited 2019-03-07 16:01:30 +08:00
97767bf71c
Merge "Migrate frameworks/base/tests/net/ to androidx.test"
Treehugger Robot   authored and   Gerrit Code Review   commited 2019-03-07 05:42:07 +00:00
e69a7a1554
Fix TetheringEntitlementValueListener related API
Test: -build, flash, boot
      -atest FrameworksNetTests
bug: 126701557
bug: 126392011

Change-Id: I6dda10fbfe8ffaef71269617750a22563396f5ea

markchien   commited 2019-03-07 13:33:21 +08:00
bf5ab01869
Implement TestNetworkService
This change adds the relevant JNI implementations, as well as the
implementations and NetworkAgent tracking code in the TestNetworkService.

TestNetworkService (And Manager) is designed for use exclusively in
testing code, allowing for the creation of TUN and IPsec backed networks
in test code. Specifically, this allows for testing of components such
as IP, DHCP, or DNS clients, as well as kernel features such as IPsec.

Access to the TestNetworkService will be conditioned upon the
MANAGE_TEST_NETWORKS permission that will be granted only to the Shell.
CTS will use UiAutomation.adoptShellPermissionIdentity() to gain the
ability to use this service.

Bug: 72950854
Test: CTS tests passing
Change-Id: Ie66ba631a548b5f9c6b5ed0797582f86688debe5

Benedict Wong   commited 2019-03-06 15:37:52 -08:00
2ffe4b8998
Merge "Add @UnsupportedAppUsage annotations"
Andrei-Valentin Onea   authored and   Gerrit Code Review   commited 2019-03-06 17:18:05 +00:00
7e3ccaa77a
Migrate frameworks/base/tests/net/ to androidx.test
Test: atest FrameworksNetTests
Change-Id: Iaa59d606f5e1678cc5aaca9ed37e184fad894e5d

Brett Chabot   commited 2019-03-05 09:05:47 -08:00
147f6cf341
Merge "Fix isActiveNetworkMetered for VPNs."
Varun Anand   authored and   Gerrit Code Review   commited 2019-03-05 01:37:30 +00:00
8cf699851a
Merge "Adding new APN type for Mission Critical Services."
Amit Mahajan   authored and   Gerrit Code Review   commited 2019-03-04 18:23:30 +00:00
a32315e69a
Merge "Return not supported if no necessary socket option"
Mark Chien   authored and   Gerrit Code Review   commited 2019-03-04 09:16:07 +00:00
acb289f34e
Merge "Fixed all APIs not meeting API review requirement"
Treehugger Robot   authored and   Gerrit Code Review   commited 2019-03-03 04:27:32 +00:00
37cde6b81d
Merge "Ensure handleUpdateLinkProperties runs on the CS handler thread."
Treehugger Robot   authored and   Gerrit Code Review   commited 2019-03-02 05:38:21 +00:00
57ca4b2743
Merge "getConnectionOwnerUid: Clarify documentation"
Treehugger Robot   authored and   Gerrit Code Review   commited 2019-03-02 03:42:22 +00:00
72a6706e8b
Adding new APN type for Mission Critical Services.
Test: build
Bug: 124447962
Change-Id: I9f608badd363703394432640dc892a4465660b6d

Amit Mahajan   commited 2019-03-01 16:52:17 -08:00
b7aafd26aa
Fixed all APIs not meeting API review requirement
To address the API review feedback provided by
the API council.

Bug: 126702995
Bug: 126701710
Bug: 126702357
Bug: 126701113
Bug: 126701239
Bug: 126700713
Bug: 126700064
Test: Manual
Change-Id: I4b902c1fc2c09133022b05dacdda8964436205d2

Jack Yu   commited 2019-03-01 14:37:47 -08:00
9fc82e3a86
Fix Automated API Review: InetAddresses
Add @NonNull annotations as required by the automated review.

Bug: 126702338
Test: make checkbuild
Change-Id: I9057f06de8d7ea846af00d5cefa744d4206b4b63

Paul Duffin   commited 2019-03-01 14:06:18 +00:00
e59e8c6255
Add shell TestNetworkManager and Service
This adds the scaffolding for TestNetworkManager and TestNetworkService.
These are separate from the ConnectivityManager/ConnectivityService in
order to prevent polluting the API space, and making them harder to
maintain.

Bug: 72950854
Test: Compiles, CTS tests relying on this pass
Change-Id: Ic42c09a33d962471e2587ec27f3fab2d72bbcd42

Benedict Wong   commited 2019-02-28 21:46:58 -08:00
a4ca3c6312
Remove ConnectivityManager and its usages from NetworkStatsService.
NSS needed it for getting VpnInfo[], NetworkState[] and
activeLinkProperties which it used to query via ConnectivityManager.

For VpnInfo[], this was racy as NSS may ignore intermediate changes to a
VPN's underlying networks. See http://b/123961098 for more context.

It may also lead to deadlocks b/w ConnectivityService and
NetworkStatsService. See http://b/126245192 for more info.

This change will ensure that NSS is never contending on any of
ConnectivityService locks.

Bug: 123961098
Bug: 126245192
Bug: 120145746
Test: atest FrameworksNetTests
Change-Id: Id1da446b54d95ee68ed14079107b1a10318bcf8b
Merged-In: I57e117bb4e9efe491b19d6b5a479f2d58d1c58e6

Varun Anand   commited 2019-03-01 00:10:52 +00:00
f3fd8dd454
Fix isActiveNetworkMetered for VPNs.
This change is basically a revert of http://ag/3580901.
It was made because previously VPN capabilities did not use to update
based on its underlying networks. That is no longer the case anymore.

This was previously returning meteredness on the basis of VPN's first
underlying network which is incorrect in cases such as VPN using
multiple underlying networks, or VPN that has explicitly marked itself
as metered via VpnService.Builder#setMetered API.

Bug: 123936838
Test: atest FrameworksNetTests
Change-Id: Ia54b8570fbad4a638a6d43a95e0271c6baf66685

Varun Anand   commited 2019-02-28 13:18:11 -08:00
83b6d76c93
Add @UnsupportedAppUsage annotations
For packages:
  android.net
  android.net.wifi
  android.nfc

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Merged-In: I7489aad1dceeb18ed7ca48a1ed8829a668b3fa04
Change-Id: I16570aef456b45a5543bf889dddc7a0d25441928

Andrei Onea   commited 2019-02-28 14:39:20 +00:00
23393e21ec
Merge "Fix broken javadoc links"
Treehugger Robot   authored and   Gerrit Code Review   commited 2019-02-28 13:34:52 +00:00
1dd83b17a9