Framework: Add Power Widget (Phone)

This commit adds the Power widget for phones.  All toggles should work
except for LTE (disabled for now)

Patch set 2  - Fixes Sync toggle
Patch set 3  - Removes WIP
Patch set 4  - Rebase
               Switch to MultiSelectListPreference

Change-Id: I17669420d9db9a347af182fc398c6426e18534f4
ADB Over Network, integration of the adb-host mode (already present)

The feature can be used/tested without the Settings part :

  setprop service.adb.tcp.port 5555

Note: This ADB setting is not persistent (for security purpose) and
require init.rc implementation event like this : http://bit.ly/AdbTcpIP

Note : ADB_PORT setting key was added in the commit a6c11c9d

Change-Id: I5c61a53948349c785356cb5aae165110d75e3074
Signed-off-by: Tanguy Pruvot <tanguy.pruvot@gmail.com>
Merge "ADB Over Network, integration of the adb-host mode (already present)" into jellybean
Display Unicode name for China Operators.

The operator name is displayed in the phone using latin
characters by default (the SPN field). The SIM can be
configured to display a unicode name instead using the
PLMN field. However, many Chinese operators requires
this to be a customizable setting as well.

A property, ro.operator.use-plmn, can be set to override
default behaviour and display operator name as unicode
is introduced.

Change-Id: I0b2183cc40fd76bee88ffbe98b99a1d6fa9e2f5b
Merge remote-tracking branch 'cm/jellybean' into jb-dev
Sensor: Add RotationVectorSensor2

Some ICS apps (namely, Google Maps) expects a rotation vector to be
available. Newer devices, this is provided by either Android's
sensor fusion (requires Gyro) or by hardware sensor fusion (MPL).

Older devices will lack this virtual sensor and compass in Google
Maps will not work. To fix this, we can provide our own rotation
vector sensor by converting the values from the orientation sensor.
(They are basically the same information in different formats.)

Thanks to Unhelpful for the help with related math.

Change-Id: Id3bad65659174a08cfe945e9af6e48ca012a5135

(cherry-picked from ics)
Adjust kernel data stack TCP parameters to optimize performance

Enhance Android MobileDataStateTracker class to identify technology
EVDO rev B separate from earlier releases.  This permits use of
separate TCP buffer size for higher bandwidth technology.

Change-Id: Ib8dfa315c4485c36c66b2c66950c42ccb81fe9e5
CRs-Fixed: 260740
frameworks/base: Fix screen stretch issue for NuPlayer

- Fixes screen not moving to full screen after suspend resume during RTSP
  streaming in landscape mode.
- If there is an incorrect height and width, it saves the video height and
  width and then does the correction to have proper width and height.

Change-Id: Icb4b9b71f21d138b85f200dc82a1fbe58342866f
Kill App on Long-Press Back Key (framework)

Change-Id: Ib78fff9e32d95a0a112ddd9274b79b3a3aa626b9

Conflicts:

	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

Long press to kill

Bring changes done in cm7 to ics.
- Vibrate on press
- Show message
- http://review.cyanogenmod.com/#change,5191,patchset=2

Change-Id: Ib1e5eba50cef5d72d81b733f87ac39c09d4212de

Long-press back kill app cleanup

Change-Id: Ida791dca1fbfdc2beccf6ff727b67df56f1956a4

framework: customizable kill app via back key timeout

Allows the time it takes for the back key to kill an app
to be customized via overlay.

Change-Id: Iaa43f81ee448ae7a7663254a830011a0bca5e60f

Conflicts:

	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

Change-Id: Ida791dca1fbfdc2beccf6ff727b67df56f1956a4
Framework: Add missing part of 'Lock before unlock'

Keyguard: Turn lock-before-unlock into a user-configurable setting

Showing the unsecured lock screen (Slider/widget screen) before the
security screen is now a secure Setting (still defaulting to off)

Change-Id: I0a11f82ffe074d289129b2b972ffc0135eea81ed

Other parts were merged already
Framework : Lockscreen - Customizable shortcuts

Allow users to choose lockscreen shortcuts / icons :
	Phone - 1-5 targets
	Tablets - 1-8 targets

Change-Id: I9b163efeef8f47b1d21f7f61552ebe424049cfeb
PowerWidgets : Consume free space when disabled

Eliminate free space when the notification widgets are disabled.

Patchset 2 - Restore import order

Change-Id: Ic844fedd407a8ee363e3de97370d6b264fe045d5
Fix don't interrupt ongoing PIN/PUK verification

This fixes an issue which only occurs if
1. you use a SIM PIN
2. the PIN verification takes longer than the screen timeout is. e.g. when then screen turns black while "unlocking SIM" message is displayed!

It might be possible to simulate the bug by pressing power quickly after the PIN has ben entered and "unlocking SIM" message is still being displayed.

If the PIN verification takes longer thant the screen timeout is then the screen turns black.
If that happens LockPatternKeyguardView.reset() is called which then forces a re-creation of the view. But then the original created
SimUnlockScreen.onSimLockChangedResponse callback never receives the success message for the SIM unlock.
What then happens is that the LockPatternKeyguardView is re-created again and again whenever screen turns off while waiting
until we receive a SIM state changed event e.g. until we are back on network.
But when that happens we are presented the pattern unlock screen. With a single touch we can then (finally) get on the homescreen.

The fix removes the forced re-creation of the LockPatternKeyguardView if there is a PIN/PUK verification in progress. Which leads to a 'normal' unlock behavior:
1. enter pin
2. "unlocking SIM" message is displayed
3. maybe screen turns off after timeout
4. after some seconds you get on the homescreen directly

former ICS submission: http://review.cyanogenmod.com/#/c/19243/

AOSP: https://android-review.googlesource.com/#/c/32310/

The issue is still present when using jellybean code.

Change-Id: I1f9bb26105d07c72b59bdec064e9e93cbdc918c4