Commit graph android_packages_modules_Co.../core
Message SHA1
Merge "Fix ApfCapabilities, LinkAddress, RouteInfo, IpPrefix API issues."
Paul Hu   authored and   Gerrit Code Review   commited 2019-04-01 07:20:53 +00:00
1f041d1443
Fix ApfCapabilities, LinkAddress, RouteInfo, IpPrefix API issues.
Fix: 129362082
Fix: 129361362
Fix: 129360330
Fix: 129362379
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: I05fbc6f98207d5cf002e3cbc5829040af7d6be52

paulhu   commited 2019-04-01 10:23:51 +08:00
895a741bf1
Minor change for async DNS API
do the minor changes to address comments before

Bug: 129395490
Test: atest DnsResolverTest
Change-Id: I56e2e5bc4352ff5c979579247a333a41950079da

Luke Huang   commited 2019-03-29 18:12:26 +08:00
293ffaa081
Unremove DnsResolver#query method used by external developers
This method was removed as part of addressing API council feedback in b/129261432
Add back previous DnsResolver#query which is already being used by developers.

Bug: 129395490
Test: atest DnsResolverTest

Change-Id: Ic956db204f3940d39d42e1b11dda39e57d356fad

Luke Huang   commited 2019-03-29 18:12:26 +08:00
fb5afabcb8
Fix cancellation race problem for aysnc DNS API
This problem might cause double-close fd and result in app crash
or unexpected behaviour

Bug: 129317069
Test: atest DnsResolverTest
      manual test with delaying response callback/cancel
Change-Id: I223234f527edafc51d34fa6be390419c05def8d8

Luke Huang   commited 2019-03-28 19:46:56 +08:00
e17bb2dff4
Block unpriviledged apps which create keepalives with null fd
Currently, socketKeepalive implementation is accepting null fd
due to backward compatibility with legacy packet keepalive API.
However, due to lack of the fd, the service cannot guarantee the
port is not reused by another app if the caller release the port
for any reason.

Thus, grant the null fd access only for priviledged apps.

This commit also address some comments from aosp/918533.

Bug: 126699232
Test: atest FrameworksNetTests
Change-Id: I0baf582ff4ca8af6082c3754e8dfbcd867f39792

junyulai   commited 2019-03-27 19:51:08 +08:00
828dad188c
Merge "Add nullability annotations"
Treehugger Robot   authored and   Gerrit Code Review   commited 2019-03-25 13:19:19 +00:00
539821c978
Merge "Fix SocketKeepalive APIs which do not meet API review requirement"
Junyu Lai   authored and   Gerrit Code Review   commited 2019-03-25 10:42:37 +00:00
66bc22760a
Fix SocketKeepalive APIs which do not meet API review requirement
Per API review, change the use of FileDescriptor to
ParcelFileDescriptor.
This change also fix nullability according to API review
feedbacks.

Fix: 126698610
Fix: 126699425
Fix: 126699232
Fix: 126700278

Test: 1. m -j
      2. atest FrameworksNetTests --generate-new-metrics 50
      3. m -j doc-comment-check-docs
Change-Id: I19476c50dd1ca290bf3f41973829da2bd229796a

junyulai   commited 2019-03-25 15:56:35 +08:00
7e06ad4ce9
Add nullability annotations
Add nullability annotations on the following methods:
 - StaticIpConfiguration#getRoutes
 - ValidationProbeEvent#getProbeName

Test: m
Bug: 128935825
Change-Id: I1c17d200f3125e684c4e4d67b2f7f079eda310b6

Remi NGUYEN VAN   commited 2019-03-25 16:46:34 +09:00
be381ab943
Merge "Separate NetworkMonitor/framework portal URL"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2019-03-25 02:50:37 +00:00
8ab472e77a
Merge "Fix API in CaptivePortal and ConnectivityManager"
Treehugger Robot   authored and   Gerrit Code Review   commited 2019-03-25 02:37:28 +00:00
8f4c739827
Fix API in CaptivePortal and ConnectivityManager
- Remove CaptivePortal constructor from SystemApi. This constructor was
   added in Q timeframe and ends up being unnecessary since
   CaptivePortal creation was refactored to ConnectivityService because
   of visibility issues on ICaptivePortal.
 - Rename getAvoidBadWifi to shouldAvoidBadWifi
 - Add permission annotation for shouldAvoidBadWifi

(already merged in internal as:
I09545c00af3519dbf141dd5951b28f49e37b3e80)

Test: flashed, WiFi and captive portal works
Bug: 128935314
Bug: 128935673
Merged-In: I09545c00af3519dbf141dd5951b28f49e37b3e80
Change-Id: I7395d4a4db6a64398a827692aee1956c011873e5

Remi NGUYEN VAN   commited 2019-03-25 01:43:48 +00:00
1fb7cabbfc
Separate NetworkMonitor/framework portal URL
The framework cannot return URLs used by the updatable NetworkStack,
which may use configurable URLs, changing URLs, or mechanisms not
involving URLs to detect captive portals. NetworkMonitor has already
been using random fallback URLs for a while that do not match the value
returned by ConnectivityManager#getCaptivePortalServerUrl.

With this change, the default value returned by the framework is
configured in framework resources as
config_networkDefaultCaptivePortalServerUrl. NetworkMonitor behavior may
change as it is an updatable component, but the current URL is
configured in NetworkMonitor resources as
config_captive_portal_http_url.

Test: flashed, booted, WiFi and captive portal working
Test: ConnectivityManager#getCaptivePortalServerUrl returns correct
      value.
Bug: 127908503
Change-Id: I371dedc5b22efa909d7fd58e1ebe9b8aaced9780

Remi NGUYEN VAN   commited 2019-03-22 15:11:14 +09:00
035f65367b
Merge "Support query cancellation for async DNS API"
Luke Huang   authored and   Gerrit Code Review   commited 2019-03-22 03:26:21 +00:00
6aea92f594
Merge "Fix Automated API Review issues."
Paul Hu   authored and   Gerrit Code Review   commited 2019-03-21 17:19:26 +00:00
acb5eca325
Fix Automated API Review issues.
These API's argument/return value must be marked either @NonNull
or @Nullable.

Bug: 126701148
Bug: 126699090
Bug: 126701058
Bug: 126700772
Bug: 126699941
Bug: 126701299
Bug: 126700007
Bug: 126700900
Test: atest FrameworksNetTests
Change-Id: Id030a9f1116178b96aa3d4614b10969a537b2fc4

paulhu   commited 2019-03-21 15:16:58 +08:00
3806853f94
Fix Automated API Review issues.
1. Some API's argument/return value must be marked either
@NonNull or @Nullable.
2. Change some system APIs to public APIs.
3. Modify the method name

Bug: 126700123
Bug: 126702339
Bug: 126699682
Bug: 118296575
Bug: 126699216
Bug: 126699675
Bug: 126699429
Bug: 126699193
Bug: 123586045
Test: atest FrameworksNetTests
Change-Id: Iaa2832cdcf83758ed0fec81b954a0c63bc5a7bf6

paulhu   commited 2019-03-21 13:55:37 +08:00
cbbc3db924
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.

Lorenzo Colitti   authored and   Gerrit Code Review   commited 2019-03-20 09:45:37 +00:00
6505a76d78
Merge "Add documentation for CaptivePortal APP_RETURN_*"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2019-03-20 05:40:41 +00:00
3886def4fa
Merge "Add Parcelable implementation for ApfCapabilities"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2019-03-20 00:34:53 +00:00
d64b329979
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

Lorenzo Colitti   commited 2019-03-20 08:56:31 +09:00
82f2a72d01
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

Lorenzo Colitti   commited 2019-03-20 08:56:24 +09:00
15c035c790
Add documentation for CaptivePortal APP_RETURN_*
This fixes API review requests.

Test: atest FrameworksNetTests NetworkStackTests
Bug: 126883311
Change-Id: I0632a98675e65c5e722e81a2c1e0cf1403b54395

Remi NGUYEN VAN   commited 2019-03-19 18:57:44 +09:00
18017cb6d1
Merge "Replace Handler with Executor for async DNS API"
Luke Huang   authored and   Gerrit Code Review   commited 2019-03-19 05:35:39 +00:00
21be4d297c
Merge "Refactor answer callback for async DNS query JAVA API"
Luke Huang   authored and   Gerrit Code Review   commited 2019-03-19 05:35:18 +00:00
2b474c454f
Merge "Remove deprecated entitlement API"
Mark Chien   authored and   Gerrit Code Review   commited 2019-03-19 02:44:37 +00:00
2adc944732
Support query cancellation for async DNS API
Bug: 124882626
Test: built, flashed, booted
      atest DnsResolverTest DnsPacketTest

Change-Id: Iaa72f5c17f58cf0a58663b892bb18cfdf23cd545

Luke Huang   commited 2019-03-16 18:53:09 +08:00
b1cf5aaf06
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 "Integrate testNetworkService and Manager with Connectivity stack"
Benedict Wong   authored and   Gerrit Code Review   commited 2019-03-15 17:41:02 +00:00
546bcbb218
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

markchien   authored and   Mark Chien   commited 2019-03-15 09:03:50 +00:00
92344ef44f
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

Remi NGUYEN VAN   commited 2019-03-15 13:41:59 +09:00
df04297b86
[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
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
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
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
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
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
Merge "Add @UnsupportedAppUsage annotations"
Andrei-Valentin Onea   authored and   Gerrit Code Review   commited 2019-03-06 17:18:05 +00:00
7e3ccaa77a