Commit Graph

1964 Commits

Author SHA1 Message Date
Chalard Jean
158702db55 Add nullability annotations to public methods of ConnManager.
This is mainly for Kotlin compatibility.
https://android-developers.googleblog.com/2018/08/android-pie-sdk-is-now-more-kotlin.html

Bug: 122437895
Test: no logic changes
Change-Id: Ic1b9a774aee0099397b1ccfd958ff3b61d69a7fb
2019-01-07 19:35:09 +09:00
Mathew Inwood
75f3441060 Merge "Limit access to suspected false positives." am: aeda49d185
am: 350a598d1a

Change-Id: I8e10322e69d2d479079df5cf8fec0287c7c117f1
2019-01-02 05:00:54 -08:00
Mathew Inwood
bdfc1fcb7a Limit access to suspected false positives.
Members modified herein are suspected to be false positives: i.e. things
that were added to the greylist in P, but subsequent data analysis
suggests that they are not, in fact, used after all.

Add a maxTargetSdk=P to these APIs. This is lower-risk that simply
removing these things from the greylist, as none of out data sources are
perfect nor complete.

For APIs that are not supported yet by annotations, move them to
hiddenapi-greylist-max-p.txt instead which has the same effect.

Exempted-From-Owner-Approval: Automatic changes to the codebase
affecting only @UnsupportedAppUsage annotations, themselves added
without requiring owners approval earlier.

Bug: 115609023
Test: m
Change-Id: Ia937d8c41512e7f1b6e7f67b9104c1878b5cc3a0
Merged-In: I020a9c09672ebcae64c5357abc4993e07e744687
2018-12-28 14:26:35 +00:00
Mathew Inwood
de679608ef Limit access to suspected false positives.
Members modified herein are suspected to be false positives: i.e. things
that were added to the greylist in P, but subsequent data analysis
suggests that they are not, in fact, used after all.

Add a maxTargetSdk=P to these APIs. This is lower-risk that simply
removing these things from the greylist, as none of out data sources are
perfect nor complete.

For APIs that are not supported yet by annotations, move them to
hiddenapi-greylist-max-p.txt instead which has the same effect.

Exempted-From-Owner-Approval: Automatic changes to the codebase
affecting only @UnsupportedAppUsage annotations, themselves added
without requiring owners approval earlier.

Bug: 115609023
Test: m
Change-Id: I020a9c09672ebcae64c5357abc4993e07e744687
2018-12-28 11:50:04 +00:00
Paul Hu
5cc9d59a78 Merge "Unhide LinkProperties, NetworkCapabilities, NetworkRequest APIs" am: 6f8696cf67 am: 77dfb10a6f
am: dec63b8473

Change-Id: I65cd4c326a1fe64c09b131f1b1924f12e522a664
2018-12-21 07:57:58 -08:00
Paul Hu
dec63b8473 Merge "Unhide LinkProperties, NetworkCapabilities, NetworkRequest APIs" am: 6f8696cf67
am: 77dfb10a6f

Change-Id: Ic641472bab2e5aa7b443caaac13deae260c3902d
2018-12-21 07:48:38 -08:00
Paul Hu
6f8696cf67 Merge "Unhide LinkProperties, NetworkCapabilities, NetworkRequest APIs" 2018-12-21 15:21:03 +00:00
Junyu Lai
8696e8921f Merge "Deprecate NetworkInfo" am: 84a764b1f4 am: 3b1eb0acc4
am: 5d1d75f1ce

Change-Id: Iefce7f71ac10d0b9c96ce7d6af345e96880cfa1c
2018-12-21 02:28:11 -08:00
Junyu Lai
5d1d75f1ce Merge "Deprecate NetworkInfo" am: 84a764b1f4
am: 3b1eb0acc4

Change-Id: Ia646a8754bcd5ef62573e3b1730df3987bf9fd15
2018-12-21 02:16:39 -08:00
Junyu Lai
84a764b1f4 Merge "Deprecate NetworkInfo" 2018-12-21 09:56:39 +00:00
junyulai
9826e7f292 Deprecate NetworkInfo
Currently NetworkInfo is used by Apps to get information of
network. However, to get such information, Apps need to poll
NetworkInfo frequently from ConnectivityService.

In order to increase the stability and reduce the maintain
effort, all functionalities provided by NetworkInfo are targeted
to be replaced or removed entirely.

Apps should use ConnectivityManager.NetworkCallback instead, to
get faster and more detailed updates from connectivity changes.

Or, apps could use getNetworkCapabilities or getLinkProperties
to get information synchronously, but should not mix the
callbacks and synchronous methods together.

Bug: 113629330
Test: atest FrameworksNetTests
Change-Id: Ie8faf620958c3fa0a4a2f233b35b825de0e99ffc
2018-12-20 16:36:10 +08:00
jiayanhong
37428e5ac9 Merge "Fixed toString() printing error" am: 9952ebd7d5 am: 50b52d9db8
am: 07ad89f002

Change-Id: Ia75eefba3ec6ca4fbc7aaf7c5aee362d33fba9d4
2018-12-19 10:16:43 -08:00
jiayanhong
07ad89f002 Merge "Fixed toString() printing error" am: 9952ebd7d5
am: 50b52d9db8

Change-Id: Ia28e56d8a6b76247d552bcdbf43ef71ac80e313e
2018-12-19 10:06:58 -08:00
Treehugger Robot
9952ebd7d5 Merge "Fixed toString() printing error" 2018-12-19 17:39:58 +00:00
Paul Duffin
d32813abe0 Merge "Add InetAddresses class to API" am: 2f8a9b2c4d am: 18b313b077
am: b1d6edf06c

Change-Id: I6149da91b9bc2403f1764cfcc4a4f92758c13b26
2018-12-18 11:50:36 -08:00
Paul Duffin
b1d6edf06c Merge "Add InetAddresses class to API" am: 2f8a9b2c4d
am: 18b313b077

Change-Id: I3e745599be0f81decfe416a71503dc784a895a48
2018-12-18 11:09:15 -08:00
paulhu
058120dbc2 Unhide LinkProperties, NetworkCapabilities, NetworkRequest APIs
These methods are marked to @UnsupportedAppUsage APIs since
Android Q. But some system apps still need them to set/get
necessary network or request information. Hence, make them to be
public or system APIs.

Bug: 120448492
Test: atest FrameworksNetTests
Change-Id: I95a44daef5615e290b40d0796ca183b88ad8a63f
2018-12-18 08:39:49 +00:00
Paul Duffin
70c2193096 Add InetAddresses class to API
Adds methods needed by app developers to avoid them having to call
non-SDK APIs.

Test: tests added to cts
Bug: 78686891
Change-Id: Ic0eadfdab2b111d5ca4becb753f4fe3557806433
2018-12-17 11:53:33 +00:00
Etan Cohen
1457e13e50 Merge "[CM] Fix comments, add tests to TransportInfo API" am: 4060bc1480 am: 4e20619d98
am: b03827647f

Change-Id: I0a81b7b48bb02da202dd7feaa1440801b794ce67
2018-12-11 22:22:36 -08:00
Etan Cohen
b03827647f Merge "[CM] Fix comments, add tests to TransportInfo API" am: 4060bc1480
am: 4e20619d98

Change-Id: I54556ea99992fbc0105bc2012c3d423e88c60764
2018-12-11 22:09:54 -08:00
Etan Cohen
73fb5a86f0 [CM] Fix comments, add tests to TransportInfo API
Bug: 117605977
Test: atest NetworkCapabilitiesTest
Change-Id: I734ec56e44cd09d11ae81a856a53a26e1191b9a0
2018-12-11 15:00:10 -08:00
Etan Cohen
fef353db3b Merge "[CS] Add a generic transport-specific information API" am: 0e18882d5c am: 7081aa381d
am: 7e32ea6593

Change-Id: I47e0a7d62434b05d4692f9835af93c3a5dd61027
2018-12-10 02:39:46 -08:00
Etan Cohen
7e32ea6593 Merge "[CS] Add a generic transport-specific information API" am: 0e18882d5c
am: 7081aa381d

Change-Id: If70fb160c90afbfb646ca7474d06fe735031aed5
2018-12-08 20:19:32 -08:00
Etan Cohen
ac07cca084 [CS] Add a generic transport-specific information API
Add a generic transport-specific information container interface and
access methods. These can be used by a network factory to pass transport
(bearer)-specific network parameters to the app.

Bug: 117605977
Test: atest frameworks/base/tests/net/java/android/net (+new unit tests)
Change-Id: Ib7c83b677e1c02a2212265719813e648b0c9cc1b
2018-12-07 17:37:48 +00:00
Hongshik
e2d7cf5aed Add PCSCF to LinkProperties.
Some applications or services are needed PCSCF address to register IMS server but there is no way to get it on Android Framework.
We have added PCSCF address to LinkProperties like attached diff files.

Test: get Linkproperties and check Pcscf addresses.
      atest FrameworksNetTests

Change-Id: Ic2341a4ce2ed88d560325721766fc21f85f7ff86
Signed-off-by: Hongshik <hshik.kim@samsung.com>
2018-12-05 22:05:49 +09:00
jiayanhong
a03720b3e9 Fixed toString() printing error
There maybe some copy paste error about mNetworkCapabilities
and mUnwantedNetworkCapabilities in NetworkCapability#toString()

Test: manual + CodeDEX scan
Change-Id: I9997163e8b557590c27d15f0b2184ce6e1a53647
2018-11-23 14:23:04 +08:00
Jack Yu
e8c1f1222c Merge "Move hidden APIs into system APIs" am: c606db86c8
am: 44676f50d4

Change-Id: Ibe6fa27d99791e57b1253a9dc990de0706b52fb6
2018-11-20 19:04:24 -08:00
Jack Yu
c606db86c8 Merge "Move hidden APIs into system APIs" 2018-11-21 02:40:30 +00:00
Etan Cohen
79e553dea6 Merge "Add IPv6 link-local address generation from EUI-48" am: fb0dcb1ed7
am: e6db899061

Change-Id: I63de4fa185649d9389a771860c479899e90b37e4
2018-11-19 16:48:22 -08:00
Jack Yu
2268041efb Move hidden APIs into system APIs
To allow vendor code to construct LinkAddress, which is
one of the parameter in the system API DataCallResponse.

Test: Build
Bug: 73659459
Merged-In: I3e203781d3a03285fa0e047cc8837ccb4a09016a
Change-Id: I3e203781d3a03285fa0e047cc8837ccb4a09016a
2018-11-19 14:40:13 -08:00
Jack Yu
476352b00a Move hidden APIs into system APIs
To allow vendor code to construct LinkAddress, which is
one of the parameter in the system API DataCallResponse.

Test: Build
Bug: 73659459
Change-Id: I3e203781d3a03285fa0e047cc8837ccb4a09016a
2018-11-19 14:37:44 -08:00
Etan Cohen
ec1c466cb0 Add IPv6 link-local address generation from EUI-48
Add a utility method to convert an EUI-48 to an IPv6 link-local
address based on RFC 4291 (EUI-64 generation) followed by RFC 4862.

Bug: 117605977
Test: atest MacAddressTest
Merged-In: I80b683e69da6beff3b37fc345fc15aa9610d09b7
Change-Id: I80b683e69da6beff3b37fc345fc15aa9610d09b7
2018-11-16 21:50:24 -08:00
Etan Cohen
42ab31a798 Add IPv6 link-local address generation from EUI-48
Add a utility method to convert an EUI-48 to an IPv6 link-local
address based on RFC 4291 (EUI-64 generation) followed by RFC 4862.

Bug: 117605977
Test: atest MacAddressTest
Change-Id: I80b683e69da6beff3b37fc345fc15aa9610d09b7
2018-11-16 14:00:22 -08:00
Roshan Pius
e26dae35e7 wifi(API): NetworkSpecifier for Wifi NetworkAgent
Create an @hide NetworkSpecifier to use by the Wifi NetworkAgent. This
will be used by connectivity service to match the incoming
NetworkRequest (with WifiNetworkSpecifier) with the NetworkAgent we
created to serve that request.
The WifiNetworkAgentSpecifier will hold the current connected wifi
network configuration which will be used to pattern match the
WifiNetworkSpecifier from NetworkRequest's.

Also, added a @hide helper method in MacAddress to help with matching
bssid pattern.

Bug: 113878056
Test: Unit tests
Change-Id: I9a643f0b914d48ff64104c798ec2869db40cb24b
2018-10-31 09:23:15 -07:00
Luke Huang
301f969054 Merge "Refactor UidRange by using stable aidl structure" am: 1742c23b88 am: 55c7b00f65
am: 7f47d94a18

Change-Id: I82e06fe93a3ed88368b649ef8d3283322191ffe7
2018-10-28 18:06:15 -07:00
Luke Huang
7f47d94a18 Merge "Refactor UidRange by using stable aidl structure" am: 1742c23b88
am: 55c7b00f65

Change-Id: I09ac7fc6525948b76114ef936dc1b3d2d1bae0fb
2018-10-28 17:55:57 -07:00
Chalard Jean
8177c3fc86 Merge "To support skip464xlat per Network" am: 698b80818c am: e826aa52e4
am: 426e1cca1a

Change-Id: I4a6d7480e2e7e775e511cc7eaaabe65b6a3bde7d
2018-10-25 20:09:15 -07:00
Chalard Jean
426e1cca1a Merge "To support skip464xlat per Network" am: 698b80818c
am: e826aa52e4

Change-Id: I944738258051525b371bd17dd3ee7b411b82d12b
2018-10-24 17:19:51 -07:00
Nathan Harold
b265835d23 Merge "Move some members to the "Q blacklist"." am: 26f91069c1
am: 13c9e7e2f3

Change-Id: Ia2419cce28d26d9464da2a5172cb332b629e943e
2018-10-24 16:14:06 -07:00
Luke Huang
477db5fe1a Refactor UidRange by using stable aidl structure
Use stable aidl generated structure instead of UidRange

Test: runtest frameworks-net passes
Test: manual testing of UidRange related function works
Change-Id: Iaf1c10777dc1e71df2be2a57533a10257b12626b
2018-10-24 19:45:09 +09:00
Chalard Jean
698b80818c Merge "To support skip464xlat per Network" 2018-10-24 07:15:20 +00:00
Mathew Inwood
0e71d36c58 Move some members to the "Q blacklist".
Based on some analysis, these fields/methods are likely false positives.
Set maxTargetSdk=P so that any apps using them are required to migrate off
them in future. See the bug for more details.

Exempted-From-Owner-Approval: Automatic changes to the codebase
affecting only @UnsupportedAppUsage annotations, themselves added
without requiring owners approval earlier.

Bug: 115609023
Test: m
Merged-In: I719b5c94e5b1f4fa562dd5d655953422958ad37e
Change-Id: I719b5c94e5b1f4fa562dd5d655953422958ad37e
(cherry picked from commit 2622bdf569)
2018-10-22 17:28:24 -07:00
Junyu Lai
304c26b590 Merge "Add new callback to inform blocking of network on specific uid." am: f41deeb4a9 am: 118cf0e236
am: b4e045b1b8

Change-Id: I2bec503c5ffac156b679a48c09591458ab716789
2018-10-19 09:47:40 -07:00
Junyu Lai
b4e045b1b8 Merge "Add new callback to inform blocking of network on specific uid." am: f41deeb4a9
am: 118cf0e236

Change-Id: I24b45f860992626968a6adfb0ff6b6389c85cf45
2018-10-19 09:26:39 -07:00
Junyu Lai
f41deeb4a9 Merge "Add new callback to inform blocking of network on specific uid." 2018-10-19 15:20:48 +00:00
Eran Messeri
7a906817f5 Merge "Enterprise Policy for Private DNS Setting" 2018-10-17 16:59:57 +00:00
Lorenzo Colitti
d96f450cb2 Merge "Change permissions checks for setAirplaneMode." am: 38149e3ea7 am: 65b71e6a20
am: 5fe041f889

Change-Id: Icfc55aefa11a5e1dd92382c2be94c7b63889aa8f
2018-10-15 08:49:52 -07:00
Lorenzo Colitti
5fe041f889 Merge "Change permissions checks for setAirplaneMode." am: 38149e3ea7
am: 65b71e6a20

Change-Id: Ibe5bbd51adae83e1bfb5a4ab43d29eb2ccd02a8b
2018-10-15 08:29:00 -07:00
Lorenzo Colitti
38149e3ea7 Merge "Change permissions checks for setAirplaneMode." 2018-10-15 13:36:45 +00:00
Eran Messeri
120511dbeb Enterprise Policy for Private DNS Setting
A new API for setting the Private DNS settings value programatically via
the DevicePolicyManager.

Since there are two separate settings for Private DNS, and the value
provided for the hostname needs to be validated, a new
DevicePolicyManager API is introduced.

Only a Device Policy Client in Device Owner mode may change these
settings.
The DPC may additionally set a user restriction (added in a separate CL)
to prevent the user from changing Private DNS settings.

Bug: 112982691
Test: atest com.android.cts.devicepolicy.DeviceOwnerTest#testPrivateDnsPolicy
Change-Id: I566437e4fe10e1346858149120c50b3c20ca073f
2018-10-15 11:53:22 +01:00