Commit Graph

1484 Commits

Author SHA1 Message Date
Lorenzo Colitti
6505a76d78 Merge changes from topic "framework-no-networkstack-aidl"
* changes:
  Remove the framework dependency on netd_aidl_parcelables-java.
  Move TcpKeepalivePacketData out of the framework.
  Stop using netd parcelables in the framework.
2019-03-20 09:45:37 +00:00
Remi NGUYEN VAN
3886def4fa Merge "Add documentation for CaptivePortal APP_RETURN_*" 2019-03-20 05:40:41 +00:00
Remi NGUYEN VAN
d64b329979 Merge "Add Parcelable implementation for ApfCapabilities" 2019-03-20 00:34:53 +00:00
Lorenzo Colitti
82f2a72d01 Move TcpKeepalivePacketData out of the framework.
This class is not used in framework.jar, only in services.jar.
Move it out of the framework so framework.jar can stop depending
on the NetworkStack stable AIDL interfaces.

This should really under com.android.server as well, but that's
a cross-project change to be done in another CL.

Test: m
Bug: 128804404
Change-Id: Ib2805f7fcc516a5f6989c252365d1c95b8042703
Merged-In: Ib2805f7fcc516a5f6989c252365d1c95b8042703
2019-03-20 08:56:31 +09:00
Lorenzo Colitti
15c035c790 Stop using netd parcelables in the framework.
The only actual users of these classes are in services.jar, not
in frameworks.jar. The only reason the framework depends on them
is that the code that converts to and from stable parcelables is
currently in the framework. Move that code to services and cut
the dependency.

These classes aren't used in the networkstack app so they don't
need to be in shared. They also can't be in shared because the
classes are not in the SDK. So put the conversion functions
directly inside their only user (NetworkManagementService).

Also remove the jarjar rules that rename the classes for use by
the NetworkStack app.

This does not actually remove the dependency from the build file,
that will be done in a future CL.

Bug: 128804404
Test: builds, boots
Test: atest FrameworksNetTests android.net.cts.ConnectivityManagerTest HostsideVpnTests
Change-Id: I027d50ba56091f5558f45e6e08f32e5912b2a82a
Merged-In: I027d50ba56091f5558f45e6e08f32e5912b2a82a
2019-03-20 08:56:24 +09:00
Remi NGUYEN VAN
18017cb6d1 Add documentation for CaptivePortal APP_RETURN_*
This fixes API review requests.

Test: atest FrameworksNetTests NetworkStackTests
Bug: 126883311
Change-Id: I0632a98675e65c5e722e81a2c1e0cf1403b54395
2019-03-19 18:57:44 +09:00
Luke Huang
21be4d297c Merge "Replace Handler with Executor for async DNS API" 2019-03-19 05:35:39 +00:00
Luke Huang
2b474c454f Merge "Refactor answer callback for async DNS query JAVA API" 2019-03-19 05:35:18 +00:00
Mark Chien
2adc944732 Merge "Remove deprecated entitlement API" 2019-03-19 02:44:37 +00:00
Luke Huang
b1cf5aaf06 Support query cancellation for async DNS API
Bug: 124882626
Test: built, flashed, booted
      atest DnsResolverTest DnsPacketTest

Change-Id: Iaa72f5c17f58cf0a58663b892bb18cfdf23cd545
2019-03-16 18:53:09 +08:00
Luke Huang
dfd2e4da29 Replace Handler with Executor for async DNS API
Bug: 124882626
Test: built, flashed, booted
      atest DnsResolverTest DnsPacketTest

Change-Id: Ie1dc27643d4767f2a8a39da755edf388a00962d5
2019-03-16 18:53:07 +08:00
Luke Huang
6d72b2c073 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
2019-03-16 18:53:05 +08:00
Benedict Wong
546bcbb218 Merge "Integrate testNetworkService and Manager with Connectivity stack" 2019-03-15 17:41:02 +00:00
markchien
92344ef44f Remove deprecated entitlement API
The deprecated entitlement APIs[1] is introduced in the Q
development cycle. It should be replaced by new APIs[2][3].

[1] https://android-review.googlesource.com/c/platform/frameworks/base/+/874220
[2] https://android-review.googlesource.com/c/platform/frameworks/base/+/920354
[3] https://android-review.googlesource.com/c/platform/frameworks/base/+/927513

Test: -build, flash, boot
bug: 126701557
bug: 126392011
Change-Id: I96487e9038c07363680a76db840994719d7ff768
2019-03-15 09:03:50 +00:00
Remi NGUYEN VAN
df04297b86 Add Parcelable implementation for ApfCapabilities
This is necessary to allow usage of ApfCapabilities as-is in AIDL,
instead of relying on ApfCapabilitiesParcelable, assuming that stable
AIDL starts allowing usage of @SystemApi classes. The Parcelable
implementation would be convenient for clients in any case.

Bug: 126477266
Test: atest FrameworksNetTests
Change-Id: Id2ef3cad261832a2918ccb6bb6bc154d99d75746
2019-03-15 13:41:59 +09:00
junyulai
070f9ff460 [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
2019-03-14 19:24:12 +08:00
Treehugger Robot
9e77cca082 Merge "Rename entitlement callback to adhere to API guidelines." 2019-03-13 04:48:24 +00:00
Benedict Wong
493e04b932 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
2019-03-13 02:26:30 +00:00
Jeremy Klein
7e7c742ad7 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
2019-03-12 13:36:21 -07:00
Chalard Jean
29d06db64b 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
2019-03-12 21:47:21 +09:00
Chalard Jean
dce527fbd6 Merge "[CS] Support "instant failure" from factories" 2019-03-12 12:04:46 +00:00
lucaslin
2240ef679d 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
2019-03-12 07:37:33 +00:00
Junyu Lai
a0b880c9e8 Merge "Improve keepalive offload documentation and error handling" 2019-03-12 05:11:50 +00:00
Etan Cohen
fbfdd84e7c [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
2019-03-11 16:15:43 -07:00
markchien
4ef53e8819 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
2019-03-09 00:35:55 +08:00
Luke Huang
06ef4a5bc4 Merge "Minor changes to the async DNS query JAVA API" 2019-03-08 03:19:55 +00:00
Benedict Wong
6525e97ea5 Merge changes Ie66ba631,Ic42c09a3
* changes:
  Implement TestNetworkService
  Add shell TestNetworkManager and Service
2019-03-07 23:32:55 +00:00
Mark Chien
cdfb2b941d Merge "Fix TetheringEntitlementValueListener related API" 2019-03-07 13:21:53 +00:00
Luke Huang
1244835690 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
2019-03-07 16:40:49 +08:00
junyulai
97767bf71c Improve keepalive offload documentation and error handling
Bug: 123987401
Test: atest FrameworksNetTests
Change-Id: Id651cfb743f02b05ca3845af3c393eaf5762bb20
2019-03-07 16:01:30 +08:00
markchien
bf5ab01869 Fix TetheringEntitlementValueListener related API
Test: -build, flash, boot
      -atest FrameworksNetTests
bug: 126701557
bug: 126392011

Change-Id: I6dda10fbfe8ffaef71269617750a22563396f5ea
2019-03-07 13:33:21 +08:00
Andrei-Valentin Onea
7e3ccaa77a Merge "Add @UnsupportedAppUsage annotations" 2019-03-06 17:18:05 +00:00
Amit Mahajan
a32315e69a Merge "Adding new APN type for Mission Critical Services." 2019-03-04 18:23:30 +00:00
Treehugger Robot
37cde6b81d Merge "Fixed all APIs not meeting API review requirement" 2019-03-03 04:27:32 +00:00
Treehugger Robot
72a6706e8b Merge "getConnectionOwnerUid: Clarify documentation" 2019-03-02 03:42:22 +00:00
Amit Mahajan
b7aafd26aa Adding new APN type for Mission Critical Services.
Test: build
Bug: 124447962
Change-Id: I9f608badd363703394432640dc892a4465660b6d
2019-03-01 16:52:17 -08:00
Jack Yu
9fc82e3a86 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
2019-03-01 14:37:47 -08:00
Paul Duffin
e59e8c6255 Fix Automated API Review: InetAddresses
Add @NonNull annotations as required by the automated review.

Bug: 126702338
Test: make checkbuild
Change-Id: I9057f06de8d7ea846af00d5cefa744d4206b4b63
2019-03-01 14:06:18 +00:00
Benedict Wong
a4ca3c6312 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
2019-02-28 21:46:58 -08:00
Varun Anand
f3fd8dd454 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
2019-03-01 00:10:52 +00:00
Andrei Onea
23393e21ec 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
2019-02-28 14:39:20 +00:00
Jeff Vander Stoep
440df92ff3 getConnectionOwnerUid: Clarify documentation
Test: build
Bug: 117573763
Change-Id: Ia899a541987b9c72a83287ed69fc47ab4d38f680
2019-02-27 13:37:37 -08:00
Chiachang Wang
3b723c2ee8 Fix broken javadoc links
Bug: 123683994
Test: Verify with javadoc
Change-Id: I4b1b936e3cf86104ace5fcb6829778710801f2d5
2019-02-27 17:18:40 +08:00
Remi NGUYEN VAN
48eaae51e3 Merge "Remove NetworkMonitor dependency on ICaptivePortal"
am: 399be8f9b9

Change-Id: Ia0d06e1aa931cdc1c6dd4008e804a6a44ae2304f
2019-02-15 00:26:34 -08:00
Remi NGUYEN VAN
399be8f9b9 Merge "Remove NetworkMonitor dependency on ICaptivePortal" 2019-02-15 08:09:29 +00:00
Remi NGUYEN VAN
eab0f54735 Remove NetworkMonitor dependency on ICaptivePortal
ICaptivePortal is used in the framework and cannot be used as a
dependency in NetworkMonitor, as the framework class takes precedence
when linking.
Also fix NetworkMonitorTest that was not verifying the right
startCaptivePortalApp call.

Test: atest FrameworksNetTests NetworkStackTests
Bug: 124033493
Change-Id: I8e7bb79e50650ae182a2e4277fb49abf5fb6d910
Merged-In: Ib6a89e54312628662b130fbeec18d11e139f09fa
2019-02-15 12:20:03 +09:00
Xin Li
4198f09aa7 Merge "DO NOT MERGE - Merge pi-platform-release (PPRL.190205.001) into stage-aosp-master" into stage-aosp-master 2019-02-14 22:11:32 +00:00
Xin Li
472cc5b849 DO NOT MERGE - Merge pi-platform-release (PPRL.190205.001) into
stage-aosp-master

Bug: 124234733
Change-Id: Ic4f67fde0835da0b1c363906cccef0d244e38393
2019-02-14 09:48:06 -08:00
Benedict Wong
bdfaa48ced Add Test Network and Transport types
This change adds new network types for testing purposes, signifying a
network with an extremely limited feature set.

Bug: 72950854
Test: Compiles, CTS tests relying on this work correctly.
Change-Id: I06cade6044afd12e0b69ed3c2f160f27f85d43d0
2019-02-11 12:57:43 -08:00
Remi NGUYEN VAN
9d0e114e66 Merge "Add API for NetworkStack to start captive portal" 2019-02-07 02:39:17 +00:00