Commit graph android_packages_modules_Co.../core/java/android
Message SHA1
Merge "Deprecate NetworkInfo" am: 9f66465984 am: add792f1ae
am: 1c0ed50d38

Change-Id: Iefce7f71ac10d0b9c96ce7d6af345e96880cfa1c

Junyu Lai   authored and   android-build-merger   commited 2018-12-21 02:28:11 -08:00
ec26640fc8
Merge "Deprecate NetworkInfo" am: 9f66465984
am: add792f1ae

Change-Id: Ia646a8754bcd5ef62573e3b1730df3987bf9fd15

Junyu Lai   authored and   android-build-merger   commited 2018-12-21 02:16:39 -08:00
1c0ed50d38
Merge "Deprecate NetworkInfo"
Junyu Lai   authored and   Gerrit Code Review   commited 2018-12-21 09:56:39 +00:00
9f66465984
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

junyulai   commited 2018-12-20 16:36:10 +08:00
5c2f626d34
Merge "Fixed toString() printing error" am: c5b457ba48 am: 87384f2d62
am: 7b90c9c11c

Change-Id: Ia75eefba3ec6ca4fbc7aaf7c5aee362d33fba9d4

jiayanhong   authored and   android-build-merger   commited 2018-12-19 10:16:43 -08:00
8d999d3ad8
Merge "Fixed toString() printing error" am: c5b457ba48
am: 87384f2d62

Change-Id: Ia28e56d8a6b76247d552bcdbf43ef71ac80e313e

jiayanhong   authored and   android-build-merger   commited 2018-12-19 10:06:58 -08:00
7b90c9c11c
Merge "Fixed toString() printing error"
Treehugger Robot   authored and   Gerrit Code Review   commited 2018-12-19 17:39:58 +00:00
c5b457ba48
Merge "Add InetAddresses class to API" am: 08f2a98220 am: be38ccba74
am: 6e48b5278d

Change-Id: I6149da91b9bc2403f1764cfcc4a4f92758c13b26

Paul Duffin   authored and   android-build-merger   commited 2018-12-18 11:50:36 -08:00
cd5785a44b
Merge "Add InetAddresses class to API" am: 08f2a98220
am: be38ccba74

Change-Id: I3e745599be0f81decfe416a71503dc784a895a48

Paul Duffin   authored and   android-build-merger   commited 2018-12-18 11:09:15 -08:00
6e48b5278d
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

Paul Duffin   commited 2018-12-17 11:53:33 +00:00
9863a7ad63
Merge "[CM] Fix comments, add tests to TransportInfo API" am: 4060bc1480 am: be97184c39
am: e907da9b5a

Change-Id: I0a81b7b48bb02da202dd7feaa1440801b794ce67

Etan Cohen   authored and   android-build-merger   commited 2018-12-11 22:22:36 -08:00
67f7fa7dfa
Merge "[CM] Fix comments, add tests to TransportInfo API" am: 4060bc1480
am: be97184c39

Change-Id: I54556ea99992fbc0105bc2012c3d423e88c60764

Etan Cohen   authored and   android-build-merger   commited 2018-12-11 22:09:54 -08:00
e907da9b5a
[CM] Fix comments, add tests to TransportInfo API
Bug: 117605977
Test: atest NetworkCapabilitiesTest
Change-Id: I734ec56e44cd09d11ae81a856a53a26e1191b9a0

Etan Cohen   commited 2018-12-11 15:00:10 -08:00
55191eb12e
Merge "[CS] Add a generic transport-specific information API" am: 9d38e58d60 am: e95b6a7ebc
am: b70ca9b938

Change-Id: I47e0a7d62434b05d4692f9835af93c3a5dd61027

Etan Cohen   authored and   android-build-merger   commited 2018-12-10 02:39:46 -08:00
8c6670ab58
Merge "[CS] Add a generic transport-specific information API" am: 9d38e58d60
am: e95b6a7ebc

Change-Id: If70fb160c90afbfb646ca7474d06fe735031aed5

Etan Cohen   authored and   android-build-merger   commited 2018-12-08 20:19:32 -08:00
b70ca9b938
[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

Etan Cohen   commited 2018-12-07 17:37:48 +00:00
d397de2e39
Fixed toString() printing error
There maybe some copy paste error about mNetworkCapabilities
and mUnwantedNetworkCapabilities in NetworkCapability#toString()

Test: manual + CodeDEX scan
Change-Id: I9997163e8b557590c27d15f0b2184ce6e1a53647

jiayanhong   commited 2018-11-23 14:23:04 +08:00
1cfad48cb1
Merge "Move hidden APIs into system APIs" am: 01a8c6214e
am: eaea5d929e

Change-Id: Ibe6fa27d99791e57b1253a9dc990de0706b52fb6

Jack Yu   authored and   android-build-merger   commited 2018-11-20 19:04:24 -08:00
35ae67807e
Merge "Move hidden APIs into system APIs"
Jack Yu   authored and   Gerrit Code Review   commited 2018-11-21 02:40:30 +00:00
01a8c6214e
Merge "Add IPv6 link-local address generation from EUI-48" am: 5d8e697a85
am: 3ec717f4e7

Change-Id: I63de4fa185649d9389a771860c479899e90b37e4

Etan Cohen   authored and   android-build-merger   commited 2018-11-19 16:48:22 -08:00
71fc53a797
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

Jack Yu   commited 2018-11-19 14:40:13 -08:00
13fefdd2f9
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

Jack Yu   commited 2018-11-19 14:37:44 -08:00
67a9f6e481
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

Etan Cohen   commited 2018-11-16 21:50:24 -08:00
1b2d62a1bc
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

Etan Cohen   commited 2018-11-16 14:00:22 -08:00
7f6046dade
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

Roshan Pius   commited 2018-10-31 09:23:15 -07:00
7e9a60d21c
Merge "Refactor UidRange by using stable aidl structure" am: e966e640f6 am: be9bc6d666
am: 0f950b1d68

Change-Id: I82e06fe93a3ed88368b649ef8d3283322191ffe7

Luke Huang   authored and   android-build-merger   commited 2018-10-28 18:06:15 -07:00
475e21aa31
Merge "Refactor UidRange by using stable aidl structure" am: e966e640f6
am: be9bc6d666

Change-Id: I09ac7fc6525948b76114ef936dc1b3d2d1bae0fb

Luke Huang   authored and   android-build-merger   commited 2018-10-28 17:55:57 -07:00
0f950b1d68
Merge "To support skip464xlat per Network" am: 2d23f14c9e am: e826aa52e4
am: 153c48b434

Change-Id: I4a6d7480e2e7e775e511cc7eaaabe65b6a3bde7d

Chalard Jean   authored and   android-build-merger   commited 2018-10-25 20:09:15 -07:00
bf8a3d0a42
Merge "To support skip464xlat per Network" am: 2d23f14c9e
am: e826aa52e4

Change-Id: I944738258051525b371bd17dd3ee7b411b82d12b

Chalard Jean   authored and   android-build-merger   commited 2018-10-24 17:19:51 -07:00
153c48b434
Merge "Move some members to the "Q blacklist"." am: 8d6a9818f0
am: 13c9e7e2f3

Change-Id: Ia2419cce28d26d9464da2a5172cb332b629e943e

Nathan Harold   authored and   android-build-merger   commited 2018-10-24 16:14:06 -07:00
ab447742ee
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

Luke Huang   commited 2018-10-24 19:45:09 +09:00
40f9fcef6f
Merge "To support skip464xlat per Network"
Chalard Jean   authored and   Gerrit Code Review   commited 2018-10-24 07:15:20 +00:00
2d23f14c9e
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 15cfeb58a4)

Mathew Inwood   authored and   Nathan Harold   commited 2018-10-22 17:28:24 -07:00
df1c689315
Merge "Add new callback to inform blocking of network on specific uid." am: c7a2d957b0 am: d896c9a4e5
am: 8a53397b4c

Change-Id: I2bec503c5ffac156b679a48c09591458ab716789

Junyu Lai   authored and   android-build-merger   commited 2018-10-19 09:47:40 -07:00
7019b721ba
Merge "Add new callback to inform blocking of network on specific uid." am: c7a2d957b0
am: d896c9a4e5

Change-Id: I24b45f860992626968a6adfb0ff6b6389c85cf45

Junyu Lai   authored and   android-build-merger   commited 2018-10-19 09:26:39 -07:00
8a53397b4c
Merge "Add new callback to inform blocking of network on specific uid."
Junyu Lai   authored and   Gerrit Code Review   commited 2018-10-19 15:20:48 +00:00
c7a2d957b0
Merge "Enterprise Policy for Private DNS Setting"
Eran Messeri   authored and   Android (Google) Code Review   commited 2018-10-17 16:59:57 +00:00
527035a549
Merge "Change permissions checks for setAirplaneMode." am: 7b81c459ce am: 001a9fdc97
am: 141332c0a9

Change-Id: Icfc55aefa11a5e1dd92382c2be94c7b63889aa8f

Lorenzo Colitti   authored and   android-build-merger   commited 2018-10-15 08:49:52 -07:00
e23d829d66
Merge "Change permissions checks for setAirplaneMode." am: 7b81c459ce
am: 001a9fdc97

Change-Id: Ibe5bbd51adae83e1bfb5a4ab43d29eb2ccd02a8b

Lorenzo Colitti   authored and   android-build-merger   commited 2018-10-15 08:29:00 -07:00
141332c0a9
Merge "Change permissions checks for setAirplaneMode."
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2018-10-15 13:36:45 +00:00
7b81c459ce
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

Eran Messeri   commited 2018-10-15 11:53:22 +01:00
d2562e470b
Change permissions checks for setAirplaneMode.
Require NETWORK_SETTINGS (or NETWORK_SETUP_WIZARD) instead of the
legacy CONNECTIVITY_INTERNAL permission. The users are as follows:

- The system callers (Phone, Settings, SystemUI, VrSettings) all
  have NETWORK_SETTINGS.
- SetupWizard has NETWORK_SETUP_WIZARD
- sl4a has NETWORK_STACK

Bug: 115302596
Test: builds, boots, airplane mode via SystemUI works
Change-Id: I8ca40182bd8b5e3fd9a82296c0cc28de30ed4baf

Lorenzo Colitti   commited 2018-10-12 16:35:46 +09:00
c4d0186b30
To support skip464xlat per Network
To add skip464exlat in NetworkMisc.
NetworkAgent can skip to start 464xlat if need.
(e.g. IMS PDN for Cellular can be disabled)

Device will treat the network as IPv6-only if it is set

Bug: 69949375
Test: Nat464XlatTest, ConnectivityServiceTest

Change-Id: I676a02cb92530d64f29f34e89482a934f3ec4553

Yuuki Habu   commited 2018-10-12 14:35:30 +09:00
f7b0625dd7
Merge "Add log for debugging ConnectivityManager" am: d3a9f1081a am: de3f1c804e
am: 2a1eb22753

Change-Id: I23a34c21d05db126d8d2aacdeb700b3d2b2ed018

Chalard Jean   authored and   android-build-merger   commited 2018-10-11 21:29:52 -07:00
ad7dc323d2
Merge "Add log for debugging ConnectivityManager" am: d3a9f1081a
am: de3f1c804e

Change-Id: I2d8604c172b26e474050afd45fba74dc6c2c18bc

Chalard Jean   authored and   android-build-merger   commited 2018-10-11 21:21:45 -07:00
2a1eb22753
Merge "Add log for debugging ConnectivityManager"
Chalard Jean   authored and   Gerrit Code Review   commited 2018-10-12 03:14:48 +00:00
d3a9f1081a
Add new callback to inform blocking of network on specific uid.
Currently, apps rely on querying NetworkInfo object to know
whether their network is blocked or not. There is no proactive
way to tell app when it is being blocked/unblocked. The only
event that app would receive is SocketException with
ECONNABORTED when their ongoing socket connection has been
blocked, which is not an elegant way to notify app.

Thus, this commit is trying to address this problem. Therefore,
with the uses of other callbacks, the need of
getState/getDetailedState in NetworkInfo could be completely
eliminated.

Test: runtest frameworks-net
      runtest -x NetworkPolicyManagerServiceTest.java
      cts-tradefed run cts -m CtsHostsideNetworkTests
      cts-tradefed run cts -m CtsNetTestCases -t \
              android.net.cts.ConnectivityManagerTest
Bug: 74575553

Change-Id: Iec96a3103d0aa9a505020eb89d69b89c0b694486

junyulai   commited 2018-10-11 16:31:10 +08:00
5ab727b349
Merge "Make setAirplaneMode @SystemApi for SetupWizard." am: 772b75c26d am: 27d5da4b3c
am: 6bc642d6d7

Change-Id: I994f0ff3ad9a3833eb56da7614e3632452d5c476

Lorenzo Colitti   authored and   android-build-merger   commited 2018-10-10 23:32:45 -07:00
22df18f4fc
Merge "Make setAirplaneMode @SystemApi for SetupWizard." am: 772b75c26d
am: 27d5da4b3c

Change-Id: I8049e2484526104eba7fad92d2819eb94319fa84

Lorenzo Colitti   authored and   android-build-merger   commited 2018-10-10 20:26:35 -07:00
6bc642d6d7
Make setAirplaneMode @SystemApi for SetupWizard.
Expose ConnectivityManager#setAirplaneMode and the
NETWORK_SETUP_WIZARD permission so that SetupWizard can call
setAirplaneMode.

Delete setAirplaneMode from the greylist because the permissions
checks on it, since at least 2013, have been for a privileged
permission (CONNECTIVITY_INTERNAL) that normal apps don't have.

Test: m
Bug: 115302596
Change-Id: I28f24d32c4b4b386407e9e0e3514ea9f8854f4a8

Lorenzo Colitti   commited 2018-10-10 17:50:05 +09:00
272a77dd9a