Commit Graph

2039 Commits

Author SHA1 Message Date
Lorenzo Colitti
6702d4b5b2 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
2020-01-09 19:50:26 +09:00
paulhu
9c7a0fa46a Add NetworkCapabilities#deduceRestrictedCapability
Support telephony mainline module usage.

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

Change-Id: Idbd9c547eff7227085c753461b901c7cdbe396fb
2020-01-09 17:59:46 +08:00
Automerger Merge Worker
20c3474d81 Merge "Replace ConnectivityManager constants to TetheringManager" am: 8124da436a am: ced6412599 am: 023c3b47b0
Change-Id: I0180fe011062a11d7cc925bced8d8178fa3dcc63
2020-01-09 07:25:42 +00:00
Mark Chien
8124da436a Merge "Replace ConnectivityManager constants to TetheringManager" 2020-01-09 06:32:04 +00:00
Chiachang Wang
c2441ee239 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
2020-01-09 10:25:03 +08:00
Automerger Merge Worker
0f44319e8a Merge "Add API surface for ConnectivityDiagnostics API." am: 33bb594563 am: 30f5bec382 am: b432ef87d2
Change-Id: Id7191b7b625a4026feb7f752c7475011a3adbf52
2020-01-08 22:49:23 +00:00
Cody Kesting
33bb594563 Merge "Add API surface for ConnectivityDiagnostics API." 2020-01-08 21:53:14 +00:00
markchien
a0f8fd92fd 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
2020-01-08 15:06:09 +00:00
Artur Satayev
9c2add6fcc 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
2020-01-08 14:04:40 +00:00
Chiachang Wang
7879adc8b1 Expose clearCapabilities for mainline module
Support telephony mainline module usage.

Bug: 138306002
Test: Build and make api-stubs-docs-update-current-api
Change-Id: I0a462da4e87cae2c7d4a9b9a92de061a086c5752
2020-01-08 11:08:10 +08:00
Automerger Merge Worker
d35146155f Merge "Change tetheroffloadjni to tetheringutilsjni" am: 0af9d37eca am: d248c13bda am: e7294ecb17
Change-Id: I2069561edb05b53e565563c8419c689531ff9571
2020-01-07 09:38:44 +00:00
Treehugger Robot
0af9d37eca Merge "Change tetheroffloadjni to tetheringutilsjni" 2020-01-07 09:05:43 +00:00
TreeHugger Robot
bf954f0c42 Merge "Use new UnsupportedAppUsage annotation." 2020-01-07 07:58:18 +00:00
markchien
d53edf736f 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
2020-01-07 07:42:13 +00:00
Automerger Merge Worker
46ea41c701 Merge changes If28f0be6,If0f80067 am: 96529ad7fc am: 21dd220d3e am: 2a55907ecf
Change-Id: I826f1f94ea62eb5bd93e5d7edcbe278c8247ae2d
2020-01-07 07:31:36 +00:00
Lorenzo Colitti
279a1d6620 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
2020-01-07 13:02:32 +09:00
Artur Satayev
53dac33c7e 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
2020-01-06 16:47:35 +00:00
ruibin zhang
ca75bc897d Add the DHCP server address to LinkProperties.
Bug: 134098566
Test: see subsequent CL in topic
Change-Id: If0f80067934189137c87cd379e7ae47b187562fd
2020-01-07 01:21:07 +09:00
TreeHugger Robot
dc3b592193 Merge "Add NETWORK_AIRPLANE_MODE permission" 2020-01-06 14:15:46 +00:00
Cody Kesting
457a1ad289 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
2020-01-02 10:51:17 -08:00
Automerger Merge Worker
467942cf30 Merge "Expose NetworkCapabilities methods to system/public APIs" am: 9290dc1179 am: 5d77a84faf am: bd94fca597
Change-Id: I6515df858f4ebc94d234f905a659db45188d72c6
2019-12-27 08:54:24 +00:00
Aaron Huang
e435d2aeb1 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
2019-12-27 08:31:06 +00:00
markchien
be9b5e5eea [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
2019-12-20 10:31:31 +08:00
markchien
5776f96096 [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
2019-12-19 20:53:06 +08:00
Automerger Merge Worker
76d5022cf9 Merge "Add LinkProperties methods to system APIs" am: 5966c91e94 am: 2b7e2960e3 am: 71b47b486d
Change-Id: I39e9224206a43a85fecaf0956003cd4896ca0820
2019-12-19 08:38:26 +00:00
Aaron Huang
5966c91e94 Merge "Add LinkProperties methods to system APIs" 2019-12-19 08:01:58 +00:00
Automerger Merge Worker
b3df292a9d Merge "Fix parceling of LinkProperties Inet6Addr" am: 98460b6863 am: d33931f634 am: f72923e980
Change-Id: I6692a91c3e00fb8726ed4914f7d7e3c22874a068
2019-12-19 03:46:11 +00:00
Remi NGUYEN VAN
98460b6863 Merge "Fix parceling of LinkProperties Inet6Addr" 2019-12-19 03:07:43 +00:00
Remi NGUYEN VAN
3a59a925e0 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
2019-12-18 19:52:30 +09:00
Aaron Huang
441e499861 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
2019-12-17 16:21:19 +00:00
Aaron Huang
aab5480b48 Merge "Add keepalive related methods and fields to system APIs" 2019-12-17 13:57:13 +00:00
Aaron Huang
5a916810c6 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
2019-12-13 23:05:37 +08:00
Automerger Merge Worker
2d41a6ebe6 Merge "Make getNetworkSpecifier() public API." am: ad60ef88e0 am: c0f993bb04 am: f5d13c5ac5
Change-Id: I73894e4236dc5660f2eb54be3d48aa7359822947
2019-12-12 12:47:00 +00:00
Chalard Jean
294ebbbad8 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
2019-12-12 13:10:55 +09:00
Jeffrey Huang
3d97148418 Rename writeToProto to be dumpDebug
We want to eventually migrate some of these APIs to be @SystemApi for mainline modules.
The #dumpDebug name is more appropriate than #writeToProto.

Bug: 142279786
Test: Manual
Change-Id: I60793e91cedf6b720d4ecef6a8484f4fed4ff30f
2019-12-05 11:28:11 -08:00
markchien
be1810eddd Merge "Expose netId to SystemApi" am: ed2644bf65 am: 4127bbc6bf
am: 25797f3843

Change-Id: I4dce3a699666c8f75e028b7dc2e196ca0b44b41c
2019-12-05 00:43:27 -08:00
Treehugger Robot
ed2644bf65 Merge "Expose netId to SystemApi" 2019-12-05 02:29:41 +00:00
markchien
d2751e09d2 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
2019-12-04 14:33:51 +08:00
paulhu
e031948c1a 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
2019-12-04 11:45:51 +08:00
paulhu
8e96a75543 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
2019-12-04 11:44:45 +08:00
Aaron Huang
8d6ae5d59f 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
2019-12-02 19:29:18 +08:00
Chalard Jean
d8d95a5865 Merge "Give apps access to the NAT64 prefix." am: 3391fbb6a2 am: 6a96b757df
am: 151d65dab6

Change-Id: I759e5da8648fd10b26aa235410ee6e22e1976a9b
2019-12-01 18:33:11 -08:00
Chalard Jean
7aa4400722 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
2019-11-30 10:25:02 +00:00
Edward Savage-Jones
d472369791 Add NETWORK_AIRPLANE_MODE permission
Add a permission to allow airplane mode to
be toggled without holding the NETWORK_SETTINGS
(or similar) permission.

Bug: 141621384
Bug: 145164696
Test: TODO
Change-Id: Iebe2f501fdd802d54fd3345ac2fb0a8c129faf71
2019-11-28 21:13:50 +09:00
Aaron Huang
a717c87e3b Merge "Add IpConfiguration parcelable interface implementation to system API" am: 2193b07c21 am: fda119df8e
am: 2dbf6f50f3

Change-Id: I9add4992fbacca4668867abc7a218256805d1bfc
2019-11-28 02:19:08 -08:00
Aaron Huang
4c1dd06339 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
2019-11-28 07:25:40 +00:00
Chalard Jean
6aaf2bc277 Merge changes I195d894e,I7069c111 am: 3d59a27d1c am: cc64d36d32
am: 6e40e5fa0b

Change-Id: I3a8926f3b444f19b6db200c361ce348da25dbcb8
2019-11-25 07:20:17 -08:00
Aaron Huang
402cea9bfd Merge "Expose IpConfiguration and ProxyInfo APIs" am: c2df0b68c4 am: 10481a8f5f
am: d91e5a5ccb

Change-Id: Iebd6cdd25f61a2255f1e17984bafda4c79a7d518
2019-11-25 07:16:49 -08:00
Chalard Jean
3d59a27d1c Merge changes I195d894e,I7069c111
* changes:
  [NS A10] Cleanup
  [NS A09] Always rematch all networks to requests
2019-11-22 14:08:09 +00:00
Aaron Huang
c2df0b68c4 Merge "Expose IpConfiguration and ProxyInfo APIs" 2019-11-22 09:25:16 +00:00