Avoid divide-by-zero exception when printing process state

Change-Id: Ifa1c64ff6917c3a6f7d72a92862b48eec2540afd
Frameworks/SystemUI: Hide expanded dialog when screen is off

Hide the expanded dialog while screen is off. Otherwise it
causes continuous buffer updates to SurfaceTexture
even when SCREEN is turned off and while In-Call causing a
spike in power consumtion. This fix ensures that the
power consumption is kept to a minimum in such a scenario.

CRs-Fixed: 339815

Change-Id: Ib9154528d4f88ba12ca234be7f929a61ed098be7
Fix contact lookup with CLIR prefix

Allow phone numbers which are saved in the phonebook including a
CLIR prefix to be correctly resolved on an incoming call.

For a proper fix, all special cases detailed in calledPartyBCDToString()
should be taken into account; unfortunately that function cannot be
directly used as it currently is.

Change-Id: Ie070e1efc0921bfb0ae0802f500afced5071a652
surfaceflinger: Enable dithering if persist.sys.use_dithering=1

* fixes color banding
* needs reboots after changed (caches variable for performance)

Change-Id: I66de607b149ec4e01967febeec234ef2994d20a4
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: I596f5dc44f8797bc280ae5d1e110bb92387c79d1
AudioManager: Handle KEYCODE_VOLUME_MUTE

Implements muting in KeyguardViewBase and PhoneWindowManager too.

Change-Id: I732ac5c918ed66ebd9376ccad7bcc0cf88cad778
Add option for switching between UMS and MTP/PTP mode. (1/2)

This adds support for switching between UMS and MTP/PTP.
Framework part (this part) will only enable UMS if the config setting is set.
Standard is to enable UMS if the primary volume supports UMS.

p2: Fix compile error
p3: Some code styling
p4: Fix mysterious bug where USB notification is not fired when switching from UMS.
p5: Revert last commit.

Change-Id: I753b7dd3823958da1b043ca44b50118d67637cc1
Make the volume overlay more functional 1/2

This Patch is to add new Volume Overlay Styles

 * Make the Icon on left touchable to go to Sound Menu
 * Always show the Phone Ring volume in expanded (for devices that have phone)
 * Always show the Alarm volume in expanded mode
 * Put an Option in Sound menu to choose a Style (see 2/2 patch)
    - Single : as default
    - Expandable : Enable the more link to expand all choosen volumes
    - Expanded : Show all volumes
    - Off : show no overlay
 * Fix a BUG that when you linked the volumes you got 2 phone icons
 * Fix a BUG when linked all volumes did not move when using hard buttons
 * Fix a BUG when you drag when linked, other expanded did not move
 * Added a default mode so non-telephone devices get Expandable by default

Note : When you are using BT in phone call
or the phone normally there is an extra expanded volume

Change-Id: Ie716e55ba6d4e89a1a67c59b9934d4e088833c5b

Conflicts:

	core/java/android/provider/Settings.java
Frameworks: Custom carrier text in notification pulldown 1/2
Show dock battery level if available

patchset 1: Initial commit without icons
patchset 2: Add icons
patchset 3: Remove nested layout

Change-Id: Ie853087999d929579ececf3f6b3b01ced32dff85
Increase size of the tablet status bar settings

At 280px the status bar settings needs to be scrolled
quite a bit in order to see the available toggles.
~380px should be the limit for a 1024x600 7" tablet

1280x800 10.1" tablets could overlay this with 480px
and it will still fit.

Change-Id: I9d4b9a882c28bebfe636d9f29e42eafd21ce189a
Handling EGL_BAD_ALLOC egl error as return from swap

Some GL apps are not closing properly espacially while
forcefully closed.Cause unnessary swap command from
GLSurfaceView and returing EGL_BAD_ALLOC as error that is
not handling in GL thread and leads to uncaught exception

CRs-fixed: 335039
(cherry picked from commit 46cc8d1f506fabd04e3e192511ab715a22ff92ea)

Change-Id: I92d08b6328a0055687ad99b9413a97ec7025e0cd
frameworks/base: handle supplicant termination in p2p modes

In p2p mode if supplicant terminates,

 -reload wlan driver
 -restart dhcp server, if in go mode
 -restart dhcp client, if in client mode

This is to start p2p sessions in a clean state after a fatal
error, that required supplicant to restart.

CRs-Fixed: 337607
(cherry picked from commit 9baa04cb32ac2128ed520e5a8c4eb13e6fc50a1f)

Change-Id: I00882e512a21ef743cacb00401383e0c8dba50cf
Bugfix : Expanded volume overlay

If you switch to the Expanded volume overlay
(Settings > Sound > Volume panel)
from any of the other settings that are not expanded
then the Expanded overlay appears collapsed.

The only way to make it appear expanded is to restart the framework
or
In the Expandable view - expand the volumes - then immediately change.

This patch fixes this and also has a slight improvement in the
case where a user selects the same choice they have already.

Change-Id: I9264ce62e239f497e0a2924c6769f066f196ebeb
Merge branch 'ics' of git://github.com/CyanogenMod/android_frameworks_base into ics
Disable UMS splash when phone in locked state

Currently devices which use UMS will display the UMS toggle screen
over the lockscreen. This would allow unauthorised users to access
the contents of the SD card, when plugged into USB, without first
unlocking the device.

Disable the UMS splash if the phone is in a locked state.

Change-Id: Ic18462758344c327e70e6a70d674f08d8ad51cb0
Notification light(LED) settings: package mapping

Credit for this code goes to Marko Mihovilic

This commit allows for framework side override of the application
package name set for Notification light led overrides.  This is used
in cases where the user selectable application sends its notifications
via another package.

Specifically:  GTalk (com.google.android.talk) sends notifications via the
Google services framework (com.google.android.gsf).

Patch set 2  - fix derp and whitespace cleanup
Patch set 4  - fixed another derp
Patch set 5  - fixes typo in comment
Patch set 6  - remove Log.d line
Patch set 7  - allow specifying default values in application notification
               overrides

Change-Id: I0c13ae3acefa0bcb4ffb46ea7eae301081d9f8f6
Merge "Avoid divide-by-zero exception when printing process state" into ics
audioflinger: Optimze ditherAndClamp with ARM NEON

Change-Id: Ifc436e39f15b103cec404e8a81fa8b8a6b5f0e5f
Merge "Fix contact lookup with CLIR prefix" into ics