Commit graph android_packages_modules_Co.../core/java/android
Message SHA1
Merge "Remove unused api."
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-07-02 18:55:10 +00:00
f7c7336625
Fix build
Change-Id: I7d0787e4a1f778008c979c4174ef445a950c4250

Glenn Kasten   commited 2014-07-07 07:12:29 -07:00
b20d886bce
Remove unused api.
bug:15595155
Change-Id: Ifd79365bd45f20f531782244f471a4cfc32a4135

Robert Greenwalt   commited 2014-07-02 13:50:33 -07:00
e0b0051472
Add captive portal sign-in actions.
Change-Id: I70a6c2efc4f3fa48d5b65e8d630682fe74abfe2c

Paul Jensen   commited 2014-07-02 16:47:48 +00:00
e378679df9
Make sure callback handler is in place before callbacks handled.
When making Network requests in ConnectivityManager, make sure we install the
callback prior to a response from ConnectivityService arriving causing us to
search for the callback and inadvertently not find it.

bug:15928097
Change-Id: Ie5feb9cc8f5effc19870f54dba07218b2e11d82a

Paul Jensen   commited 2014-07-02 13:50:53 +00:00
bb427685db
MS: Adding Support for Emergency APN in Telephony Framework
(base/telephony)

Replacement for https://partner-android-review.googlesource.com/#/c/171175/

Change-Id: I16fc37f5c00ed79f2370bc46554fc7a24c52c4cb
Conflicts:
	core/java/android/net/ConnectivityManager.java

Ram   authored and   Etan Cohen   commited 2014-07-01 02:00:51 +00:00
693d07a0b4
Use return values from JNI functions binding sockets and processes to networks.
bug:15757549
Change-Id: If23b14febc923b9a0348f0cf9029fd4bf6e8d725

Paul Jensen   commited 2014-06-26 16:33:58 +00:00
10ba60a4a1
Modify DNS server update methods.
1. Make addDnsServer not add duplicate servers and return a
   boolean value incating whether it changed anything. This is
   consistent with what we do for LinkAddresses and routes.
2. Add a setDnsServers method that sets all the DNS servers to
   the specified collection. This is consistent with what we do
   for LinkAddress.

Bug: 9180552
Change-Id: I5baed09253261b66ea42ae2ea82398118e3ab0ac

Lorenzo Colitti   commited 2014-06-26 17:04:38 +09:00
131eb31373
Teach LinkProperties whether it's provisioned or not.
In IPv4, a link is provisioned when DHCP succeeds. In IPv6, a
there is no such signal, because addresses and DNS servers can
be notified by the kernel at different times.

Add an isProvisioned method that returns true if we believe that
enough information has configured to use a network. For IPv6,
this requires an IP address, default route, and DNS server. For
IPv4, this requires only an IPv4 address, because we support
static configuration that doesn't have a default route or DNS
server.

To do this we use the existing hasIPv4Address method, rename the
all-but unused hasIPv6Address method to hasGlobalIPv6Address
(which is what we want anyway) and add new hasIPv[46]DefaultRoute
and hasIPv[46]DnsServer methods.

Bug: 9180552
Change-Id: Ib2f5ff8af920f7b6f1edf0e2afaaa0edce9bc72d

Lorenzo Colitti   commited 2014-06-26 03:23:31 +09:00
fc854695c1
Minor changes to RouteInfo.
1. Realize that mDestination can never be null and update the
   code accordingly.
2. Simplify isDefaultRoute.
3. Provide two new hidden utility methods, isIPv4Default() and
   isIPv6Default(), that can be used by LinkProperties to
   to determine if the system has connectivity.
4. Update tests.

Bug: 9180552
Change-Id: I85028d50556c888261d250925962bdedfe08e0c6

Lorenzo Colitti   commited 2014-06-25 18:22:12 +00:00
99064fa3ae
Clean up and add some Network logging.
Dumps the netid for the Network and adds that to the NetworkAgentInfo.

Change-Id: Id9fbcc55ca55bf1a020f747f0c44902efb1b5f87

Robert Greenwalt   commited 2014-06-23 17:40:12 -07:00
52228dd7cf
Merge "Add logging to track down weird ConnectivityManager issue."
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-06-23 21:44:43 +00:00
7ee7824678
Add logging to track down weird ConnectivityManager issue.
bug:15771399
Change-Id: I0a7150286f94262414005298e6f038f278347a7c

Robert Greenwalt   commited 2014-06-23 15:33:40 -07:00
b8401730a8
Modify LinkProperties add/remove route functions.
This will allow us to dynamically track routes being added and
removed, similar to what we do for IP addresses.

1. Support removing routes. Since this is a new function, we
   don't need to jump through hoops to support callers passing
   in routes that have no interface, we just fail to match them.
2. Make the addRoute method return a boolean value indicating
   whether anything changed. This is consistent with what we do
   for addresses and is used to decide whether to update the
   rest of the system when an update comes in.

Bug: 9180552
Change-Id: I50648b5f81ec55c88501a7640e119cda2bb540f2

Lorenzo Colitti   commited 2014-06-17 11:18:53 +09:00
36ddd9d00c
IpPrefix improvements.
1. Allow IpPrefixes to be created from strings. In order to do
   this, factor out the code from LinkAddress which already does
   this to a small utility class in NetworkUtils.
2. Truncate prefixes on creation, fixing a TODO.
3. Add a toString method.
4. Write a unit test.

While I'm at it, make RouteInfoTest pass again, and convert it
to use IpPrefix instead of LinkAddress.

Change-Id: I5f68f8af8f4aedb25afaee00e05369f01e82a70b

Lorenzo Colitti   commited 2014-06-17 11:18:53 +09:00
174bab2a0d
Merge "Fix build"
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-06-12 05:34:42 +00:00
f72c856009
Fix build
Re-finalizing some classes.  The api/current.txt was updated separately but the change
that made them final got skipped.  Also had same issue for some @hide's that were removed.

Change-Id: I423bb7b3029ee03425a3c446bda51ab8191887c1

Robert Greenwalt   commited 2014-06-12 16:24:38 -07:00
c4920a555d
am 2d0ab42b: Merge "Apply API Council comments to ConnectivityManager" into lmp-preview-dev
* commit '2d0ab42b1420db884d26fd2ef22710b5a887e9a6':
  Apply API Council comments to ConnectivityManager

Robert Greenwalt   authored and   Android Git Automerger   commited 2014-06-12 22:31:07 +00:00
6f033963ff
Apply API Council comments to ConnectivityManager
rename isNetworkActive -> isDefaultNetworkActive
rename registerNetworkActiveListener -> registerDefaultNetworkActiveListener
make listenForNetwork/requestNetwork take a NetworkRequest
rename NetworkCallbackListener -> NetworkCallback
rename listenForNetwork -> registerNetworkCallback
rename releaseNetworkRequest -> unregisterNetworkCallback
remove NetworkRequest param from NetworkCallback functions
rename onNetworkCapabilitiesChagned to onCapabilitiesChanged
remove onReleased
change time units in onLosing from Sec -> ms

bug: 15142362
Change-Id: Ibc96e3f461706efe1eafa0d85605249cfd6e9fdd

Robert Greenwalt   commited 2014-06-11 23:17:46 -07:00
f57c03c3b9
Make IpPrefix final.
Couldn't resolve a merge conflict, so skipped and make the change this way.

Change-Id: Ib043f660fca2090f0d12a5a707e5e1ad28f76adb

Robert Greenwalt   commited 2014-06-12 12:57:19 -07:00
4998e952f8
am 558aeb90: Merge "Make NetworkCapabilities publicly immutable." into lmp-preview-dev
* commit '558aeb901144fac460575402e38fc8baa2da83eb':
  Make NetworkCapabilities publicly immutable.

Robert Greenwalt   authored and   Android Git Automerger   commited 2014-06-12 18:49:07 +00:00
bb0ec47862
Make NetworkCapabilities publicly immutable.
Applying API council comments.

bug: 15142362

(cherry picked from commit Ie0bde68b72656a676d90c0343b9756fe9268d8d6)
Change-Id: Ie0bde68b72656a676d90c0343b9756fe9268d8d6

Robert Greenwalt   commited 2014-06-11 23:29:39 +00:00
bfd1f4c206
Fix wifi connectivity issues.
http://ag/480881 changed RouteInfo.getDestination() to return an IpPrefix
instead of a LinkAddress. This makes the equals() comparison always fail.

So, when ConnectivityService.updateRoutes() is given identical routes, instead
of realizing that there's no diff, it would consider them different, and thus
add and remove the same route. The add would fail, since the route already
existed in netd, but the remove would succeed, leaving the system with no routes
and thus no connectivity.

Bug: 15564210
Change-Id: I2003b0fcb809cc20837dc489c58af37891ca4556

Sreeram Ramachandran   commited 2014-06-11 15:56:51 -07:00
96151d642e
Merge "Fix wifi connectivity issues." into lmp-preview-dev
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-06-11 21:23:31 +00:00
08bbe1fd33
Fix wifi connectivity issues.
http://ag/480881 changed RouteInfo.getDestination() to return an IpPrefix
instead of a LinkAddress. This makes the equals() comparison always fail.

So, when ConnectivityService.updateRoutes() is given identical routes, instead
of realizing that there's no diff, it would consider them different, and thus
add and remove the same route. The add would fail, since the route already
existed in netd, but the remove would succeed, leaving the system with no routes
and thus no connectivity.

Bug: 15564210
Change-Id: I2003b0fcb809cc20837dc489c58af37891ca4556

Sreeram Ramachandran   authored and   Robert Greenwalt   commited 2014-06-11 23:02:59 +00:00
0a6e648504
Merge "Fix public API of LinkProperties." into lmp-preview-dev
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-06-10 22:18:15 +00:00
d579b350e2
Fix public API of LinkProperties.
bug:15142362
(cherry picked from commit 51d898fd0223a4b7c728980ab987dd985c02df5f)
Change-Id: I1457111da7d3bd09998f7e010febb8bb4c45c8bc

Robert Greenwalt   commited 2014-06-10 15:42:19 -07:00
87afb9411c
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
(cherry picked from commit 5ca1e6675bf4182b6e9ca76a7696bf2e38e96c4f)

Paul Jensen   authored and   Robert Greenwalt   commited 2014-06-10 22:26:11 +00:00
c4c6498fcc
Merge "Minor changes to the LinkAddress API docs." into lmp-preview-dev
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-06-10 22:12:51 +00:00
c5dd50b4c4
Merge "Add a new IpPrefix class and use it in RouteInfo." into lmp-preview-dev
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-06-11 23:10:23 +00:00
a7918cc239
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
(cherry picked from commit 7d3b4b9a3d4de9673119632da0ebd583e50126f7)

Sreeram Ramachandran   authored and   Robert Greenwalt   commited 2014-06-11 16:32:21 -07:00
aaaf7bab7f
Minor changes to the LinkAddress API docs.
1. Rename getNetworkPrefixLength to getPrefixLength. Update all
   callers in frameworks/base and add a shim method and a TODO
   for the rest.
2. @hide isSameAddressAs. It doesn't add much, and it's just
   one-liner that callers can implement if they want.
3. Fix the alignment of the initial paragraph (<ul> should have
   been </ul>).
4. Remove the documentation that talks about creating
   LinkAddresses, since there's no public API for creating them.

With these changes I think LinkAddress is fine as a public API.

Bug: 15142362
Change-Id: Iaf3b1db577745bb68a9e1dd7f96d666dd3f3ec7c
(cherry picked from commit 9ab53650cfcd91a2a151b44b3fd1381841f76269)

Lorenzo Colitti   authored and   Robert Greenwalt   commited 2014-06-11 18:52:19 +00:00
8e43314ae0
Minor changes to the LinkAddress API docs.
1. Rename getNetworkPrefixLength to getPrefixLength. Update all
   callers in frameworks/base and add a shim method and a TODO
   for the rest.
2. @hide isSameAddressAs. It doesn't add much, and it's just
   one-liner that callers can implement if they want.
3. Fix the alignment of the initial paragraph (<ul> should have
   been </ul>).
4. Remove the documentation that talks about creating
   LinkAddresses, since there's no public API for creating them.

With these changes I think LinkAddress is fine as a public API.

Bug: 15142362
Change-Id: Iaf3b1db577745bb68a9e1dd7f96d666dd3f3ec7c

Lorenzo Colitti   authored and   Robert Greenwalt   commited 2014-06-10 14:46:39 -07:00
b0116bf5bf
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
887d7b1d5a
Merge "remember and report network score"
vandwalle   authored and   Android (Google) Code Review   commited 2014-06-09 22:30:26 +00:00
b112882ab4
remember and report network score
Change-Id: Iccb2ec603bc9c0d3cf1976d0cc3f343cb1096494

vandwalle   commited 2014-06-09 14:50:47 -07:00
fc2e61014a
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
dc69ebdf94
Fix public API of LinkProperties.
bug:15142362
Change-Id: I1457111da7d3bd09998f7e010febb8bb4c45c8bc

Robert Greenwalt   commited 2014-06-08 12:54:23 -07:00
69aceaf7f2
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
8cdda64b9c
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
4a52c697d2
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
2606df8790
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
21c178d0a6
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
802c11080e
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
06c734e52e
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
3dc73e576b
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
c3c5babcb1
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
80504dbd74
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
892331dc08
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
0c150c0082
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
6d8dcb76d8