Frameworks: fix typo

causes broken backlight on hardwarekeys
if it is set to always on

sorry for that

cheers

Change-Id: I4747239f681f4714ac1ab767a1be48219e1b620f
Don't assume any ringtone is present on external storage.

If that assumption doesn't hold true, the user will lose his ringtone
and won't know why.

Change-Id: I89409e1351792d020c5458f5104f4bb9f2a040f2
Expand Profiles [1/2]

This commit expands the profiles power menu entry in the to be
- Always hidden
- Hidden only on the lockscreen
- Always show [not applicable to secure lockscreen]

Change-Id: I2e7262abc4043523150e96b330f92c8c042d1d2a
Lockscreen : Fix widgets disabled

Currently, when keyguard widgets are disabled via the DevicePolicyManager,
a default widget if specified via widget_default_package_name/widget_default_class_name
is added on the main screen, and if not successful the default status widget is added.

However in its current state, each cycle of the lockscreen alternates between the two widgets.
Reason is, the default app widget is constantly recycled on screen power cycles, and in such events,
when checkAppWidgetConsistency() fails to add the widget (since the id is no longer valid), it toggles
back to the default status widget, and resets the stored id. Next cycle a new id is allocated and it works
and so on ...

This patchset addresses this issue by not removing the default status widget if not necessary, hence
preserving its id and fixing the toggling issue.

Change-Id: I6b21d18346fed5accc72141097939c92ee9aaa3c
Merge "Lockscreen : Fix widgets disabled" into jb4.2
Add Statusbar Quick Peek [1/2]

Adds the ability to peek at the statusbar when hidden
by swiping down from the top edge of the screen.

PS 1/3 : Fixed Derp!
PS 4   : Added Fullscreen app support!
PS 5   : Added Pie Detection
PS 6   : Derp forgot the TOP Flag!
PS 7/9 : Some fixes

Change-Id: I4beda91e21518cd2fa391ff1b0fe23ea8e24370e
Frameworks: reduce navbar observer footprint (1/2)

time for code cleanup projects. Switch to same
logic we already use in QS/NT shortcuts. Use
only one string for the whole navbar config
This reduces massive the observer footprint.

NavRing and SlimPie will follow with same logic

cheers

Change-Id: Ie484bf72ae6e9cefa5cd979bbb279fa8549b8fdf
Frameworks: reduce navring observer footprint (1/2)

time for code cleanup projects. Switch to same
logic we already use in QS/NT shortcuts. Use
only one string for the whole navring config
This reduces massive the observer footprint.

This commit should as well the manta navring issue
in landscape

SlimPie will follow with same logic

cheers

Change-Id: I72cec6dce054674faf200864473d140581c68fa7
Frameworks: reduce SlimPie observer footprint (1/2)

time for code cleanup projects. Switch to same
logic we already use in QS/NT shortcuts. Use
only one string for the whole SlimPie config
This reduces massive the observer footprint.

cheers

Change-Id: I884c5d25c682e06d6649a16c2ba6d84460a3776f
[2/2] Permit home button wake to be configurable

To make appear add this to overlay

https://review.slimroms.net:8443/#/c/14077/

Change-Id: Ie52247d5c23c8f840ababc880dd41992049cefd1
ThemeUtils: Retain the original package name in themed UI context

In order for themes to reflect on system elements, we're changing
their context, including the package name.

This breaks anything that tries to identify system elements,
most notably any users of the uiautomator. Trying to do
'UiSelector().packageName("android")' to find, for example,
a force-close dialog will fail.

Fixes com.android.cts.uiautomatortest.CtsUiAutomatorTest#testUiWatcher

Change-Id: Ic05c3024b20ac3772ed5597846fbfa4a184ebb0d
Fix ringer mode being unneededly changed by setting ringer mode volume
to 0.

When having set the ringer mode to silent on a device with vibrator and
calling setStreamVolume() for the ringer stream again (e.g. in one of
the volume control dialogs in the settings app), the ringer mode is set
to vibrate, although there's no reason to do so.

Fix that by remembering the last non-normal (that is, either silent or
vibrate) ringer mode and using that when setting the stream volume to 0.

Change-Id: I27f1c75a0fef52bd63ac20f4101042808ce2c458
JIRA: CYAN-1403
Merge "Fix ringer mode being unneededly changed by setting ringer mode volume to 0." into jb4.2
Frameworks: speed up statubar/notification drawer

a lot user complain about slow statusbar pull down introduced
with jb 4.2....this speed it up

thanks to IceColdJelly

Change-Id: Iae108f5680b25ea995168a505a30e06bef0185d3
[1/2] Add triggers to change profile based on AP

Add data structure mWifiTriggers to store triggers per profile.
Add network change listener to switch to profile

Change-Id: I97e360d7783d3b0e2bbd70fe7a9a866d8c0fa7cd
Profiles: Fix turning bluetooth on/off when its in intermediate state

Change-Id: I09213c987580f47a6c3618edb469edabda96230c
Frameworks: fix aapt warnings

Change-Id: I5a017f84fef2ee871e9c77d95aee3f7f1b24b883
[2/2] Add bluetooth triggers to profiles

Change-Id: I374cc93364c88b8b29c88345deccf297234ff624
Resolve LocationManager + ActivityManager conflict

LocationManagerService was serially stuffing the same Location into
multiple Intents, which it would immediately hand off to
ActivityManagerService, running as a different thread in the same
process. LocationManager would continue to work with that Location
while ActivityManagerService worked with a Parceled version of it.

However, Location.mExtras is also a Bundle, and both
ActivityManagerService and LocationManagerService ended up working
with references to the same Bundle. ActivityManagerService needs
it in Parceled form (ie mParceledData != null), but
LocationManagerService was triggering Bundle.unparcel() when
referencing the data contained within.

As a result, LocationManagerService was able to trigger NPE (or
worse) in ActivityManagerService by manipulating the mExtras
member of a Location that was in the process of being reported to
listeners.

To resolve this issue, I copy-construct a new Location to report to
each listener. This should prevent ActivityManagerService and
LocationManagerService from referencing the same Bundle data, as
Location's copy constructor also copyconstructs the mExtras member,
rather than simply share references.

Bug: 7518371
Change-Id: Ib2334e0375612441ba6bbee0bde6c1f18b01f6d2
Profiles: Add a profile picker activity

Patchset 2: Add CM Copyright
Patchset 3+4: Rebase
Patchset 5: Some optimizations

Change-Id: Ic8281e4c6fef6d2f4c56fc01acfe6e54b4c8f51c
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>