Commit Graph

2091 Commits

Author SHA1 Message Date
Robert Greenwalt
e594a76c9f Refactor wifi p2p's startDhcpServer function
Add getTetheredDhcpRanges() interface and call it before calling
mNwService.startTethering to update dhcp ranges.  This will allow
p2p apps to run well concurently with other tethering apps.

Manual import of AOSP change 81546 by jianzheng.zhou@freescale.com

Change-Id: Iebc62f95bdcedde80e2c1d3e9580d3f625c3b50b
2014-07-10 18:56:12 +00:00
Adrian Roos
9d896191e5 Add AlarmClock API to AlarmManager
Adds a new kind of alarm that represents an alarm clock and
a way to query the next scheduled alarm clock.

Deprecates Settings.System.NEXT_ALARM_FORMATTED.

Bug: 14589952
Change-Id: I297eeeff36d07adcda010afac183d0f5ee37dc99
2014-07-10 17:07:36 +00:00
Paul Jensen
bf09bfca2f Merge "Enable network validations and add app to handle captive portal login." 2014-07-10 00:32:18 +00:00
Paul Jensen
239ce0b6d6 Enable network validations and add app to handle captive portal login.
Network validation prevents networks claiming to provide internet connectivity
from becoming the default network in cases where internet connectivity is not
found to actually exist.
If a captive portal is encountered the appropriate broadcasts and notifications
are surfaced to allow apps to handle signing in.  If no app handles signing in,
my system app will handle it.

Bug:15409233
Bug:15409354

Change-Id: Ie240d7eac4bdbab8cc7578782bd72d8b26de7951
2014-07-10 13:14:01 -04:00
Robert Greenwalt
11e39d2fb7 Merge "Add Network inspection API." 2014-07-09 21:39:59 +00:00
Robert Greenwalt
02fe11eba3 Add Network inspection API.
Adds getNetworksNetworkInfo.
Adds getAllNetworks.

Cleans up some synchronization issues.

Change-Id: I82c7a4b554e3c6c1adfe6027cc54b028ed6dbac9
2014-07-10 10:48:23 -07:00
The Android Automerger
e5850f86cf merge in master-release history after reset to 26062eeec5526b1724b84dd390837c2854f2494a 2014-07-09 05:50:33 -07:00
Robert Greenwalt
a134636a4b 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
2014-07-08 23:55:18 +00:00
Joe LaPenna
c4bb3c9092 CW on Master: Disable CaptivePortalTracker, EthernetService
BUG: 15143878

Change-Id: I6c534a28c1fcd475982ae70e7f3af69f3a219e24
2014-07-08 22:52:02 +00:00
The Android Automerger
6dacd030b7 merge in master-release history after reset to 31025926105a93fe1af05b14c09a6b9388ceb7ab 2014-07-08 05:50:17 -07:00
Robert Greenwalt
ce7a144472 Remove dead code.
Also adds a TYPE_VPN so the VPN can be strongly typed.

Change-Id: Ibf39450c480f16ce5ab4c25b47965691b844fb92
2014-07-07 17:09:01 -07:00
Paul Jensen
8729530aa0 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
2014-07-07 14:24:48 -07:00
The Android Automerger
d46c879b64 merge in master-release history after reset to dd5986f9027a3582d0087cc619cee000d66b2640 2014-07-03 05:50:52 -07:00
Robert Greenwalt
f7c7336625 Merge "Remove unused api." 2014-07-02 18:55:10 +00:00
Paul Jensen
7ba4d03c1c 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
2014-07-07 15:50:24 +00:00
Glenn Kasten
b20d886bce Fix build
Change-Id: I7d0787e4a1f778008c979c4174ef445a950c4250
2014-07-07 07:12:29 -07:00
Robert Greenwalt
e0b0051472 Remove unused api.
bug:15595155
Change-Id: Ifd79365bd45f20f531782244f471a4cfc32a4135
2014-07-02 13:50:33 -07:00
Paul Jensen
ae46024ddc Merge "Add captive portal sign-in actions." 2014-07-02 20:06:33 +00:00
Paul Jensen
e378679df9 Add captive portal sign-in actions.
Change-Id: I70a6c2efc4f3fa48d5b65e8d630682fe74abfe2c
2014-07-02 16:47:48 +00:00
Julia Reynolds
c8e3a7176f Apply the tethering user restriction to connectivity service.
Bug: 15852213
Change-Id: Ib2df696189981ed1b31955257047fac3ee403965
2014-07-02 16:46:54 +00:00
Robert Greenwalt
520d6dc471 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
2014-07-02 09:26:43 -07:00
Paul Jensen
bb427685db 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
2014-07-02 13:50:53 +00:00
Ram
693d07a0b4 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
2014-07-01 02:00:51 +00:00
The Android Automerger
b45f08b1f1 merge in master-release history after reset to cc3af234e4b1a4253a24813d5e40027746c485c1 2014-06-28 05:50:25 -07:00
Paul Jensen
961cb0dbcb 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
2014-06-26 18:07:12 +00:00
Paul Jensen
10ba60a4a1 Use return values from JNI functions binding sockets and processes to networks.
bug:15757549
Change-Id: If23b14febc923b9a0348f0cf9029fd4bf6e8d725
2014-06-26 16:33:58 +00:00
Paul Jensen
154b6b292c Convert BluetoothTetheringDataTracker into a NetworkFactory.
bug:15407087

Change-Id: I0437ca52dedf73e8ec69ac82e46353f6fafc4a42
2014-06-26 09:13:51 -04:00
The Android Automerger
f6638f4320 merge in master-release history after reset to d76f6559680a0542419be17be2698c115c1234a9 2014-06-26 05:50:13 -07:00
Lorenzo Colitti
131eb31373 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
2014-06-26 17:04:38 +09:00
Lorenzo Colitti
fc854695c1 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
2014-06-26 03:23:31 +09:00
Lorenzo Colitti
99064fa3ae 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
2014-06-25 18:22:12 +00:00
Lorenzo Colitti
3897f1a407 Unbreak LinkPropertiesTest.
This was broken by the changes that made addRoute add routes
only if they did not already exist.

Change-Id: I1d227df9223fbecf106efde05b709f320824ee9d
2014-06-25 18:19:47 +00:00
The Android Automerger
a52d0b52d6 merge in master-release history after reset to 360d800143ce26e910491b1ac5caa2d349b39867 2014-06-24 05:50:19 -07:00
Robert Greenwalt
52228dd7cf Clean up and add some Network logging.
Dumps the netid for the Network and adds that to the NetworkAgentInfo.

Change-Id: Id9fbcc55ca55bf1a020f747f0c44902efb1b5f87
2014-06-23 17:40:12 -07:00
Robert Greenwalt
004961f73f 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
2014-06-23 22:10:37 +00:00
Robert Greenwalt
7ee7824678 Merge "Add logging to track down weird ConnectivityManager issue." 2014-06-23 21:44:43 +00:00
Robert Greenwalt
f40cf879e3 am 004961f7: (-s ours) am a77d0ef4: (-s ours) am 0b572896: (-s ours) Merge "DO NOT MERGE refactor wifi p2p\'s startDhcpServer function"
* commit '004961f73f6a707fa516219ed6801a67397ae8f9':
  DO NOT MERGE refactor wifi p2p's startDhcpServer function
2014-06-23 22:40:33 +00:00
Robert Greenwalt
b8401730a8 Add logging to track down weird ConnectivityManager issue.
bug:15771399
Change-Id: I0a7150286f94262414005298e6f038f278347a7c
2014-06-23 15:33:40 -07:00
Jianzheng Zhou
52a7755751 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>
2014-06-23 21:02:45 +00:00
The Android Automerger
1c3b93ceb8 merge in master-release history after reset to 86d30fc2b1c0be1b03f36929d29059c3c3fa6d5f 2014-06-22 08:19:40 -07:00
The Android Automerger
22304dd14a merge in master-release history after reset to 2ea611ae776abd84e444551ecb0dd4f76e27c591 2014-06-18 10:23:07 -07:00
The Android Automerger
e167eaf7cb merge in master-release history after reset to 2ea611ae776abd84e444551ecb0dd4f76e27c591 2014-06-18 10:15:32 -07:00
The Android Automerger
096db3a39b merge in master-release history after reset to 93080f3adfbb85d198c9782ed3a62a5588d45ff6 2014-06-18 06:34:17 -07:00
The Android Automerger
69f052245f merge in master-release history after reset to 73ad3c14b9df1acb99856f63fee904fdbf70a3b6 2014-06-17 05:50:17 -07:00
Lorenzo Colitti
36ddd9d00c 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
2014-06-17 11:18:53 +09:00
Lorenzo Colitti
174bab2a0d 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
2014-06-17 11:18:53 +09:00
The Android Automerger
907732f79e merge in master-release history after reset to 7894185dc074b00bf4f475d0aaf4506f43129dfc 2014-06-14 05:50:39 -07:00
Lorenzo Colitti
3718680598 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
2014-06-13 17:20:20 +09:00
The Android Automerger
f7fd5d855b merge in master-release history after reset to deccc2c40cd70252372a8e01b9321576d81c719f 2014-06-12 05:50:29 -07:00
Robert Greenwalt
f72c856009 Merge "Fix build" 2014-06-12 05:34:42 +00:00