Commit graph

1,455 commits

Message SHA1
Add Network inspection API.
Adds getNetworksNetworkInfo.
Adds getAllNetworks.

Cleans up some synchronization issues.

Change-Id: I82c7a4b554e3c6c1adfe6027cc54b028ed6dbac9

Robert Greenwalt   commited 2014-07-10 10:48:23 -07:00
02fe11eba3
Add Trust to NetworkCapabilities.
Indicates the user has indicated implicit trust of a network.  This
generally means it's a sim-selected carrier, a plugged in ethernet,
a paired BT device or a wifi they've asked to connect to.  Untrusted
networks are probably limited to unknown wifi AP.

Change-Id: I89490bdaa3c2d63d33f876c72d8b088dc155fa3d

Robert Greenwalt   commited 2014-07-08 23:55:18 +00:00
a134636a4b
CW on Master: Disable CaptivePortalTracker, EthernetService
BUG: 15143878

Change-Id: I6c534a28c1fcd475982ae70e7f3af69f3a219e24

Joe LaPenna   authored and   Robert Greenwalt   commited 2014-07-08 22:52:02 +00:00
c4bb3c9092
Remove dead code.
Also adds a TYPE_VPN so the VPN can be strongly typed.

Change-Id: Ibf39450c480f16ce5ab4c25b47965691b844fb92

Robert Greenwalt   commited 2014-07-07 17:09:01 -07:00
ce7a144472
Merge "Remove unused api."
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-07-02 18:55:10 +00:00
f7c7336625
When adding a NetworkRequest, cancel linger for satisfying Network.
This fixes a problem where a requested network can later suddenly disappear if
it was lingering when the request arrived and later the linger timeout expired.

bug:15927234
Change-Id: Ib3fae45820ce4421e3bc5b623937a16d5f1efa0f

Paul Jensen   commited 2014-07-07 15:50:24 +00:00
7ba4d03c1c
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
Merge "Add captive portal sign-in actions."
Paul Jensen   authored and   Android (Google) Code Review   commited 2014-07-02 20:06:33 +00:00
ae46024ddc
Add captive portal sign-in actions.
Change-Id: I70a6c2efc4f3fa48d5b65e8d630682fe74abfe2c

Paul Jensen   commited 2014-07-02 16:47:48 +00:00
e378679df9
Apply the tethering user restriction to connectivity service.
Bug: 15852213
Change-Id: Ib2df696189981ed1b31955257047fac3ee403965

Julia Reynolds   commited 2014-07-02 16:46:54 +00:00
c8e3a7176f
Simplify the network transition wakelock.
Make it all internal to ConnectivityService - we know when a network
is lost, so grab a wakelock then.
Moves the call out of WifiStateMachine which was grabbing at bad times
like every dhcp renewal or corp-network roam.  These would always
go the full 1 minute and chew up battery.

bug:15595155
Change-Id: I80157a818cc149072cc7706d78c1e79c6e679ab3

Robert Greenwalt   commited 2014-07-02 09:26:43 -07:00
520d6dc471
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
Enforce ConnectivityManager.releaseNetworkRequest callers own the NetworkRequest
Enforce that callers of ConnectivityManager.releaseNetworkRequest() are the
creators of the NetworkRequest being released by matching UIDs.

Change-Id: I439468c054bacc035e2db2c4967b24d183e78e9c

Paul Jensen   commited 2014-06-26 18:07:12 +00:00
961cb0dbcb
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
Convert BluetoothTetheringDataTracker into a NetworkFactory.
bug:15407087

Change-Id: I0437ca52dedf73e8ec69ac82e46353f6fafc4a42

Paul Jensen   commited 2014-06-26 09:13:51 -04:00
154b6b292c
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
Unbreak LinkPropertiesTest.
This was broken by the changes that made addRoute add routes
only if they did not already exist.

Change-Id: I1d227df9223fbecf106efde05b709f320824ee9d

Lorenzo Colitti   commited 2014-06-25 18:19:47 +00:00
3897f1a407
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
am 004961f7: (-s ours) am a77d0ef4: (-s ours) am 0b572896: (-s ours) Merge "DO NOT MERGE refactor wifi p2p\'s startDhcpServer function"
* commit '004961f73f':
  DO NOT MERGE refactor wifi p2p's startDhcpServer function

Robert Greenwalt   authored and   Android Git Automerger   commited 2014-06-23 22:40:33 +00:00
f40cf879e3
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
am a77d0ef4: (-s ours) am 0b572896: (-s ours) Merge "DO NOT MERGE refactor wifi p2p\'s startDhcpServer function"
* commit 'a77d0ef49e8c4b53e1cd794c0739584914bd6eda':
  DO NOT MERGE refactor wifi p2p's startDhcpServer function

Robert Greenwalt   authored and   Android Git Automerger   commited 2014-06-23 22:10:37 +00:00
004961f73f
DO NOT MERGE refactor wifi p2p's startDhcpServer function
Add getTetheredDhcpRanges() interface and call it before calling
mNwService.startTethering() to update dhcp ranges. This will allow p2p app
to run well concurrently with other tethering app(e.g. usb tethering).

Change-Id: I5e8ffeb5d2d396f48b897cd9396f133e25ecca57
Signed-off-by: Jianzheng Zhou <jianzheng.zhou@freescale.com>

Jianzheng Zhou   authored and   Robert Greenwalt   commited 2014-06-23 21:02:45 +00:00
52a7755751
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
Assert that RT_SCOPE_* and IFA_F_* are not zero.
If these constants are zero (or, rather, if they're not all
different), the test will fail with more cryptic error messages
whose cause is not obvious. Clearly check for that here.

Bug: 15602893
Change-Id: I7ca4a9c5e3d592fd93fbfa1b50666a1861a0031d

Lorenzo Colitti   commited 2014-06-13 17:20:20 +09:00
3718680598
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
Fix Build
Change-Id: Iebbce8eaf21b3d2ba01ec720812d38018b13529e

Robert Greenwalt   commited 2014-06-11 18:36:36 -07:00
b1f76f229c
Fix build breakage.
Change-Id: Ideb32704ce5dc37ef36b05609f88da2aa55b3a00

Robert Greenwalt   commited 2014-06-11 18:06:55 -07:00
20091e092e
Merge "Make IpPrefix final."
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-06-11 21:23:31 +00:00
d17ae25aea
am f7c964fa: Merge "Fix Build" into lmp-preview-dev
* commit 'f7c964fa06257d6db1b894bfbe905ca125c755c8':
  Fix Build

Robert Greenwalt   authored and   Android Git Automerger   commited 2014-06-12 19:57:23 +00:00
2f6c9155a4
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 9c6d406e: Fix build breakage.
* commit '9c6d406eb7ab0fce40fb7cd1257714a29d06774c':
  Fix build breakage.

Robert Greenwalt   authored and   Android Git Automerger   commited 2014-06-12 19:57:11 +00:00
795563325d
am c7d65d75: Merge "Fix wifi connectivity issues." into lmp-preview-dev
* commit 'c7d65d759be6cd48a7bbaa4f061b4c4f85424b11':
  Fix wifi connectivity issues.

Robert Greenwalt   authored and   Android Git Automerger   commited 2014-06-12 19:56:55 +00:00
5e9af44a9a
am e1f5b5e0: Merge "Minor changes to the LinkAddress API docs." into lmp-preview-dev
* commit 'e1f5b5e0cd5206e01e1c0e2bd282d421d9951960':
  Minor changes to the LinkAddress API docs.

Robert Greenwalt   authored and   Android Git Automerger   commited 2014-06-12 19:56:45 +00:00
98876d2928
am 4ad1f0d3: (-s ours) Merge "Add a new IpPrefix class and use it in RouteInfo." into lmp-preview-dev
* commit '4ad1f0d31e4c998aa65344ccb8abb51cf96dd909':
  Add a new IpPrefix class and use it in RouteInfo.

Robert Greenwalt   authored and   Android Git Automerger   commited 2014-06-12 19:56:39 +00:00
e1023fe0ce
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
am fe5ca964: (-s ours) Merge "Fix public API of LinkProperties." into lmp-preview-dev
* commit 'fe5ca9646f86e041ed7729ecd0a006428806acf2':
  Fix public API of LinkProperties.

Robert Greenwalt   authored and   Android Git Automerger   commited 2014-06-12 16:53:43 +00:00
b891bcca1f
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
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
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