owner info bg fix for dark material and tweak dashboard bg

Change-Id: I8c0ae675b132c570f9cfe8d5a22b778e0233048d
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: use CMHW serial number

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

Change-Id: If328ca7b487435b88246d1f8c47b04770183f09e
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
Settings: Add missing back button to About > Status

(cherry picked from commit a4687f1cc1b1f3f1fabce6a651bedb437dafee98)

Change-Id: Ib1e561b1de644d43579db2879d62e6d54bcf1fbe

(cherry picked from commit 52bd061f9ead66dc731b92316f989e990267a5df)
Partition information menu

Credit and Thanks to nobodyAtall

Change-Id: I4859db251883181947e0e96c3d4969a27da9de62

Conflicts:
	res/values/pa_strings.xml
Fix memory leak issue in application settings

If opening Main menu->Settings->Apps, and rotating the phone
about 50 times, Settings force closes and out of memory occur.
This is because after ManageApplications onDestroy, references
of ApplicationsState have not been release. So, they will not
be garbage collected. It leads to OOM and force close. To
avoid this we need to release the references of
ApplicationsState when ManageApplications onDestroy.

Also, when exiting ManageApplications or InstalledApps in
Settings there is a memory leak due to not releasing some
objects. This fix releases the Session objects to avoid
memory leak.

Change-Id: Icca7100bded0653a4ec7f2b4bd48a29262432a3b

(cherry picked from commit 8e1ff8262e6b88e918d417189c088a23a78cf2f8)
Change check for syncActive

In Manage Account settings if account is in syncing state
option provided to user is "sync now" which should be
"Cancel sync".

syncActive is set to true if getCurrentSyncsAsUser() returns
an empty list which means there are no active syncs.

syncActive should be set to false if getCurrentSyncsAsUser()
returns an empty list.

Change-Id: If78247a90bbca3e1a12553b6facb1315321f52cf

(cherry picked from commit e2172ea8e12ce92adf84f04989d17783adf0dd4c)
Show application's package name in the "App info" screen.

Change-Id: I7dac8ffa0b10abb5ff235750e90a96d801b2f919

(cherry picked from commit 20413edcd585e19348a73c9fd2e4a942cff95df9)

(cherry picked from commit a99585dec9270c122ad07d0b9bdd638e31bd50f3)
Settings : Add tap/pay help url

Change-Id: I41f37dff0fa2eb547f84aaf776950f0f42e6e36f

(cherry picked from commit f3cad824d4cde36fd1e12d78e99c3069a83b391e)

(cherry picked from commit aa4db1f4e902776210f87ea4b5f02f0065c189aa)
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
Add Buttons settings drawable

Change-Id: I8a684dafc823e580d855ed608130fd14f8684cd9

(cherry picked from commit 24de8f52e438ffeb9eda071fe066d71c3d00d1cb)
Development Settings: Reenable Nuplayer

* Nuplayer is now the default in Lollipop, do not uncheck the setting when disabling developer options.

Change-Id: Ic47365192404a866434630a7a4f2f669b8f80233

Conflicts:
	src/com/android/settings/DevelopmentSettings.java
bugfix: there are other options after in-app search

On "Settings -> Buttons -> Home Button -> Long press action" there's
a list of options. Any option after the "in-app search" one was being
ignored.

Change-Id: I136235a6798496a0a8786bad59b168845c677bdd
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:
	res/values/cm_strings.xml

Conflicts:
	res/values/cm_strings.xml
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/values/cm_strings.xml
	res/xml/button_settings.xml
	src/com/android/settings/ButtonSettings.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:
	AndroidManifest.xml
	proguard.flags
BootReceiver: remove duplicate DisplaySettings.restore(ctx);

Change-Id: I7c9130e4ba045e1a5c6db270c7301bc675a01b03
Settings: Forward port Display Rotation settings

Originaly authored by Robert Burns (burnsra)

Settings: Fix possible NPE in Display settings
Change-Id: I186203782aa27fb4eaa77500fecb82946bfdd173

Display : Enable rotation on large screens
The auto-rotate toggle in statusbar is no longer present, so the check
is no longer valid.

Change-Id: I0a23e251b3cb793481d14ea8ad8a9079c7c0e962

Fix the spacing between displayed rotation angles
Before: http://goo.gl/QJ7hE
After:  http://goo.gl/V0alW

Change-Id: I0319f8e84e4b278b2f720cbc77cecc280c82d461

Settings: rotation settings for devices with hardware rotation lock
All settings would be disabled on devices with hardware rotation
lock due to dependency setting. Disable dependency to allow setting
swap volume and rotation degrees on those devices.

Change-Id: Iee0532902d59fa80666e17b3853db8e3d7ed5ddc

Add lockscreen rotation as an optional rotation setting (2/2)
This will allow the user to select wether or not to use the
rotation settings for the lockscreen.  This is dependent
upon the rotation setting being checked.

Signed-off-by: Michael Bestas <mikeioannina@gmail.com>

Change-Id: If45c13a395e0d71b7c4cdcf484a6b8cef964ee37
JIRA: CYAN-339

Ported from cm-10.2, adjusted for 4.4

Signed-off-by: Michael Bestas <mikeioannina@gmail.com>

Change-Id: I4f96b3f804ee4732b277c35340790f3561d69764

Conflicts:
	res/values/cm_strings.xml
	res/xml/display_settings.xml
	src/com/android/settings/DisplaySettings.java

Change-Id: Ib239e63200fc8565c3f66969aa495f1c40908adf

Conflicts:
	res/values/cm_strings.xml
Settings - Display Rotation: Checkboxes to Switches

Change-Id: I631c0ef65985d336e1a0790b6bb07ef7524ff6b2
Signed-off-by: STELIX <ssspinni@gmail.com>