Merge pull request #2 from corcoran/jb

framework: Add home button unlock option (1/2) @invisiblek
CatService: fix typo

Change-Id: Ic398555349bb2ae5fb7fe754fc48d69d391b2831
Fixed a typo in error message

Change-Id: Ifbc6cfaf09e384953d778e18b9355e7d4013bdd6
LocationManagerService: Respect the type of NetworkInfo that was passed

The location manager service which sends network info updates to the
gps location providers was changed to ignore the connectivity update's
type and just fetch the dominant network info, but this is a problem
since we want SUPL updates even if it's not the dominant network type.

This change makes it fetch the latest info about the network type for
which the update was actually intended.

Change-Id: Ic8e78482f584de3143a6b815361f6b6d49c498b5
SettingsProvider: Revert default WiFi sleep policy to "never"

Change Ie459b8e70fdbc7c605452fe0692d7bc26460e939 has the side effect of
altering the default WiFi sleep policy back to "default" (off when screen
turns off), which is contrary to the policy of "never" established in
I0598af41fe0144f2dfddc5bd331bd91d91e0ffea.

Change-Id: Id8b6a1abbf27ca653277399a0d8c84a121ff93c8
SECURITY remove lock pattern from being logged

commit Ibc0d5bfcee9673b1bf049bd69be80d2312602a47 made it so that the
lockpattern was loged in logcat as it was entered.
I'm really surprised nobody caught this.
This could also be solved by commenting the code out or just removing the line
without breaking anything.

Patch Set 3: Remove logging

modified:   core/java/com/android/internal/widget/LockPatternView.java

Change-Id: I2544eb11a2b003ef2d303470b19633241867fc29
Bugfix: Dock events can have state greater than 1

On Samsung devices the USB audio is being routed for every dock event
It is ignoring the checkbox (in advanced settings) to not route audio

This bug was introduced with this patch
http://review.cyanogenmod.com/#/c/24830/

The state of an event can be 2 or 4 depending on the dock type

This patch switches for looking for state > 0 rather than  state ==1

Change-Id: I978d18ec36e74e821a6d300136377158901cdf50
Call to equals() comparing different types

I have found the bug with the FindBugs tool (http://findbugs.sourceforge.net)

Call to String.equals(android.content.ComponentName)
at ActivityManagerService.java [line 8874]
in method dumpActivitesLocked(..)

Change-Id: I99851de024b55b53f1b206f0645b6fe29f865784
NullPointerException in UsbStorageActivity and SQLiteSession

FindBugs description:

Null pointer dereference
A null pointer is dereferenced here. 
This will lead to a NullPointerException when the code is executed.

Bug kind and pattern: NP - NP_ALWAYS_NULL

Change-Id: I292a29058de1828f376564188a2e00c61ea194b0
fix a misspelling / typo.

Change-Id: I24f206fe6e8077387112b9ea420752ede1ed4ec4
Add SET_ALARM permission for SystemUI

If one or more third-party alarm clock app is installed, clicking clock should open an app chooser for the alarm clock. However, permission for com.android.alarm.permission.SET_ALARM is required to make this behaviour work properly.

See http://forum.xda-developers.com/showpost.php?p=33155463&postcount=2749 for symptom if this permission is not assigned.

Change-Id: Iaf8cb9aba6e53da021da5373493b1419096e91fa
Possible NPE in ChooseAccountTypeActivity

Change-Id: I8d36717cc9b74f62ac90eae22225424f57fb9d05
Possible NPE in ActivityManagerService

Change-Id: Ib3effa9b2dc371b0678b9cf645d4c927684c01d1
Possible NPE in RuimRecords

Change-Id: I3ac7754ce18b540325e09e0bdcfff926239c8240
Copy-Paste bug in IconUtilities

Change-Id: I9c48d9e4682e1322d22b13be02d9214755685274
SQLiteSession: Use hasNestedException() method instead of direct check

See: https://android-review.googlesource.com/#/c/45433/

Change-Id: I2e025b249cc1c487116fc4abadaf9326b1f98563
LocationManagerService: The "value" was used as a Map.remove(key) method parameter.

Change-Id: I83679d41576c609a7f7e0556c36df796666c1f59
frameworks/base: Add support for wired headset detection

Change-Id: Ia6f26af85aded9decbce93fc2f381f39ff9ab81b
EventHub: Modify the keyboard layout file name for headset button

The keyboard layout file name was formed based on the name of
tabla sound card on current machine. If it doesn't find such
file, it is going to use Generic keyboard layout where the
key mappings are different, even though the scan code is same.
The sound card name differs across different machine types.
So, generalising the keyboard layout file name will work across
all machine types.

CRs-fixed: 344297
Change-Id: I416b6179f51ac98fe7dfae5268ffb58c243540a4
frameworks/base: Fix for headset switch detect

- Headset Switch detect is not functional
- Headset driver on modem in 8x25 and 7x27A targets
  introduces a delay of 500ms before reporting headset
  events to application processor to avoid the problem
  of spurious interrupts being reported due to hardware
  limitation on these targets. Frameworks code in JB
  treats button release event received after 500ms after
  button press as long press event and generates WEBSEARCH
  event. Due to this all the events in 8x25 and 7x27A
  are interpreted as long press events.
- To avoid this problem increase the timeout to more than
  500ms by introducing headset hook delay property for
  these targets.

CRs-fixed: 387247
(cherry picked from commit 5878d849442af33378805f7b9964102119c2fc93)

Change-Id: I03a77666bb217168f7c362bd775dadfbe09fe638