Framework: Add the ability to enable/disable use of Profiles (Part 2/2)

This will remove the Profiles item from the Power menu when the user has
selected to disable the use of System Profiles.

TODO: Better handling of returning a default profile when requested

Patchset 1-4: Initial commit
Patchset 5  : Additional error checking to prevent profile changes
Patchset 6  : Remove WIP
Patchset 7  : Workaround for NPE when no profile returned as our
              null checking in profiles is not the best
Patchset 8  : Rebase
Patchset 9  : Remove enabled checking code from getActiveProfile()
Patchset 10 : Create and return an Empty Profile if profiles disabled
              This should fix all the NPE's

Change-Id: I3c29b1bbd8f72c5432a1906a6b412d9412279c9f
input: Fix workaround for broken hardware keyboard support

Using a wrong reference to mHardKeyboardAvailable caused device config
to never report physical keyboards.

Change-Id: I9b64e2d89512436c17fa8929464e2b727fba1cf3
Option to hide Adb notification icon (framework)

Change-Id: Ie5325b3c6cde64be8d36f6afc4e747addb5ce8df
Fix button backlights that depend on ALS.

On a few devices, lighting the buttons when the screen turns on
depends on the lightsensor, regardless of the user preference.
So go back to enabling the sensor whenever the screen turns on, and
enforce the user preference after running through the light settings
once.

Port from CM9.

Original: http://r.cyanogenmod.com/#/c/12818/

Change-Id: Ibb9155b4f299637d553986c44b9cb548dc855489
SamsungRIL: cleanup

Removed unneeded states and forward them to RIL. In ics, this had
the side-effect of allowing STK to work due to the Samsung STK
implementation already in place

cherry-picked from ics

stk functionality for SamsungRIL

* Implemented SMS based SIM application functionality
* PatchSet 3: Added fix so unknown unsolicited response are sent to super class
* PatchSet 4: Removed "import android.content.resources" - not needed any more
* PatchSet 5: processUnsolicited cleanup, using super class standard states where possible
* Patchset 6: Rebased

Change-Id: I9bf844da1480fe442f851fb20d99b530b96cfa4c
SamsungRIL: Update HSDPA checking for jellybean

Jellybean no longer publish network type id to prop, don't check for it

Change-Id: I689aa448853677a8719af963bf3370abaefdaf23
implement noise suppression for phone calls (1/2)

Change-Id: I3604c51aae676025d29511f0547e755e42d56b38
api: Remove non-standard entries, revert to the 4.1.1 standard

hide ALL the things! _o|

Change-Id: I8d7c38e395f64c6b0622d556a5fe45b135563467
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
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)

Change-Id: Ib0eeb683e3177d96b9b2c7bc2916b19ddaec8ae5
Framework: Fix NPE in notification manager if profiles disabled

No active profile group is returned and a NPE is triggered when a
notification override is being set

Change-Id: I8ca44567706ba9b57fc70c5513c3249eaf29eb73