privacy: Actually set the blacklist preference

The preference was not being set, which caused this code to throw an NPE on
devices without telephony when opening the privacy preferences.

This bug also affects devices with telephony in that the preference doesn't
update its text. I also got rid of the null check because the preference
always exists, the null check is pointless and ended up hiding this bug.

Change-Id: I95555d44349700a8f29a71a2f2ee9aedf419b49b
bluetooth: Don't crash when the local adapter is not set

In devices where bluetooth is not working (like the emulator or devices
in development), the bluetooth Settings crashes when closing the activity.

Most of the code checks for the nullability of the local adapter except
for this particular piece. This is usually not a worry for production
devices and I wouldn't usually worry about this but since the rest of the
code performs the nullability check it seems silly to crash onPause.

Change-Id: I7c1d3b43969b516336be770957008ef2054d312f
Settings: squash of new profile UI for cm-12.0

Additions for cm-12.0:
- removed expanded desktop
- added add profile FAB
- updated tabs for meterial style
- added enabler switch bar

Squashed commits:
-------------------------------

Settings: refactor Profiles to be more user friendly

* Remove the notion of Profile app groups
* Rearrange profile setup flow, now we first present the user with ways
which will trigger the profile, then allow them to set what happens when
the profile is triggered.

Change-Id: I2870df894046cd43c21c67991fb5efc9c3fec837
Signed-off-by: Roman Birg <roman@cyngn.com>

Settings: cleanup new profiles UI

* cleanup old code
* for configuring profiles, add options to modify triggers and remove
the profile
* remove separate activity
* don't hardcode padding pixel sizes

Change-Id: I6b1d05c9f918714249411006c7562496e2a7539e
Signed-off-by: Roman Birg <roman@cyngn.com>

Profiles: fix expanded desktop settings not applying

Change-Id: Ia523145bf47bfc189c29b035ad5ec6e053cf9296

Settings: Fix profiles volume override summary.

Change-Id: I499cfb3006a7fc7b5e931ac854a7437f5d141523

Settings: fix Profiles expanded desktop choice mapping

Change-Id: Ib96811a0c268ca68a7b9732283c5abc142d143a4
Signed-off-by: Roman Birg <roman@cyngn.com>

Settings: add "Untouched" ring mode option in profiles

Change-Id: I4ac2d63119b328533217104a799cb0660ecddfb9
Signed-off-by: Roman Birg <roman@cyngn.com>

Settings: profiles: fix volume streams override behavior

Before we would always assume to override the stream, but that is not
always the case. Add a checkbox to turn the override on and off.

Change-Id: Ic1a58d59a9e514d4c2ccf376191ac7989bbead26
Signed-off-by: Roman Birg <roman@cyngn.com>

Conflicts:
	res/xml/dashboard_categories.xml
Cleanup Security/Privacy settings code

Cleanup:
* Mismerges
* Code style
* Copyright headers
* File permissions

Change-Id: I6c34586680f0ccbaa613a0acfee366113c32a81c
Settings: use CMHW serial number

See http://review.cyanogenmod.org/57164

Change-Id: If328ca7b487435b88246d1f8c47b04770183f09e
Settings: allow home button to wake device [2/2]

Change-Id: I5c887422636f8bc51cb324339b3cdcac7af54400
[1/2] Settings AppOps: show/hide app type and allow/deny counters

Squash of:

Author: Sam Mortimer <sam@mortimer.me.uk>
Date:   Thu Oct 3 13:51:31 2013 -0700
AppOps: menu options to show/hide user and system apps
Change-Id: Ia55364c361db949a891e4b53a757ee4dff519eb6

Author: Sam Mortimer <sam@mortimer.me.uk>
Author: Danny Baumann <dannybaumann@web.de>
Date:   Wed Oct 2 22:24:14 2013 -0700
[1/2] AppOps: Show allowed/ignored counts
Change-Id: Ia27737155c33e934df9a2a1fcff88379240fd096

Author: Sam Mortimer <sam@mortimer.me.uk>
Date:   Sun Dec 1 21:39:07 2013 -0800
AppOps: only apply app type filters to summary screen
    *) If buildState() is called for a single package, do
       not apply hide user/system app filters.
    *) Fixes show detail display when called via
       long press in privacyguard and an AppOp hide
       filter is ticked.
Change-Id: If31d094fb989836ab6829daeefe820695032c0ed

Change-Id: I4d6f37b3923eb9bc98d67101d6f0ef481a427682
profiles: Make the actions wizard buttons show up

The "back" and "finish" buttons weren't being shown at all in this
layout, which made it impossible to add profiles.

Change-Id: Ib6b52430c25ed7445ca8e3c1249b7fccd21c3c69
profiles: Make the floating action button more material-y

This makes the FAB look consistent with other fabs across the system,
it adds animated elevation, changes the icon color to white but mainly
fixes the size which was completly wrong.

Change-Id: Ib8b2d54869a6a10958c24bcc0fab1224fd07fadd
TrustedCredentials: Don't crash when the activity is paused

If you press Settings -> Security -> Trusted Credentials, then press
 back before the loading finishes, the loader async task will still
try to dereference the activity which will cause an NPE.

This patch fixes that by getting and holding a reference to the
context in the beggining and bailing early if it is null.

Change-Id: Ie03734d5f184821df5d8729fc4a16eb51cdeebf5
Answer call with hardware HOME button (1/2)

Squashed commit of the following:

Author: Oleksandr Byelkin <sanja.byelkin@gmail.com>
Adds ability to answer call with hardware HOME button
preparation to winter time
Change-Id: I0d22a6fbb92a61f08b50cae5c14d0030b81ee6ec

Author: Michael Bestas <mikeioannina@gmail.com>
Settings: Move home answer & power end call options

Move 'Home answers call' & 'Power ends call' options to button settings
Change-Id: I2f365a3d278b0845b7c5ffcfe70c54160a00c24e

Conflicts:
	res/xml/accessibility_settings.xml
	src/com/android/settings/accessibility/AccessibilitySettings.java
bluetooth: Show a refresh icon on the select devices screen

The refresh menu is hidden behind an overflow which is
pointless. This patch shows the refresh icon if there is
enough room.

Change-Id: I35f19c42054b05388f7b8fcb82e0f3bd60e2d618
Display Settings: Better font size control

Use a SeekBar instead of a list/spinner to determine the font scaling.
For consistency, an approximate size (small, normal, etc.)
 and the exact percentage are displayed.
Show a preview of the selected font size immediately

Ported from CM 10.2, squashed commits 46678 and 49167.
Credit to Veeti Paaananen for the latter commit.

Change-Id: I754d7fdcaf27c23dfccf9d56291956e70b23f63e

Conflicts:
	src/com/android/settings/DisplaySettings.java
settings: Squashed commit of CMHW features

Add hardware tunables (gamma, color, vibration strength).

Change-Id: I44e3e4e6cb444498a7c56048618cd92a0e2b8e59

Settings: restore hardware tunable values on boot

Change-Id: I9d2720947d615cab6a7ab9b596b24b8033dd0b4f

Settings: Add default value for display color control (2/2)

Change-Id: I50b684abe504c21ef49492f99b18873d75509697

settings: Move headset option, hide MoreDeviceSettings if empty

 * This option fits much better in the sound menu under "automation
   and effects", and on many devices it's the only option in the
   "More..." menu under Tap & Pay.
 * Move it, and remove the MoreDeviceSettings top-level category if
   there's nothing else in it.

Change-Id: Idd82f582a1ba54f8b45fbd4fbe631057e9515f86

Remove 'More device settings' menu

Change-Id: I86cd84f6f6c408b26c04d92529e9a031c4fed1f7

DisplayColor: Properly handle a minValue

* Previously setting anything as a minValue would cause the
  percentages to get out of whack. For instance, setting it to 35
  would cause the maximum percentage to climb above 100% as well
  as still allowing the value to be set lower than the min.
* This makes the maximum for the slider the max value minus the min
  (so we get the proper spread for min to max) and then adds the min
  back on before setting so we can't possibly go below the min.

Change-Id: I8dcdc422f54847940351fae10c74af6301d1e1be

Settings: AdaptiveBacklight support

Add support for adaptive backlight technologies like NVIDIA SmartDimmer, QCOM CABL or Samsung CABC.

Patchset 2: Use internal shared prefs to store the smardimmer setting
Patchset 3: Rename to AdaptiveBacklight
Patchset 4: Reorganize settings and strings to follow design guidelines
Patchset 5: CleanUp
Patchset 6: Added suggestions
Patchset 7: Sync default value. CleanUp.

Depends	on http://review.cyanogenmod.org/#/c/48465/

Change-Id: I52cb990f36593b265a00b46a5f63590515822ea5

settings: Add support for SRE

 * Add support for sunlight readability enhancement
 * Optionally depends on adaptive backlight, depending on HAL

Change-Id: I9ca388ffd68080f0e497edb81d5f8616c194ea1d

Cleanup.

Now that button and keyboard backlight don't use the HW framework
anymore, there's no point in having an abstraction for a single use case.

Change-Id: Ib66b2a29a105d53e3ba4273abb06977b132c1fc8

Conflicts:
	res/xml/display_settings.xml
	src/com/android/settings/DisplaySettings.java
Setting: add app move to external storage

Add support tp move APP to external storage.

Change-Id: I9d8fef2df2f36b4d8b611d8ffe87990407b44742