Commit graph android_packages_modules_Co.../core/java
Message SHA1
Add NetworkCapabilities#getSSID to SystemApi
setSSID was added to the API, so it makes sense to have getSSID be part
of the API as well.

Test: m
Bug: 139268426
Change-Id: I6fa9c513ce4fb8ce1e3530776ce8fd5b2e77055e

Remi NGUYEN VAN   commited 2020-01-22 22:52:53 +09:00
ca455afb4d
Have registerNetworkAgent return a Network.
This is more useful.

Bug: 135998869
Test: FrameworkNetTests FrameworksWifiTests
Change-Id: I74710b396fa3cec6fbae08d3dcab5bc90dc2e669
Merged-In: I74710b396fa3cec6fbae08d3dcab5bc90dc2e669

Chalard Jean   authored and   Chiachang Wang   commited 2020-01-20 16:22:06 +08:00
f78c964538
Merge "Replace StringNetworkSpecifier & subId with TelephonyNetworkSpecifer"
Rambo Wang   authored and   Gerrit Code Review   commited 2020-01-15 17:45:58 +00:00
b2ff467a3a
Merge "Expose ConnectivityManager#TYPE_WIFI_P2P as SystemApi"
Treehugger Robot   authored and   Gerrit Code Review   commited 2020-01-15 11:42:11 +00:00
7916449753
Expose ConnectivityManager#TYPE_WIFI_P2P as SystemApi
Support wifi mainline module usage.

Bug: 135998869
Test: Build and make system-api-stubs-docs-update-current-api
      atest FrameworksNetTests

Change-Id: I77cb45e6b2aaf4ab2c457cb59ccf77b1b8c01fa9

paulhu   commited 2020-01-15 15:38:23 +08:00
e102b0bb49
Merge "Unhide NetworkRequest API which use legacy type"
Mark Chien   authored and   Gerrit Code Review   commited 2020-01-15 06:49:33 +00:00
a64019915e
Merge "Expose SocketKeepalive#SUCCESS as SystemApi"
Treehugger Robot   authored and   Gerrit Code Review   commited 2020-01-15 05:01:04 +00:00
4ed1963c4a
Expose SocketKeepalive#SUCCESS as SystemApi
Support wifi mainline module usage.

Bug: 135998869
Test: Build and make system-api-stubs-docs-update-current-api
      atest FrameworksNetTests
Change-Id: I94171b2dc4f26442df918547bf8bc40953f63f2e
Merged-In: I94171b2dc4f26442df918547bf8bc40953f63f2e

paulhu   authored and   Paul Hu   commited 2020-01-15 02:45:43 +00:00
2f7c345d56
Replace StringNetworkSpecifier & subId with TelephonyNetworkSpecifer
StringNetworkSpecifier is widely used to specify subscription id for
the NetworkRequest. The raw string field introduce ambiguity and leave
large space for bugs. With TelephonyNetworkSpecifer, we are able to
settle down the type and value of the fields (although currently only
one) and introduce validation to detect the bug in the beginning.

Bug: 145993724
Test: atest FrameworksNetTests FrameworksTelephonyTests &
      make offline-sdk-docs
Change-Id: Iefbad9b1deb3de2c0b262d9ce5ae0704a50d08a6

Rambo Wang   commited 2020-01-14 10:51:11 -08:00
582ba554de
Merge "Make NattKeepalivePacketData @SystemApi"
Aaron Huang   authored and   Gerrit Code Review   commited 2020-01-14 14:36:09 +00:00
9fef5a5cf0
Merge "Expose ConnectivityManager#TYPE_NONE as SystemApi"
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2020-01-14 05:30:14 +00:00
baf25cde90
Unhide NetworkRequest API which use legacy type
Bug: 144753389
Test: -build, flash, boot
      -atest TetheringTests

Change-Id: I349da06769e9ffcee6bb42f51ab454e0ef774fb3
Merged-In: I349da06769e9ffcee6bb42f51ab454e0ef774fb3

markchien   authored and   Mark Chien   commited 2020-01-14 04:56:54 +00:00
d6eeffd079
Expose ConnectivityManager#TYPE_NONE as SystemApi
Support wifi mainline module usage.

Bug: 135998869
Test: Build and make system-api-stubs-docs-update-current-api
      atest FrameworksNetTests
Change-Id: Ia496aaeaf74fa44764640fd2b97c417509e040aa

paulhu   commited 2020-01-14 10:02:30 +08:00
74357e70a8
Merge "Support reevaluation request from captive portal app"
Chiachang Wang   authored and   Gerrit Code Review   commited 2020-01-14 01:42:22 +00:00
254c3d830e
Make NattKeepalivePacketData @SystemApi
Bug: 139268426
Bug: 135998869
Test: atest FrameworksNetTests

Change-Id: I687f1a8a4b82cb7e4a0dfeb24f0b23a4de6d5287

Aaron Huang   commited 2020-01-14 01:45:28 +08:00
aead9c64fa
Support reevaluation request from captive portal app
CaptivePortalLogin use similar way to validate the network as
NetworkMonitor. Provide API to reuse NetworkMonitor facilities
for consistent captive portal detection.

Bug: 134892996
Test: atest FrameworksNetTests NetworkStackTests NetworkStackNextTests
Test: manually test with captive portal Wi-Fi
Test: make system-api-stubs-docs-update-current-api \
      test-api-stubs-docs-update-current-api
Change-Id: I6f039eae7ceb18eb6c3cf15587cdc27a7fe35b00

Chiachang Wang   commited 2020-01-13 14:28:02 +08:00
938bfba0c3
Stop using NetworkFactory in connectivity code.
Bug: 138306002
Test: builds, boots
Test: atest FrameworksNetTests
Change-Id: I6b9979f343108c0c077abd86ae1c21e5ece0cccc

Lorenzo Colitti   commited 2020-01-12 17:40:02 +09:00
a86fae785a
Merge "Add NetworkCapabilities#deduceRestrictedCapability"
Treehugger Robot   authored and   Gerrit Code Review   commited 2020-01-10 09:27:31 +00:00
0e82d1c50d
Merge "Expose DhcpInfo parcelable interface implementation methods"
Aaron Huang   authored and   Gerrit Code Review   commited 2020-01-10 08:05:24 +00:00
617e9bd709
Merge "Add keepalive related methods and fields to system APIs"
Aaron Huang   authored and   Gerrit Code Review   commited 2020-01-10 06:16:04 +00:00
434bc5adf4
Merge "Add a NetworkProvider class to the SDK."
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2020-01-09 15:09:58 +00:00
3bd0d010bb
Expose DhcpInfo parcelable interface implementation methods
Parcelable class requires a CREATOR field be exposed.

Bug: 139268426
Bug: 135998869
Test: atest FrameworksNetTests
      atest android.net.cts

Change-Id: I41c68406d09014dda99f337add8c0db0298b0582

Aaron Huang   commited 2020-01-09 21:33:22 +08:00
cf22d1a29f
Add a NetworkProvider class to the SDK.
Bug: 138306002
Test: builds, boots, wifi and telephony work
Test: tested by upcoming change that uses this in NetworkFactory
Change-Id: I2f61bf323215b7c6feff8acc92e7434346751773

Lorenzo Colitti   commited 2020-01-09 19:50:26 +09:00
6702d4b5b2
Add NetworkCapabilities#deduceRestrictedCapability
Support telephony mainline module usage.

Bug: 138306002
Test: atest FrameworksNetTests
      atest CtsNetTestCases --instant

Change-Id: Idbd9c547eff7227085c753461b901c7cdbe396fb

paulhu   commited 2020-01-09 17:59:46 +08:00
9c7a0fa46a
Merge "Replace ConnectivityManager constants to TetheringManager"
Mark Chien   authored and   Gerrit Code Review   commited 2020-01-09 06:32:04 +00:00
8124da436a
Expose clearCapabilities for mainline module
Support telephony mainline module usage.

Bug: 138306002
Test: Build and make api-stubs-docs-update-current-api
Change-Id: I6260695b01ec06244d2822f9438a7fae83539ff2
Merged-In: I0a462da4e87cae2c7d4a9b9a92de061a086c5752

Chiachang Wang   commited 2020-01-09 10:25:03 +08:00
c2441ee239
Merge "Add API surface for ConnectivityDiagnostics API."
Cody Kesting   authored and   Gerrit Code Review   commited 2020-01-08 21:53:14 +00:00
33bb594563
Replace ConnectivityManager constants to TetheringManager
Replace some ConnectivityManager constants as TetheringManager inside
tethering module. No API change, will have follow up CL to delete
@hide tethering constants in ConnectivityManager and replace caller
to using TetheringManager.

Bug: 144753389
Test: build
Change-Id: Ia1b963669722c32d147375763205ed2f3af52fed

markchien   authored and   Mark Chien   commited 2020-01-08 15:06:09 +00:00
a0f8fd92fd
Use new UnsupportedAppUsage annotation.
Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library.

Bug: 145132366
Test: m && diff unsupportedappusage_index.csv
Change-Id: I0c336de56bc4a041dc97ff9b7927f62f0b44b457
Merged-In: I0c336de56bc4a041dc97ff9b7927f62f0b44b457

Artur Satayev   commited 2020-01-08 14:04:40 +00:00
9c2add6fcc
Merge "Change tetheroffloadjni to tetheringutilsjni"
Treehugger Robot   authored and   Gerrit Code Review   commited 2020-01-07 09:05:43 +00:00
0af9d37eca
Change tetheroffloadjni to tetheringutilsjni
Rename tetheroffloadjni to tetheringutilsjni and move setupRaSocket
jni method from NetUtils into tetheringutilsjni.

Bug: 143195885
Test: -build, flash, boot
      -atest TetheringTests
      -Off/On hotspot with ipv6 upstream

Change-Id: Ib68eb6999bbe2d3ca97e68712f22b105311ef800

markchien   authored and   Mark Chien   commited 2020-01-07 07:42:13 +00:00
d53edf736f
Make LinkPropertiesTest pass, and fix an NPE.
aosp/973686 added the DHCP server address to LinkProperties, but
it did not have any tests, and would throw NPE when parceling a
LinkProperties that did not have a DHCP server.

Add tests and fix the bug.

Bug: 134098566
Test: unit test now passes
Change-Id: If28f0be650963e8d9af7eb53f6940824582a2db3

Lorenzo Colitti   commited 2020-01-07 13:02:32 +09:00
279a1d6620
Add the DHCP server address to LinkProperties.
Bug: 134098566
Test: see subsequent CL in topic
Change-Id: If0f80067934189137c87cd379e7ae47b187562fd

ruibin zhang   authored and   Lorenzo Colitti   commited 2020-01-07 01:21:07 +09:00
ca75bc897d
Add API surface for ConnectivityDiagnostics API.
ConnectivityDiagnostics API will be used to provide callbacks to
permissioned applications for notifications on network connectivity
events.

Bug: 143187964
Test: compiles
Change-Id: Ib3c0b93f534a9c540e577891aa8aa0a2ad6de71f

Cody Kesting   commited 2020-01-02 10:51:17 -08:00
457a1ad289
Expose NetworkCapabilities methods to system/public APIs
Add methods to system/public APIs for mainline support.

Bug: 139268426
Bug: 135998869
Bug: 138306002
Test: atest FrameworksNetTests
      atest NetworkStackTests
      ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh
      atest FrameworksTelephonyTests
      atest android.net.cts
      atest android.net.wifi.cts
      atest android.telephony.cts

Change-Id: I6ec333309172edaf5aa976f83cfbe63512043594

Aaron Huang   commited 2019-12-27 08:31:06 +00:00
e435d2aeb1
[Tether13] Move TetheringManager into framework
Move tethering out of ConnectivityService. All client would
use TetheringManager to talk with TetheringService directly.

Bug: 144320246
Test: -build, flash, boot
      -atest TetheringTests

Change-Id: Ib051bea724a256f9c4572b566e46ae7b9c4abe6e
Merged-In: Ib051bea724a256f9c4572b566e46ae7b9c4abe6e

markchien   commited 2019-12-19 20:53:06 +08:00
5776f96096
Merge "Add LinkProperties methods to system APIs"
Aaron Huang   authored and   Gerrit Code Review   commited 2019-12-19 08:01:58 +00:00
5966c91e94
Merge "Fix parceling of LinkProperties Inet6Addr"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2019-12-19 03:07:43 +00:00
98460b6863
Fix parceling of LinkProperties Inet6Addr
IPv6 addresses parceled for DNS servers, private DNS servers, PCSCF
servers were parceled without the scope. This causes issues with
link-local DNS servers.

Test: atest FrameworksNetTests
Bug: 145181158
Change-Id: I0ed24e51d4d0656f4a1f932b5e9f646b35b4b971

Remi NGUYEN VAN   commited 2019-12-18 19:52:30 +09:00
3a59a925e0
Add keepalive related methods and fields to system APIs
Add KeepalivePacketData to system API for mainline support.
Also, remove InvalidPacketException class from SocketKeepalive
and create a new InvalidPacketException class in android.net

Bug: 139268426
Bug: 135998869
Bug: 138306002
Test: atest FrameworksNetTests
      atest NetworkStackTests
      atest FrameworksTelephonyTests
      ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh
      atest android.net.cts
      atest android.net.wifi.cts
      atest android.telephony.cts

Change-Id: I2d982e8abb5cb6b4c74a20483550b18cf814320d
Merged-In: I2d982e8abb5cb6b4c74a20483550b18cf814320d

Aaron Huang   commited 2019-12-17 16:21:19 +00:00
441e499861
Make getNetworkSpecifier() public API.
The builder lets clients set it, and this may be useful for
unit tests of apps. It should be public.
The need arises from uses of this in WiFi and Telephony
network factories.

Test: build
Bug: 135998869
Change-Id: I57279cac139c28e8654d2066ba0c60edd1e6cd98

Chalard Jean   commited 2019-12-12 13:10:55 +09:00
294ebbbad8
Merge "Expose netId to SystemApi"
Treehugger Robot   authored and   Gerrit Code Review   commited 2019-12-05 02:29:41 +00:00
ed2644bf65
Expose netId to SystemApi
Tethering will be build as unblundled APP. It can't use @hide
API anymore. Expose netId for tethering because it need to set
proxy dns server with netId.

Bug: 144758139
Test: build
Change-Id: Ifefa791940874617bb479f5c23488d14be87f45e

markchien   commited 2019-12-04 14:33:51 +08:00
d2751e09d2
Replace the permission of internal connectivity checks
A number of connectivity checks that protect system-only methods
check for CONNECTIVITY_INTERNAL, but CONNECTIVITY_INTERNAL is a
signature|privileged permission. We should audit the permission
checks, and convert checks that protect code that should not be
called outside the system to a signature permission. So replace
all CONNECTIVITY_INTERNAL to other proper permissions.

Bug: 32963470
Test: atest FrameworksNetTests NetworkPolicyManagerServiceTest
Change-Id: I8f2dd1cd0609056494eaf612d39820e273ae093f
Merged-In: I8f2dd1cd0609056494eaf612d39820e273ae093f

paulhu   commited 2019-12-04 11:44:45 +08:00
8e96a75543
Add LinkProperties methods to system APIs
The exposed methods are used by telephony, wifi
and tethering. For mainline support, making the
methods @SystemApi.

Bug: 139268426
Bug: 135998869
Bug: 138306002
Test: atest FrameworksNetTests
      atest NetworkStackTests
      atest FrameworksTelephonyTests
      ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh
      atest android.net.cts
      atest android.net.wifi.cts
      atest android.telephony.cts

Change-Id: Ib16a838cf9f748e1c5b045d6c2f17678f16af28c

Aaron Huang   commited 2019-12-02 19:29:18 +08:00
8d6ae5d59f
Give apps access to the NAT64 prefix.
Apps that do their own DNS queries need to know the NAT64 prefix
to resolve v4 addresses on v6-only networks.

Test: FrameworksNetTests NetworkStackTests
Bug: 144877069
Change-Id: I5a255b7afc2038646b93a0ab893f8ad62d0fb34f

Chalard Jean   authored and   Maciej Żenczykowski   commited 2019-11-30 10:25:02 +00:00
7aa4400722
Add IpConfiguration parcelable interface implementation to system API
API lint robot warnings that parcelable requires writeToParcel
and describeContents.

Bug: 139268426
Bug: 135998869
Test: atest android.net.cts
      atest android.net.wifi.cts
      atest FrameworksNetTests
      ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh

Change-Id: I7acf000c468788c3fdcb47f8601762e7804ab940

Aaron Huang   commited 2019-11-28 07:25:40 +00:00
4c1dd06339
Merge changes I195d894e,I7069c111
* changes:
  [NS A10] Cleanup
  [NS A09] Always rematch all networks to requests

Chalard Jean   authored and   Gerrit Code Review   commited 2019-11-22 14:08:09 +00:00
3d59a27d1c
Merge "Expose IpConfiguration and ProxyInfo APIs"
Aaron Huang   authored and   Gerrit Code Review   commited 2019-11-22 09:25:16 +00:00
c2df0b68c4
Cut the dependency to APN constants
With Telephony moving to Mainline these constants are not accessible
any more, and should not be made public. As they are only used by
a deprecated method that can only be called by apps with a target
SDK < M and only for one of the features it used to handle, copying
the constants until this method is completely removed is the simplest
way to go.

Test: FrameworksNetTests
Bug: 144454341
Change-Id: Iea18c8d2f2c8a40f04db9383d3f74b917267ba25

Chalard Jean   commited 2019-11-21 14:48:00 +09:00
afaed1a5e0