Commit graph android_packages_modules_Co.../core/java/android
Message SHA1
Merge "Add @UnsupportedAppUsage annotations"
Andrei-Valentin Onea   authored and   Gerrit Code Review   commited 2019-03-06 17:18:05 +00:00
7e3ccaa77a
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 "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 "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
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
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
getConnectionOwnerUid: Clarify documentation
Test: build
Bug: 117573763
Change-Id: Ia899a541987b9c72a83287ed69fc47ab4d38f680

Jeff Vander Stoep   commited 2019-02-27 13:37:37 -08:00
440df92ff3
Fix broken javadoc links
Bug: 123683994
Test: Verify with javadoc
Change-Id: I4b1b936e3cf86104ace5fcb6829778710801f2d5

Chiachang Wang   commited 2019-02-27 17:18:40 +08:00
3b723c2ee8
Merge "Remove NetworkMonitor dependency on ICaptivePortal"
am: 399be8f9b9

Change-Id: Ia0d06e1aa931cdc1c6dd4008e804a6a44ae2304f

Remi NGUYEN VAN   authored and   android-build-merger   commited 2019-02-15 00:26:34 -08:00
48eaae51e3
Merge "Remove NetworkMonitor dependency on ICaptivePortal"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2019-02-15 08:09:29 +00:00
399be8f9b9
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

Remi NGUYEN VAN   commited 2019-02-15 12:20:03 +09:00
eab0f54735
Merge "DO NOT MERGE - Merge pi-platform-release (PPRL.190205.001) into stage-aosp-master" into stage-aosp-master
Xin Li   authored and   Android (Google) Code Review   commited 2019-02-14 22:11:32 +00:00
4198f09aa7
DO NOT MERGE - Merge pi-platform-release (PPRL.190205.001) into
stage-aosp-master

Bug: 124234733
Change-Id: Ic4f67fde0835da0b1c363906cccef0d244e38393

Xin Li   commited 2019-02-14 09:48:06 -08:00
472cc5b849
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

Benedict Wong   commited 2019-02-11 12:57:43 -08:00
bdfaa48ced
Merge "Add API for NetworkStack to start captive portal"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2019-02-07 02:39:17 +00:00
9d0e114e66
[KA04] Expose TCP socket keepalive API
The new set of API allows applications to request keepalives
offload for established TCP sockets over wifi.

However, the application must not write to or read from the
socket after calling this method, until specific callbacks are
called.

Bug: 114151147
Test: atest FrameworksNetTests FrameworksWifiTests NetworkStackTests

Change-Id: I3880505dbc35fefa34ef6c79555458ecf5d296a4

junyulai   authored and   Chalard Jean   commited 2019-02-06 22:51:42 +09:00
0835a1eaea
Merge "[KA03.5] Add stable AIDL parcelable for TcpKeepalivePacketData"
Chalard Jean   authored and   Gerrit Code Review   commited 2019-02-06 09:19:07 +00:00
6e55aca3fa
Merge "Deprecate getActiveLinkProperties."
Treehugger Robot   authored and   Gerrit Code Review   commited 2019-02-06 08:32:10 +00:00
39d46d221b
Add API for NetworkStack to start captive portal
Endpoints protected with INTERACT_ACROSS_USERS_FULL, such as
startActivityAsUser, should only be used by modules signed with the
platform cert. The NetworkStack needs to have the system server start
the application so this restriction can be applied.

Bug: 123846255
Test: flashed, captive portal works from primary and secondary user
Change-Id: Ib3e427b3fd03ced80c02985e795f79b096a2ec9a

Remi NGUYEN VAN   commited 2019-02-06 16:38:32 +09:00
94ff95bbcd
Deprecate getActiveLinkProperties.
There are other, more idiomatic ways to do this. Deprecating this
with usage limited to P will curb usage and reduce the maintenance
load.
This also deprecates the extra EXTRA_NETWORK_TYPE, which has
survived from an old world but has only been used in deprecated
broadcasts for some time.

Bug: 109783091
Test: eyeball current.txt
Change-Id: I87b74833bb4ec362ee3fd07511a66d318c29067d

Chalard Jean   commited 2019-02-06 15:44:44 +09:00
97021a1eeb
[KA03.5] Add stable AIDL parcelable for TcpKeepalivePacketData
Bug: 114151147
Test: atest FrameworksNetTests
Change-Id: I057dde79013b9eda5037b9a44f8eee06cc07352e

junyulai   authored and   Chalard Jean   commited 2019-02-06 14:07:39 +09:00
80d0356311
[KA03] Support tcp keepalive offload
When offload is starting, socket will be switched to repair
mode. Read and write on the socket will not be allowed until
repair mode is turned off. If remote packet arrives, repair
mode will be turned off automatically and a callback will
be raised to indicate that socket is ready to read from.

Bug: 114151147
Test: -atest FrameworksNetTests
      -manual

Change-Id: I0c335865912e183e7ad32a8ea12188f02ccde5fd

markchien   authored and   Chalard Jean   commited 2019-02-06 12:22:22 +09:00
e5591ce2fa
[KA02] internal cleanup and refactor for SocketKeepalive
In previous change, the new SocketKeepalive API was exported.
But internally, old PacketKeepalive names and structures are
still used.

This change rename them properly for code consistency and also
refactor KeepalivePacketData to support different types of
KeepalivePacketData.

Bug: 114151147
Test: 1. atest FrameworksNetTests
      2. atest FrameworksWifiTests
      3. atest FrameworksTelephonyTests

Change-Id: Ia9917d12987e91e87e34ffb3f126e7bc7c9c187e
Merged-In: Ia9917d12987e91e87e34ffb3f126e7bc7c9c187e

junyulai   authored and   Chalard Jean   commited 2019-02-05 20:13:47 +09:00
011b1f15c2
Merge changes from topic "bindprocess-resolv"
* changes:
  Allow use of bindProcessToNetwork only to change private DNS bypass.
  Allow bypassing private DNS via bindProcessToNetwork.

Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2019-01-31 07:52:04 +00:00
af8e41c434
Merge "Add get last entitlement value callback API"
Mark Chien   authored and   Gerrit Code Review   commited 2019-01-31 07:23:31 +00:00
029be80b79
Add get last entitlement value callback API
The callback would be used to notify entitlement value. If the
cache value indicates entitlement succeeded, it just fire
callback with cache value instead of run entitlement check.

Bug: 120887283
Test: atest FrameworksNetTests
Change-Id: I8afe928423bd75c54c61533a50a5c0814922ceb1

markchien   commited 2019-01-31 12:31:55 +08:00
0f45bb9d3d
Allow use of bindProcessToNetwork only to change private DNS bypass.
Currently it is not possible to change private DNS bypass by
doing:

  setProcessDefaultNetwork(network.getPrivateDnsBypassingCopy());
  setProcessDefaultNetwork(network);

because the code will ignore the change. Fix this by ensuring
that we always call bindProcessToNetwork (which does not have
side effects) and then only performing the expensive operations
(flushing DNS cache, upating socket pools) if the netId changed.

Bug: 112869080
Test: None
Change-Id: I5e8999cb11d8b8c1e9eb583fa8b3932f212accff

Lorenzo Colitti   commited 2019-01-31 13:08:24 +09:00
3c766ebc4d
Merge "Add SystemApi for captive portal metrics"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2019-01-30 22:24:12 +00:00
b591097458
Nuke old setAlwaysOnVpnPackageForUser method.
All callers have migrated to 4-argument one.

Test: builds
Bug: 77468593
Change-Id: I253515f6b0100b675505646339e5b82d373c9429

Pavel Grafov   commited 2019-01-30 19:56:36 +00:00
4ed5cbd750
Allow bypassing private DNS via bindProcessToNetwork.
Currently, bypassing private DNS requires calling the deprecated
setProcessDefaultNetworkForHostResolution. Allow apps to do this
via the non-deprecated binProcessForNetwork as well.

This has fewer backwards compatibility concerns than the
alternative approach of having setProcessDefaultNetwork call
setProcessDefaultNetworkForHostResolution. That approach would
have been problematic, for example, if an app did:

  cm.bindProcessToNetwork(network);
  ...
  cm.bindProcessToNetwork(null);

In this case, it would be difficult to know whether to clear the
resolver mapping as well: what if an app had also called
setProcessDefaultNetworkForHostResolution?

Similarly, it would be difficult to know what to do if an app did:

  cm.setProcessDefaultNetworkForHostResolution(network);
  cm.bindProcessToNetwork(null);

This approach does not have these concerns, and has no effect
on apps that don't call Network.getPrivateDnsBypassingCopy, which
regular apps don't have permission to use. It also provides a
path to deprecate setProcessDefaultNetworkForHostResolution.

Bug: 112869080
Test: atest android.net.cts.ConnectivityManagerTest android.net.cts.MultinetworkApiTest
Change-Id: I4158a37b6ed87a9a9b2677c526dcfee8af48e483

Lorenzo Colitti   commited 2019-01-31 00:55:47 +09:00
3a1cb9d615
Add SystemApi for captive portal metrics
The metrics go through NetworkMonitor in the NetworkStack so that they
can be upgraded to new metrics in the future.

Test: flashed, captive portal login works, metrics shown in events log
Bug: 112869080
Merged-In: I4bccfbd87bae5b2d65e45c7a5918aa45ab5d76e8
Change-Id: Ib5e2126788f8d56a00a56d7efcd33c5f9a37a6de

Remi NGUYEN VAN   commited 2019-01-30 22:54:27 +09:00
fb43a914d3
Remove last NetworkStack usage of hidden APIs
Includes various small changes to stop using hidden APIs

Test: make NetworkStack
Test: flashed, booted, WiFi and tethering working
Bug: 112869080
Change-Id: Id2830795a444f484b377ed6437435a1cd833697a

Remi NGUYEN VAN   commited 2019-01-30 10:23:24 +09:00
6e82be4e4a
Add NetworkUtils utilities to SystemApi
attach*Filter and addArpEntry are necessary for the NetworkStack but are
only usable for apps that have system permissions.
Also includes system API for IpPrefix, LinkAddress, LinkProperties,
Network, and static modifier in ApfCapabilities that were missed in
previous CLs.

Test: Builds, flashed, WiFi works
Bug: 112869080
Change-Id: If141ae6a2f9145f5af64ba002ca44938f39b90a9

Remi NGUYEN VAN   commited 2019-01-29 17:30:26 +09:00
c7fe99fdbe
Merge "Add SocketUtils for NetworkStack"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2019-01-28 23:14:08 +00:00
37053eb78e
Merge "Whitelist packages from VPN lockdown."
Pavel Grafov   authored and   Gerrit Code Review   commited 2019-01-28 20:15:49 +00:00
76e3e0052c
Add SocketUtils for NetworkStack
These utilities can only be used for privileged apps. The underlying
implementation cannot be @SystemApi.

Test: m
Bug: 112869080
Change-Id: Idfa90561102e5b03ab2b79486d3ad46457128bf8

Remi NGUYEN VAN   commited 2019-01-28 20:11:27 +09:00
a628730d0a
Merge "Move NetworkUtils used by NetworkStack"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2019-01-28 09:06:20 +00:00
8f8deae60f
Move NetworkUtils used by NetworkStack
Depending on usage move into NetworkStackUtils or shared
Inet4AddressUtils.

Test: atest FrameworksNetTests NetworkStackTests
Bug: 112869080
Merged-In: Ie20dcee375b377236004a7689890729493aca857
Change-Id: Ib8d000529872796022706a35050fdc2c7141f2ab

Remi NGUYEN VAN   commited 2019-01-28 13:45:17 +09:00
e167e117c1
Add NetworkStack networking deps to SystemApi
Cherry-pick with conflicts fixed in CaptivePortalLoginActivity imports.
Test: atest FrameworksNetTests
Bug: 112869080
Merged-In: Id59dc06fb85e4ac88098f56b621ec880610759ce
Change-Id: I3c05e8fdd70497426d4fa433295c4fbdad07d9c9

Remi NGUYEN VAN   commited 2019-01-28 13:28:35 +09:00
8bd18cff9a
Whitelist packages from VPN lockdown.
Bug: 77468593
Test: atest com.android.server.connectivity.VpnTest
Change-Id: I9119c139ab07a761ce5dfd1365b70eb905fd32dc

Pavel Grafov   commited 2019-01-25 19:59:03 +00:00
3aeb3f3455
Merge "Revert "Whitelist packages from VPN lockdown.""
Dan Albert   authored and   Gerrit Code Review   commited 2019-01-24 21:08:46 +00:00
7e81ae73b4
Revert "Whitelist packages from VPN lockdown."
This reverts commit f1a610a1c2.

Reason for revert: broke pi-dev-plus-aosp

Change-Id: Iaf5c8aa4a8720eb2852da8cd91c81a77ccb92b68

Dan Albert   commited 2019-01-24 21:05:39 +00:00
45f1a24661
Merge "Add API for proxy configuration over VPN."
Treehugger Robot   authored and   Gerrit Code Review   commited 2019-01-24 17:52:22 +00:00
b11e29d4b3
Merge "Whitelist packages from VPN lockdown."
Pavel Grafov   authored and   Gerrit Code Review   commited 2019-01-24 17:34:55 +00:00
bec7854508
Whitelist packages from VPN lockdown.
Bug: 77468593
Test: atest com.android.server.connectivity.VpnTest
Test: atest MixedDeviceOwnerTest#testAlwaysOnVpn
Test: MixedDeviceOwnerTest#testAlwaysOnVpnAcrossReboot
Change-Id: I7f6c5b9172063b588feacd6b9930a6cb88f764ab
Merged-In: I7f6c5b9172063b588feacd6b9930a6cb88f764ab

Pavel Grafov   commited 2019-01-24 16:17:11 +00:00
f1a610a1c2
Add API for proxy configuration over VPN.
Test: runtest -x
frameworks/base/tests/net/java/com/android/server/ConnectivityServiceTest.java
&& atest HostsideVpnTests
Bug: 76001058
Change-Id: Id4dde4a4103fd93bfbbacc52d0e5ade56ae67a6a
Merged-In: Id4dde4a4103fd93bfbbacc52d0e5ade56ae67a6a

Irina Dumitrescu   commited 2019-01-24 16:07:20 +00:00
de132bb6d6
Merge "Add additional SystemApi for NetworkStack"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2019-01-24 09:55:01 +00:00
24f1f0be3c