Commit Graph

1664 Commits

Author SHA1 Message Date
Luke Huang
31f19f7af7 Merge "Minor change for async DNS API" am: 80be1b1127 am: e0b323df1b
am: 2f0336caa9

Change-Id: Iebc2946e5705cfda16f44cb468804c2be385c02a
2019-03-29 12:03:25 -07:00
Lorenzo Colitti
6180380e75 Merge "Unremove DnsResolver#query method used by external developers" am: 3dd6df002b am: f674528970
am: 22f7e75f67

Change-Id: Ibfba10cb92e63a7ae727f48543da040aa5f39116
2019-03-29 08:38:15 -07:00
Luke Huang
293ffaa081 Minor change for async DNS API
do the minor changes to address comments before

Bug: 129395490
Test: atest DnsResolverTest
Change-Id: I56e2e5bc4352ff5c979579247a333a41950079da
2019-03-29 18:12:26 +08:00
Luke Huang
fb5afabcb8 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
2019-03-29 18:12:26 +08:00
Luke Huang
19dcd80972 Merge "Fix cancellation race problem for aysnc DNS API" am: de6217b8e2 am: 829e409827
am: ae338a8030

Change-Id: I4e10bfaa43a63cedd9fbddfc6f8bf8853c426eba
2019-03-28 21:18:41 -07:00
Luke Huang
e17bb2dff4 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
2019-03-28 19:46:56 +08:00
Junyu Lai
bf7917290e Merge changes I0baf582f,I4bba01ba am: 6d7c97dc5c am: a0540419f9
am: 7fd6b91b04

Change-Id: I2cc021899270b41e4b9047ef32869af53ea6fb65
2019-03-27 18:43:18 -07:00
junyulai
828dad188c 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
2019-03-27 19:51:08 +08:00
Remi NGUYEN VAN
e289064a7b Merge "Add nullability annotations" am: 539821c978 am: 97350573b9
am: c66eb1e12e

Change-Id: I43088399da1d81556ab903ef1ca716439129f00d
2019-03-25 06:56:43 -07:00
Treehugger Robot
539821c978 Merge "Add nullability annotations" 2019-03-25 13:19:19 +00:00
Junyu Lai
40ad433f92 Merge "Fix SocketKeepalive APIs which do not meet API review requirement" am: 66bc22760a am: 7246f1a563
am: 0f69af35db

Change-Id: I873a82de90efce6f3baa17761c0576dc9c8210be
2019-03-25 04:16:18 -07:00
Junyu Lai
66bc22760a Merge "Fix SocketKeepalive APIs which do not meet API review requirement" 2019-03-25 10:42:37 +00:00
junyulai
7e06ad4ce9 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
2019-03-25 15:56:35 +08:00
Remi NGUYEN VAN
be381ab943 Add nullability annotations
Add nullability annotations on the following methods:
 - StaticIpConfiguration#getRoutes
 - ValidationProbeEvent#getProbeName

Test: m
Bug: 128935825
Change-Id: I1c17d200f3125e684c4e4d67b2f7f079eda310b6
2019-03-25 16:46:34 +09:00
Remi NGUYEN VAN
fa062e4857 Merge "Separate NetworkMonitor/framework portal URL" am: 8ab472e77a am: afa7a43b17
am: 0fabd5dca2

Change-Id: I85e744d94d96ecf9ac558e62016418d8199bb98c
2019-03-24 20:23:39 -07:00
Remi NGUYEN VAN
8ab472e77a Merge "Separate NetworkMonitor/framework portal URL" 2019-03-25 02:50:37 +00:00
Treehugger Robot
8f4c739827 Merge "Fix API in CaptivePortal and ConnectivityManager" 2019-03-25 02:37:28 +00:00
Remi NGUYEN VAN
1fb7cabbfc 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
2019-03-25 01:43:48 +00:00
Lorenzo Colitti
0eabf54862 Merge "Fix API in CaptivePortal and ConnectivityManager" 2019-03-22 11:46:21 +00:00
Luke Huang
63c28c2c1c Merge "Support query cancellation for async DNS API" am: 6aea92f594 am: 697b5a4aab
am: 7bc21f13af

Change-Id: I034361541f64c10d72474beaefdb3547c9c2733e
2019-03-22 03:35:57 -07:00
Remi NGUYEN VAN
d6d5505edf 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

Test: flashed, WiFi and captive portal works
Bug: 128935314
Bug: 128935673
(clean cherry-pick of AOSP I7395d4a4db6a64398a827692aee1956c011873e5)

Change-Id: I09545c00af3519dbf141dd5951b28f49e37b3e80
2019-03-22 17:16:52 +09:00
Remi NGUYEN VAN
035f65367b 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
2019-03-22 15:11:14 +09:00
Luke Huang
6aea92f594 Merge "Support query cancellation for async DNS API" 2019-03-22 03:26:21 +00:00
Paul Hu
2e2bc9c173 Merge "Fix Automated API Review issues." am: acb5eca325 am: f1f3b08982
am: affa3f497d

Change-Id: Iba1630161579571d4975aba9bbd5c767f82c8a98
2019-03-21 11:54:51 -07:00
Paul Hu
acb5eca325 Merge "Fix Automated API Review issues." 2019-03-21 17:19:26 +00:00
Paul Hu
d387c2abc8 Merge "Fix Automated API Review issues." am: a793b48cf0 am: 9a9dac2b98
am: d29d268abe

Change-Id: I1968eb36c2f4fafd33846ec0f91710c665d936e6
2019-03-21 07:49:37 -07:00
paulhu
3806853f94 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
2019-03-21 15:16:58 +08:00
paulhu
cbbc3db924 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
2019-03-21 13:55:37 +08:00
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
6ea60d7016 Merge "Add documentation for CaptivePortal APP_RETURN_*" am: 3886def4fa am: c168c30849
am: befedce6dd

Change-Id: I2fce43bf23ac9689f69bc2c432b3032cc9abb7d9
2019-03-19 23:13:15 -07:00
Remi NGUYEN VAN
3886def4fa Merge "Add documentation for CaptivePortal APP_RETURN_*" 2019-03-20 05:40:41 +00:00
Remi NGUYEN VAN
b71b242e7e Merge "Add Parcelable implementation for ApfCapabilities" am: d64b329979 am: 57b7aa8ec2
am: 84890d80e0

Change-Id: I4d878b8dc0928aca47f944050becaa4d5206e336
2019-03-19 18:09:23 -07: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
Lorenzo Colitti
47002ed0d1 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
2019-03-20 00:49:33 +09:00
Lorenzo Colitti
86b51bb8a4 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
2019-03-20 00:49:32 +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
9c21fcd7f6 Merge "Replace Handler with Executor for async DNS API" am: 21be4d297c am: 699127bae2
am: cadce1355b

Change-Id: Ia2305094fe66017fbdfdc18b2c7284452ac90036
2019-03-18 23:40:49 -07:00
Luke Huang
bcee2f4588 Merge "Refactor answer callback for async DNS query JAVA API" am: 2b474c454f am: 5f80d53df8
am: d54dc33070

Change-Id: Id4d0ae87b1ac8618c28da666619c5c5b5bd2d722
2019-03-18 23:24:06 -07: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
cb9503a379 Merge "Remove deprecated entitlement API" am: 2adc944732 am: 74b3b60b76
am: 3baef16087

Change-Id: I6bb5611de8d45e9a5c17128ea38ba1bdd8f86ac2
2019-03-18 20:38:36 -07: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
Junyu Lai
9a4fe7fb2b Merge "[KA02.5] Use binder thread and executor to invoke callback" am: f9ae70a41c am: c93f9c7f0e
am: 06ea4015bf

Change-Id: I881c1ab09187ab23facc03bb71cc38a7978e442c
2019-03-15 01:19:55 -07:00