Commit graph android_packages_modules_Co.../core/java/android
Message SHA1
Add a new IpPrefix class and use it in RouteInfo.
This change uses IpPrefix only in the public API and continues
to use LinkAddress for everything else. It does not change the
callers to use the new APIs, with the exception of changing
all current uses of getDestination to getDestinationLinkAddress
to make room for the new getDestination method that returns an
IpPrefix.

Based on Sreeram's earlier change:
https://googleplex-android-review.git.corp.google.com/#/c/477874/
but a bit simplified and with a bit more documentation.

Bug: 15142362
Bug: 13885501
Change-Id: Ib4cd96b22cbff4ea31bb26a7853989f50da8de4e

Sreeram Ramachandran   authored and   Robert Greenwalt   commited 2014-06-10 14:30:15 -07:00
8162a5ef8b
Merge "remember and report network score"
vandwalle   authored and   Android (Google) Code Review   commited 2014-06-09 22:30:26 +00:00
e472bf0970
remember and report network score
Change-Id: Iccb2ec603bc9c0d3cf1976d0cc3f343cb1096494

vandwalle   commited 2014-06-09 14:50:47 -07:00
170e6d10e5
Merge "Apply API review to android.net.Network:"
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-06-08 23:41:27 +00:00
c9104d4795
Fix public API of LinkProperties.
bug:15142362
Change-Id: I1457111da7d3bd09998f7e010febb8bb4c45c8bc

Robert Greenwalt   commited 2014-06-08 12:54:23 -07:00
bbcebb79ae
Apply API review to android.net.Network:
- socketFactory() renamed to getSocketFactory()
- Make sure bindProcess() documentation points developers to getSocketFactory() as the preferred approach
- Move bindProcess() and unbindProcess() to ConnectivityManager.setProcessBoundNetwork() -- passing null clears it.
- Move getProcessBoundNetwork() to ConnectivityManager.getProcessBoundNetwork().

Bug:15142362
Bug:13885501

Change-Id: Ia55c59d52e1ec8bf10dd0d9d037bd04c0998bc71

Paul Jensen   authored and   Robert Greenwalt   commited 2014-06-08 12:09:18 -07:00
e98c6e0a33
Fix the marking of restricted network requests
Need to realized that the NOT_RESTRICTED bit is set by
default, so if looking at what bits are set to decide if
we want NOT_RESTRICTED cleared, we need to ignore the
bit itself.

bug:15456019

Change-Id: Iecae598f47ec7306d475e2262bb1c452ddf0fc75

Robert Greenwalt   commited 2014-06-05 23:59:48 +00:00
505660a316
Call a network restricted only if all capabilities are restricted
When guessing whether a network is restricted or not (e.g., when
constructing a NetworkCapabilities object from an APN type, or
when constructing a request using startUsingNetworkFeature),
only assume the network is restricted if all the capabilities it
provides are typically provided by restricted networks (e.g.,
IMS, FOTA, etc.).

Previous code would conclude a network was restricted even if it
supported one "restricted" capability, so for example an APN
that provides both Internet connectivity and FOTA was marked as
restricted. This caused it to become ineligible to provide the
default Internet connection, because that must be unrestricted.

Also expand the list of restricted APN types a bit.

Bug: 15417453
Change-Id: I8c385f2cc83c695449dc8cf943d918321716fe58

Lorenzo Colitti   commited 2014-06-04 20:04:38 +09:00
f7c6e734e9
Make requests for restricted networks not require unrestricted access.
Currently, calling startUsingNetworkFeature for a restricted APN
type (e.g., IMS or FOTA) will create a request that requires
NET_CAPABILITY_NOT_RESTRICTED. Because these APNs are restricted,
when we bring them up we conclude that it does not match the
unrestricted requirement, and we tear them down.

1. Clear the NET_CAPABILITY_NOT_RESTRICTED capability when
   creating requests in startUsingNetworkFeature.
2. Refactor the code to a common function so this cannot happen
   again.

Bug: 15191336
Change-Id: Id1ec79c58ff79b1a83457ffaecc57d50b61ed4e4

Lorenzo Colitti   commited 2014-06-04 12:20:06 +09:00
74246df4e4
Fix Legacy NetworkInfo API
Make the connectivity changed broadcasts send correct NetworkInfos.
Also update the results of getNetwork.

bug:15290306
bug:15191336
bug:14993207
Change-Id: Ie99ad25f3ebb90d18348e7013761b139e7481866
(cherry picked from commit 16fe1c18289de200d2249e51db8c0986619f487b)

Robert Greenwalt   commited 2014-06-03 14:00:56 +00:00
5a367872ce
Refactor NetworkFactory.
Make NetworkFactory a concrete class and divide responsibilites between it and NetworkAgent.
Factory will track requests and by default give a single connect/disconnect api for ease
of use.  Then NetworkAgent is created and destroyed as needed with very simple logic.

Change-Id: I401c14a6e5466f2fc63b04219b97ff85bb9af291
(cherry picked from commit 9a17b9c5a256cb4bb14821c5ee89b03b99c045e8)

Robert Greenwalt   commited 2014-06-03 01:26:48 +00:00
cf82b83c79
Rewrite startUsingNetworkFeature for new API
bug:14993207
Change-Id: I041a80faa07bf3094af13a6c606f3b15aa03f789
(cherry picked from commit 09fe5e618b09965183cf53fba87c39025a19e8d1)

Robert Greenwalt   commited 2014-06-02 23:29:20 +00:00
b59a91be9f
Adjust Network's SocketFactory to restrict host name resolution to that Network
bug: 13885501

Change-Id: Iab9a5a2e060fe261f4be9ba974c1a55fb6b9c98b
(cherry picked from commit 92064edf55ee11967d9cc7529125236ee8e469b2)

Paul Jensen   commited 2014-05-29 19:17:06 +00:00
0179f8830a
Implement bind-to-network functionality of android.net.Network.
This is implemented by calling through to netd_client.
Included are functions to bind-to-network-for-process strictly for DNS to
facilitate startUsingNetworkFeature() reimplementation.

bug: 13885501

Change-Id: Ib22c7d02ea81d251bdfeeb0f64a47ce32eefcb1b
(cherry picked from commit dbf76f898f1f57eb74722358087c926d2f529bda)

Paul Jensen   authored and   Robert Greenwalt   commited 2014-05-29 18:53:57 +00:00
94d37923b9
DO NOT MERGE - Support disconnecting while trying to connect.
Currently, once a NetworkAgent has decided to connect, there's
no way to disconnect without first connecting and having
ConnectivityService tear down the connection. This is suboptimal
because it causes the transport to keep retrying even if it knows
that it will not be able to connect.

Instead, allow the transport to abort a connection request that's
in progress, as long as the agent is not yet registered with
ConnectivityService.

Also add locking to evalScores. evalScores should already have
been taking a lock, because it accesses member variables that are
also accessed by the send*methods.

Bug: 15295359
Change-Id: I913c341bdfc50be9c23b632399f53168e754c1c0
(cherry picked from commit 081e99c3ac341734467b65458f94adc160f50d6c)

Lorenzo Colitti   commited 2014-05-28 09:29:07 +00:00
a2db7676f3
Move dis/enable of mobile data to Telephony
ConnectivityService doesn't do this anymore.

bug:15077247
Change-Id: I3208c91b2c0369b594987f39ca29da7478435513
(cherry picked from commit 53013c87496980b534e447e717a32698fbd4bca0)

Robert Greenwalt   authored and   Dave Langemak   commited 2014-05-27 20:28:50 +00:00
3d6c958af4
Move IP config from WifiConfiguration to IpConfiguration.
This is so that Ethernet can use it in the future.

Bug: 7606609
Bug: 8687763

Change-Id: I5d1189682b13f1088848809604690648d8d9ecca

Jaewan Kim   authored and   Lorenzo Colitti   commited 2014-05-20 15:24:10 -07:00
f351fbb607
Add NetworkFactory names and unregistration.
Some Factories come and go (Telephony) and so they need to be able to unregister.
Also, debugging is tough when the factories are anonymous, so add names for logging.

Lastly, only send single set of NetworkRequests to a newly registered NetworkFactory
and only send the requests.

Change-Id: I717d63363f25c446f8ecf38d933b1a35d744af6e

Robert Greenwalt   commited 2014-05-20 09:03:57 -07:00
e20d3ec4a7
Merge "Fix reference to ProxyInfo extra"
Jason Monk   authored and   Android (Google) Code Review   commited 2014-05-20 12:59:52 +00:00
4c4bd56e95
Add javadoc and unhide new API
Change-Id: I12e475bbf4000c7acec4ca27b1d3bf8f870cc2cf

Robert Greenwalt   commited 2014-05-19 10:34:36 -07:00
d0ebdbb7b0
Add docs for Linkproperties and unhide it.
Preperation for ConnectivityManager API reveal.

Change-Id: Id2addf424213e796c6077def0b7f30cac9a0f75f

Robert Greenwalt   commited 2014-05-19 09:43:36 -07:00
778e9a38ff
Merge "Apply Doc fixes to RouteInfo"
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-05-19 15:53:15 +00:00
d48cb481a2
Merge "Add docs to Network"
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-05-19 15:52:05 +00:00
4abc7dfe61
Add javadoc for NetworkRequest.
Also moved the requestId serial number out of this public class into CS.

Had to leave NetworkRequest hidden for now because the docs refer to things still hidden
in ConnectivityManager.

Change-Id: I14d1fe52d992adf5e4dc197b8f5433e40b0adfe6

Robert Greenwalt   commited 2014-05-19 08:17:05 -07:00
469fa2a36d
Add docs to Network
Still must be hidden until we unhide the new API in ConnectivityManager.

Change-Id: I4749e56777199093cdba9223eb3d721c3174047d

Robert Greenwalt   commited 2014-05-19 07:59:16 -07:00
7caaf098fd
Apply Doc fixes to RouteInfo
Change-Id: Ib76df135d5514f7b8baafbbe91fa3d1cdd632f00

Robert Greenwalt   commited 2014-05-19 07:27:46 -07:00
791a40df80
Update the docs for NetworkCapabilities
Preparing for ConnectivityService API update

Change-Id: I397e375b9254d4271183cf34c4a689deea1e198e

Robert Greenwalt   commited 2014-05-18 16:40:16 -07:00
37546d8177
Update RouteInfo docs and make public.
Change-Id: I1a8fe04022ea8291076af166f09112d19114ee16

Robert Greenwalt   commited 2014-05-18 12:43:14 -07:00
8b57c411e4
Update comments for LinkAddress
In preparation for CS api review.

Change-Id: Ib933e905846ebd039d96a523946dd8fdb10f3ff1

Robert Greenwalt   commited 2014-05-18 09:39:18 -07:00
602400263c
Merge "Clean up when we switch networks."
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-05-16 17:16:19 +00:00
eda0ac038b
Clean up when we switch networks.
Need to unhitch mNetworkForRequestId when a network is no longer
satisfying a request.

Change-Id: I3b3cde7dd92ec87a76ae7a0825ad22e892fa8fd5

Robert Greenwalt   commited 2014-05-16 08:54:07 -07:00
5fe706b595
Fix reference to ProxyInfo extra
Also remove unneeded null check.

Change-Id: Ic25d1087f93632a24755b284ede41d870492e25d

Jason Monk   commited 2014-05-15 12:07:29 -04:00
8247fd4951
Remove unneed clear in constructor.
Keeps all constructors on equal footing.

Change-Id: I316d2b058cc2230ff6aa25a6c8785b42b460438d

Robert Greenwalt   commited 2014-05-15 08:53:37 -07:00
bdba468cb0
Fix reboot loop due to NPE.
All that's old is new again: http://ag/63748.

Change-Id: I83df48447dbcb7f6edf02bd07abf721b009afa49

Sreeram Ramachandran   commited 2014-05-14 14:45:00 -07:00
6e24ec7ff6
Undeprecate funcs until we're ready for api-review
Fixing javadoc deprecated tags to fix a checkbuild error breaks the current/api.txt.
We're not ready for the api change yet, so back out the comments.

Change-Id: Ia95e394da7329c1b9e3876e589c3c2137ba18048

Robert Greenwalt   commited 2014-05-14 08:55:13 -07:00
b5c5c2bbe3
Fix Javadoc
It's Deprecated for an annotation, but deprecated for
a javadoc and case is important.

Fix build

Change-Id: I355dc1660196c09530b58386f401a85a74d16476

Robert Greenwalt   commited 2014-05-14 07:50:11 -07:00
89566b61a9
Merge "Add networks and requests to CS.dump"
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-05-14 13:44:26 +00:00
c9558f6f04
Add networks and requests to CS.dump
Adds debugging.

Change-Id: I352dfe970c990fd210f3d1598519e321bbdd6ed5
(cherry picked from commit 2a202f0341801ffdebae19bff867e49e4d82b114)

Robert Greenwalt   commited 2014-05-14 13:12:23 +00:00
31a4052e71
Add Multinetwork API
Change-Id: I3a9cef0d416db96d05098dd989ee3fef3b1e9274
(cherry picked from commit d2a1edf5369707b53f63778a029bf70c25551bb6)

Robert Greenwalt   commited 2014-05-14 13:06:56 +00:00
2bebbfb357
Separate network and interface addition/removal netd APIs.
This should facilitate stacked interfaces (i.e. clatd).

Change-Id: Ib3e7a4d3847ef6ec4449451f6da42e75959baa4f

Paul Jensen   authored and   Lorenzo Colitti   commited 2014-05-14 03:56:34 -07:00
6b19753e89
Enabling internal msg apis
NetworkFactory and NetworkAgent.  First trying with wifi and
getting rid of WifiStateTracker.

Conflicts:
	api/current.txt
	services/core/java/com/android/server/ConnectivityService.java

Change-Id: I7f0ec13d7d8988b32f3c6dc71f72012f3349fe02

Robert Greenwalt   authored and   Lorenzo Colitti   commited 2014-05-14 03:56:34 -07:00
db6fac5aad
Merge "Add Network-specific host name resolution API."
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-05-14 05:39:10 +00:00
a4e602ed6a
Add NetworkFactory support.
This is a protocol allowing transports to dynamically register with CS for
Handler to Handler communications.

bug:13885501
Change-Id: Ic7275e3724a15efc7e5f80981560c4cb3106007b

Robert Greenwalt   commited 2014-05-13 21:21:49 -07:00
948aea53b0
Add Network-specific host name resolution API.
Change-Id: I932f73158a8f6e3ccc36c319d138180dff2aa070

Paul Jensen   commited 2014-05-13 19:05:13 -04:00
d4d7a2e361
Merge "Switch PacUrl storage from String to Uri"
Jason Monk   authored and   Android (Google) Code Review   commited 2014-05-13 15:14:50 +00:00
d60aeb7dea
Merge "Add has* utility functions to NetworkCapabilities"
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-05-13 01:35:02 +00:00
2d3cabca36
Add has* utility functions to NetworkCapabilities
Change-Id: Icf735b778a3956812be522db39c29cf54c757a25

Robert Greenwalt   commited 2014-05-12 18:32:22 -07:00
e645d4a8f8
Fix reboot loop.
The multinetwork branch is rebooting on startup with:

E/AndroidRuntime( 1024): *** FATAL EXCEPTION IN SYSTEM PROCESS: NetworkStats
[...]
E/AndroidRuntime( 1024): Caused by: java.lang.NullPointerException: Attempt to read from field 'long android.net.NetworkCapabilities.mNetworkCapabilities' on a null object reference
E/AndroidRuntime( 1024): 	at android.net.NetworkCapabilities.<init>(NetworkCapabilities.java:235)
E/AndroidRuntime( 1024): 	at android.net.BaseNetworkStateTracker.getNetworkCapabilities(BaseNetworkStateTracker.java:103)
E/AndroidRuntime( 1024): 	at com.android.server.ConnectivityService.getAllNetworkState(ConnectivityService.java:1134)
E/AndroidRuntime( 1024): 	at com.android.server.net.NetworkStatsService.updateIfacesLocked(NetworkStatsService.java:877)
E/AndroidRuntime( 1024): 	at com.android.server.net.NetworkStatsService.updateIfaces(NetworkStatsService.java:849)
E/AndroidRuntime( 1024): 	at com.android.server.net.NetworkStatsService.access$600(NetworkStatsService.java:139)
E/AndroidRuntime( 1024): 	at com.android.server.net.NetworkStatsService$2.onReceive(NetworkStatsService.java:717)
E/AndroidRuntime( 1024): 	at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:766)
E/AndroidRuntime( 1024): 	... 4 more

This seems to be due to NetworkCapabilities' copy constructor
not null-checking its argument.  Unbreak things by ignoring null.

Change-Id: Iff3c38e6d72390fa86e51bfce534ebd42a262e19

Lorenzo Colitti   authored and   Robert Greenwalt   commited 2014-05-12 18:06:47 -07:00
356463ad36
Add NetworkRequest to the multinetwork API
bug:13885501
Change-Id: I7b9a01aadf26b6ff104d088b6e283c838ec4dfac

Robert Greenwalt   commited 2014-05-12 17:52:48 -07:00
a4e1c494f8
Replace LinkCapabilities with NetworkCapabilities
Also remove unused LinkSocket and LinkSocketNotifier.
bug:13885501

Change-Id: Id426e31b201fa4f29109b5fea485d8efb34519d3

Robert Greenwalt   commited 2014-05-12 16:52:56 -07:00
4d97cb04ba