21538 Commits

Author SHA1 Message Date
Paul Jensen
43564472ee Remove dead code, mostly DataStateTracker.
(cherry picked from AOSP commit 7fad4eb4b52bc6c7ddad47f70e0c310093fbde3b)

Change-Id: I18c44cd08dfb51e02a96d0b726e9af1db21e3058
2015-03-18 12:29:13 -04:00
Lorenzo Colitti
3698af5f64 DHCP: Don't write options longer than 255 bytes.
Change-Id: Iddc971c7ac97253af3063850cde3dee10c3829ff
2015-03-17 19:56:34 +09:00
Lorenzo Colitti
2ed489f410 DHCP: parsing robustness fixes.
1. Check the length of the fixed-length portions of the packet.
2. Catch BufferUnderflowException while parsing options.

Change-Id: If907f49f02a04a4a3360f46a3192e94ab099af0e
2015-03-17 19:46:14 +09:00
Lorenzo Colitti
a071edce46 DHCP: Add a Java DHCP client.
The behaviour of the client is intended to mirror the behaviour
of the current DhcpStateMachine + dhcpcd combination, except it
does not store leases across network changes.

Bug: 19704592
Change-Id: I110b58003da2d8293059d48a0181e16f7f7f145c
2015-03-17 19:46:13 +09:00
Lorenzo Colitti
04b8d3aab6 DHCP: protocol changes.
1. Define and add parsing code for MTU, max message size, T1, T2.
2. Add common TLVs (message size, hostname, vendor ID) to all
   packets sent by the client.
3. Don't include requested IP and server ID in renew messages,
   since the RFC says MUST NOT.
4. Don't hardcode the broadcast flag to true in DISCOVER packets,
   use what the caller passed in.
5. Make some methods static.

Bug: 19704592
Change-Id: I42a0997e468b12e19cad9b403b98fe266e6cea73
2015-03-17 13:21:21 +09:00
Lorenzo Colitti
29cb944bef DHCP: glue code.
1. Add a method to make a DhcpResults object from a DHCP packet.
2. Add a method to fetch the client MAC from the packet. This is
   needed to check that the message is for us (lots of DHCP
   messages are broadcast).
3. Add a length argument to the method that parses DHCP packets,
   so the caller can use the same MTU-sized array all the time
   instead of having to pass in a new array for every packet.

Bug: 19704592
Change-Id: I58223f5ec90fb5c762bc2934649e02f9122018b2
2015-03-16 22:35:19 +09:00
Lorenzo Colitti
15204d50b4 DHCP: Ethernet/IP packet header changes.
1. Support L2_ENCAP when building packets as well as when parsing.
2. Skip IP options when parsing DHCP packets.

Bug: 19704592
Change-Id: Ic27a45790ed1cf7cf5b82d63b6c0b64c909a570f
2015-03-16 21:57:00 +09:00
Lorenzo Colitti
c8a0f49fee DHCP: Minor cleanups to the packet code.
1. Delete the DhcpStateMachine, since we don't plan to use it.
2. Make all InetAddresses Inet4Addresses, since that's what they
   are.  In order to do this, define INADDR_ANY and
   INADDR_BROADCAST, constants, since Inet4Address.{ANY,ALL} are
   not Inet4Addresses but InetAddresses.

Bug: 19704592
Change-Id: I5a0499be889076992a60aaad0bd8be5ea66bd560
2015-03-16 20:08:47 +09:00
Lorenzo Colitti
c95a87f30d DHCP: Move the packet code to frameworks/base/services.
There's no need for it to be in frameworks/base/core, since it
will only be used by services.

Bug: 19704592
Change-Id: I2f5277eca848b7000ca46db575e8602eacb5c8bd
2015-03-16 20:08:46 +09:00
Vinit Deshpande
3cb5e4d72f am "get channel list from driver for SoftAP channel selection"
merged from partner/m-wireless-wifi-dev
18ae1d2 get channel list from driver for SoftAP channel selection
2015-03-09 19:01:35 -07:00
Vinit Deshpande
b4499afde5 am "set softAP on a specified band, including both 2.4 and 5 GHz band"
merged from partner/m-wireless-wifi-dev
a0be0fb set softAP on a specified band, including both 2.4 and 5 GHz band
2015-03-09 19:01:31 -07:00
Lorenzo Colitti
f4f93b227f Enable Ethernet if the device has FEATURE_USB_HOST.
Any device that supports USB OTG is capable of running Ethernet
via a USB OTG cable and Ethernet to USB adapter.

Currently, we only start the Ethernet system service if the
device has FEATURE_ETHERNET, but this requires that every device
explicitly declare FEATURE_ETHERNET, which causes bugs like
http://b/18515146 , where the L OTA broke Ethernet on nakasi.

Therefore, start the Ethernet service on all devices that have
FEATURE_USB_HOST.

Bug: 18515146
Change-Id: I3b4e85d1ad8e1aea9baa046a27f5b4dd68c42028
2015-03-05 14:52:04 +09:00
Shishir Agrawal
335b59f847 am bcced5b8: Merge "Fix incorrect condition for sub id check." into lmp-mr1-dev
automerge: 4322c8d

* commit '4322c8d54ef935a3224c8fcbf7ab55ac48f34f1b':
  Fix incorrect condition for sub id check.
2015-03-03 03:11:47 +00:00
Shishir Agrawal
4322c8d54e am bcced5b8: Merge "Fix incorrect condition for sub id check." into lmp-mr1-dev
* commit 'bcced5b834e49bf3a0b57a0009958ba061d31e76':
  Fix incorrect condition for sub id check.
2015-03-03 02:54:12 +00:00
Ihab Awad
c4959abf5f Changed package name of a Telecom service
Change-Id: Ib8d5b73a3cdb2aa353c586dccf423a8917a393d6
2015-03-02 20:41:07 +00:00
Lorenzo Colitti
35e36db1d7 Separate NAT from forwarding.
Bug: 19500693
Change-Id: I39878644e21d51def1c31d1857e815f473ef0938
2015-02-27 15:53:28 +09:00
Nilesh Poddar
f3d4a58519 Append forwarder name to ipfwd command
Pass the name of entity that is requesting to enable/disable
ip forwarding

Change-Id: Iaf04768a23c417eb7d40af776c6fc76efaa67bb7
2015-02-25 10:37:36 +09:00
Junda Liu
985f52cde5 Fix incorrect condition for sub id check.
Bug: b/19277299
Change-Id: Iea6806926f0e9d9404a3f2613d03b8a0607fea54
2015-02-23 16:06:51 -08:00
Craig Mautner
ca0653a424 Do not make ActivityContainer available to apps. DO NOT MERGE
A security leak was discovered whereby a malicious app could get the
IActivityContainer object from one app and use it to inject events
into another app. This fix removes the availability of the
IActivityContainer and replaces its one use with a method for
returning the information the IActivityContainer was used for.

Fixes bug 19394591.

Change-Id: Ib3cec25b25130cd8e098892c057742cfd575cfdd
2015-02-17 20:41:39 +00:00
John Spurlock
dfc0a778d4 am f45e5dbf: Merge "NoMan: Initialize filter value reported to listeners." into lmp-mr1-dev
* commit 'f45e5dbf599a0043d7f6576f20eafb2c1c157204':
  NoMan: Initialize filter value reported to listeners.
2015-02-12 22:58:14 +00:00
John Spurlock
f45e5dbf59 Merge "NoMan: Initialize filter value reported to listeners." into lmp-mr1-dev 2015-02-12 22:52:13 +00:00
John Spurlock
f370177e94 NoMan: Initialize filter value reported to listeners.
In addition to relying on change callbacks.

Bug: 19288429
Change-Id: Id54473e5fbb4eac3778781a2052ba0103076f8d1
2015-02-12 13:29:37 -05:00
Lorenzo Colitti
be828a3ba6 am c7ccc393: Merge "Make reportInetCondition revalidate if the report differs from our state" into lmp-mr1-dev
* commit 'c7ccc393b470220710f566d447412d93f7f8d21b':
  Make reportInetCondition revalidate if the report differs from our state
2015-02-12 02:43:45 +00:00
Lorenzo Colitti
c7ccc393b4 Merge "Make reportInetCondition revalidate if the report differs from our state" into lmp-mr1-dev 2015-02-12 02:30:56 +00:00
Michael Wright
a79a38b2ac am 3292c0e2: Merge "Stop active media projections on user switch." into lmp-mr1-dev
* commit '3292c0e2640667e5ef78896653a41c85e7de06c5':
  Stop active media projections on user switch.
2015-02-11 20:09:35 +00:00
Michael Wright
3292c0e264 Merge "Stop active media projections on user switch." into lmp-mr1-dev 2015-02-11 18:23:55 +00:00
Jeff Davidson
ab3356d0dd am 50996a12: Merge "Do not enforce CONTROL_VPN for calls from lockdown VPN." into lmp-mr1-dev
* commit '50996a12a8e859346d5eb3c4569c4e81c9b52a05':
  Do not enforce CONTROL_VPN for calls from lockdown VPN.
2015-02-11 08:32:01 +00:00
Jeff Davidson
50996a12a8 Merge "Do not enforce CONTROL_VPN for calls from lockdown VPN." into lmp-mr1-dev 2015-02-11 08:25:27 +00:00
Jeff Davidson
b21298a686 Do not enforce CONTROL_VPN for calls from lockdown VPN.
Clearly document which methods in Vpn.java are designed to be used to
service a Binder call, and which must therefore check permissions and
clear the calling identity, and which methods are designed for
internal use only and which therefore need not check permission.

Add a new startLegacyVpnPrivileged method which bypasses the
permission checks, to be used by lockdown VPN which is a trusted
system service. Ensure that the existing startLegacyVpn method checks
permissions as this is used whenever we respond to a binder call.

Bug: 19311172
Change-Id: I34f13258ee7481f1356bc523124cf5db068b4972
2015-02-10 23:41:42 -08:00
Lorenzo Colitti
5984dabc77 am c38b90bb: Merge "Make getNetworkInfo() take into account VPN underlying networks." into lmp-mr1-dev
* commit 'c38b90bb6bc5efc5f07e69b86d10f76a1eaa9eb4':
  Make getNetworkInfo() take into account VPN underlying networks.
2015-02-11 07:24:37 +00:00
Lorenzo Colitti
c38b90bb6b Merge "Make getNetworkInfo() take into account VPN underlying networks." into lmp-mr1-dev 2015-02-11 07:18:17 +00:00
Shishir Agrawal
438a92cd06 am 64ce5f8f: GpsLocationProvider: Read data enabled status from TelephonyManager.
* commit '64ce5f8fab077e4792737f86502d0e77ad6cbb0b':
  GpsLocationProvider: Read data enabled status from TelephonyManager.
2015-02-11 03:38:07 +00:00
Shishir Agrawal
64ce5f8fab GpsLocationProvider: Read data enabled status from TelephonyManager.
Bug: 18814559
Change-Id: I0333050d2a5b8d484466e1b1914dcfb9965398c9
2015-02-10 19:20:16 -08:00
Lorenzo Colitti
0831f66f19 Make reportInetCondition revalidate if the report differs from our state
1. If reportInetCondition says the network is not working, and
   the network is already marked not validated, don't revalidate
   it. This was superfluous and should save battery.
2. If reportInetCondition says the network is working, and the
   network is not marked as validated, revalidated. This will
   allow us to get out of a validated state quickly based on app
   input (e.g., allowing GCM's exponential backoff timer to drive
   revalidation instead of our 10-minute timer).

Bug: 19258761
Bug: 19209043
Change-Id: Iaa4bac82d117ed1f4088dab106e6f6ce46b34bc3
2015-02-11 11:03:50 +09:00
Lorenzo Colitti
d6a7980dd9 Make getNetworkInfo() take into account VPN underlying networks.
If a user is subject to a VPN, getActiveNetworkInfo() will return
the VPN's underlying network (e.g., TYPE_WIFI), so that apps that
call getActiveNetworkInfo to answer questions like "is the device
connected to wifi?" will continue to work. Make getNetworkInfo
do this as well: if the query is for a network type that is
underlying the current user's VPN, then return that network.

Bug: 19196545
Change-Id: Ic5a651735b927c758594a26d26a03fbd704b52e6
2015-02-11 10:21:01 +09:00
Rubin Xu
cd6bf02486 am 3d521c0a: Merge "Perform post installation operations directly if backup manager is disabled" into lmp-mr1-dev
* commit '3d521c0a0165dfef53e3c9d3d562bc0ec45405a8':
  Perform post installation operations directly if backup manager is disabled
2015-02-09 19:33:48 +00:00
Rubin Xu
99abeed2bb Perform post installation operations directly if backup manager is disabled
bug: 19312753

Change-Id: I4acdd1e3af6a6be0c51affc42de167993c736b2f
2015-02-09 15:36:30 +00:00
Michael Wright
05aab5810a Stop active media projections on user switch.
Bug: 19278080
Change-Id: I63cc8aa12954d4de257b793967d3845a6f86dc3f
2015-02-06 14:08:13 -08:00
Dianne Hackborn
56bc4906d7 am 5c2fdc33: Merge "Always re-establish kernel alarms when considering new alarm set" into lmp-mr1-dev
* commit '5c2fdc331f81b671d426f3f5a7e59cd9cbed80bf':
  Always re-establish kernel alarms when considering new alarm set
2015-02-05 19:40:20 +00:00
Dianne Hackborn
5c2fdc331f Merge "Always re-establish kernel alarms when considering new alarm set" into lmp-mr1-dev 2015-02-05 19:26:32 +00:00
Kenny Guy
1b8945942d am 8d12d3da: Merge "Only switch user if current user is being wiped" into lmp-mr1-dev
* commit '8d12d3da15a92fde05256c51f8a3085ab9399c0f':
  Only switch user if current user is being wiped
2015-02-05 15:27:27 +00:00
xinhe
18ae1d2207 get channel list from driver for SoftAP channel selection
Instead of hard coding the available channel list, we should
get channel list from driver

Bug:19237543
Change-Id: Id2ec689273407f54709cb034d6ba666f91da51c0
2015-02-04 17:19:33 -08:00
Christopher Tate
c83d3e4b72 Always re-establish kernel alarms when considering new alarm set
As a backstop against missed alarm delivery / wakeups or clock slew,
make sure to always schedule a kernel alarm for the next alarm events
of interest when we've reexamined the set of deliverable alarms.

Bug 19201933

Change-Id: I3cd37a63dfb0c8258941497d4ba516ed00e2edad
2015-02-04 13:48:29 -08:00
Kenny Guy
e9acb59a91 Only switch user if current user is being wiped
Only try and switch to owner if the current user
is being removed.

Bug: 19252449
Change-Id: I0143d87360db0834876821cbf52fec4933ecbd35
2015-02-04 17:55:42 +00:00
Paul Jensen
8ad51b5672 am 39ae0547: Merge "Facilitate network validation on networks with a per-network PAC." into lmp-mr1-dev
* commit '39ae0547ca5a1e7cfe24a945b2f8a910e09b7f3c':
  Facilitate network validation on networks with a per-network PAC.
2015-02-03 21:13:41 +00:00
Paul Jensen
39ae0547ca Merge "Facilitate network validation on networks with a per-network PAC." into lmp-mr1-dev 2015-02-03 21:08:59 +00:00
Paul Jensen
8fe1742946 Facilitate network validation on networks with a per-network PAC.
On networks with a per-network PAC, Network.openConnection(URL) will
fetch using NO_PROXY.  This will fail on networks where Internet
access is only permitted via the proxy.  Always failing network
validation has the potential to disable WiFi auto-join.  Instead
of performing the normal connectivity check, instead attempt to
fetch the PAC, as this is meant to succeed with NO_PROXY.

bug:19143573
Change-Id: Ia482f5c046d338c27daf42571f20851dfa36671c
2015-02-03 11:28:55 -05:00
Svetoslav
f855a3ce17 am ded133c4: Fix broken activation of the selected view in accessibility mode.
* commit 'ded133c446fa9d0d23e6bde19a66fb2ce3980491':
  Fix broken activation of the selected view in accessibility mode.
2015-02-03 12:11:48 +00:00
Svetoslav
ded133c446 Fix broken activation of the selected view in accessibility mode.
We were using an approximation to determine where to send a pair of down
and up events to click on the view that has accessibility focus. We were
doing reverse computation to figuring out which portion of the view is
not covered by interactive views and get a point in this region. However,
determining whether a view is interactive is not feasible in general since
for example may override onTouchEvent. This results in views not being
activated or which is worse wrong views being activated.

This change swithes to a new approach to activate views in accessibility
mode which is guaranteed to always work except the very rare case of a
view that overrides dispatchTouchEvent (which developers shouldn't be
doing). The new approach is to flag the down and up events pair sent
by the touch explorer as targeting the accessibility focused view. Such
events are dispatched such that views predecessors of the accessibility
focus do not handle them guaranteeing that these events reach the accessibiliy
focused view. Once the accessibiliy focused view gets such an event it clears
the flag and the event is dispatched following the normal event dispatch
semantics.

The new approach is semantically equivalent to requesting the view to perform
a click accessiblitiy action but is more generic as it is not affected by
views not implementing click action support correctly.

bug:18986806
bug:18889611

Change-Id: Id4b7b886c9fd34f7eb11e606636d8e3bab122869
2015-02-02 23:17:17 +00:00
Jinsuk Kim
b70233d23a am 3457ae47: Merge "Revert "CEC: Let playback device switch TV input after bootup"" into lmp-mr1-dev
* commit '3457ae4709c8444f8ff9cdaf5809d6164f3bd21a':
  Revert "CEC: Let playback device switch TV input after bootup"
2015-01-30 22:09:31 +00:00