Settings: add safe headset volume and less annoying sound notification

Add settings for both features.

Change-Id: I8ab4f4b9ec320238b05ac51fb76ac24b93c37d37
(cherry picked from commit 5d8d5cfaec835f7a4168131c1a508aa71bd788dd)

Conflicts:
	res/values/cm_plurals.xml
	res/values/slim_strings.xml
Option to use volume keys to control media volume anytime [2/2]

The volume keys control the Media volume rather than the Ringer
hence removing the issue of accidentaly changing the Ringer volume.

Credits: Pawitp

Change-Id: Ic0a1c04ae41eac65e9535d6de5f11c0456730315

Conflicts:
	res/values/cr_strings.xml

(cherry picked from commit 82e813263298ab084a1f428489b3ea2fcd5a23b9)
Settings: XuiMod: Toast Animations [2/2]

Credit zst123, thanks for GwonHyeok

Change-Id: Ic9bf076a4693615c02009aec7239b2fae6da00ce
(cherry picked from commit 28f609f76427288570ac9590bda47b4ffc9caf3f)

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

(cherry picked from commit 486d1a3062b0a959e0117347fe8d11000f8ac3fe)
(cherry picked from commit 49b8ecc5dcd271a1dea6e5b0a67427ce7f0e908c)
Lockscreen: Add timeout and instant lock option to slide lock (1/2)

This adds AOSP's new timeout and instant lock options to the
slide (aka chooser) style lockscreen.
To Do: Add the vibrate option as well.

AICPfy:
brought from kitkat
PS2: CheckBox -> Switch

Change-Id: Ide8e8d14603e5111debcc7a7cf6c4b74898bfa3d

(cherry picked from commit 30a3376ce82f984901fcc04668b8126e0da1e5fa)

(cherry picked from commit 33a412becd9068705b0b96b399db786687ea3887)

(cherry picked from commit 2c20b800dd1f430c81a78889b998b1b8126d9978)
Add fastscroll to the Manage applications screen

so you don't need to scroll so much if you have alot of apps
and want to go to the bottom of the list.

Change-Id: I96d892abf53a9da784ae1df056558d4fd3cf64f6

Conflicts:
	res/layout/manage_applications_apps.xml

(cherry picked from commit 7345de69f3a57aa67a7f6c996f62fa8ced535637)

(cherry picked from commit ad80619e6f3c5cb673b96e4ff27cfff51782f071)

(cherry picked from commit d3913bd1580c867dba7275e6abeaff22f1de96cd)
Settings: Option to enable/disable scrolling cache

(cherry picked from commit 5a5c87dea007b37446cb24e8e4a1b229d15cee3a)

Conflicts:
	res/values/cmr_arrays.xml
	res/values/cmr_strings.xml
	res/xml/development_prefs.xml

(cherry picked from commit ad085ef67bc27d60ca70450bca448ad5addc7992)

(cherry picked from commit dbd736f183db17f2d698a82c9ad2a4b51e2301fd)
Statusbar clock font style (2/2)

(cherry picked from commit 99c81cf6e7c19468ceb72df693973be0e148e0fa)
Settings: Enable Advanced Reboot by default [1/2]

(cherry picked from commit e20794cd3a99280da0f6eb0d6e7aac74eae0a679)
 Add option to Restart SystemUI to DevSettings

(cherry picked from commit 13ff2ae92c2f08d7e6ab93797604c4210bbb5eee)
settings: Show more hardware information about the device [1/3]

pulls the following build.prop settings and displays them

ro.device.chipset=value
ro.device.cpu_info=value
re.device.gpu=value
ro.device.front_cam=value
ro.device.rear_cam=value
ro.device.screen_res=value

PS9: rename cpu to cpu_type
     add cpu info

PS10: add device codename info (I think it may be useful)
      see http://i.imgur.com/NuSacL1.png

Change-Id: I5da59cac0e924953679f7a69ba17cb8df7b59a91

Conflicts:
	res/values/pac_strings.xml
	res/xml/device_info_settings.xml
	src/com/android/settings/DeviceInfoSettings.java

(cherry picked from commit fc17f93b33d27f358671160eefe09e84f649283a)

Conflicts:
	res/values/cmr_strings.xml
	res/xml/device_info_settings.xml
	src/com/android/settings/DeviceInfoSettings.java
point advance sounc setting to the correct path
[2/2] Settings: Doze (ambient display) timeout

Patchset: put the preference in more sensible location.

Patchset: remove preference for devices that don't support
        doze display state.

Patchset: turn off doze timeout slider if doze is disabled

Patchset: move doze options to own preference category

Change-Id: I366a3a00bb48c20fa2d37f0b22fdbfeb3d004533

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

(cherry picked from commit f35f983bd6265e75b20fec0d24e139e0f4bb3115)

Conflicts:
	res/values/cmr_strings.xml
	res/xml/display_settings.xml

(cherry picked from commit 96820980d46e7b802c492953d0af778d6f0b05cc)
Add more toast options (TEMASEK)

(cherry picked from commit 8e0580fbcc4661f2c30dc25d305661ec10b2c544)
Display: Avoid another ArrayIndexOutOfBoundsException and catch if necessary

Log provided by andreasltcf of xda

FATAL EXCEPTION: main
Process: com.android.settings, PID: 7139
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.settings/com.android.settings.SubSettings}: java.lang.ArrayIndexOutOfBoundsException: length=7; index=7
at android.app.ActivityThread.performLaunchActivity(A ctivityThread.java:2298)
at android.app.ActivityThread.handleLaunchActivity(Ac tivityThread.java:2360)
at android.app.ActivityThread.access$800(ActivityThre ad.java:144)
at android.app.ActivityThread$H.handleMessage(Activit yThread.java:1278)
at android.os.Handler.dispatchMessage(Handler.java:10 2)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.jav a:5223)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCa ller.run(ZygoteInit.java:898)
at com.android.internal.os.ZygoteInit.main(ZygoteInit .java:693)
Caused by: java.lang.ArrayIndexOutOfBoundsException: length=7; index=7
at com.android.settings.DisplaySettings.updateTimeout PreferenceDescription(DisplaySettings.java:344)
at com.android.settings.DisplaySettings.onCreate(Disp laySettings.java:167)
at android.app.Fragment.performCreate(Fragment.java:2 031)
at android.app.FragmentManagerImpl.moveToState(Fragme ntManager.java:863)
at android.app.FragmentManagerImpl.moveToState(Fragme ntManager.java:1067)
at android.app.BackStackRecord.run(BackStackRecord.ja va:833)
at android.app.FragmentManagerImpl.execPendingActions (FragmentManager.java:1452)
at android.app.FragmentManagerImpl.executePendingTran sactions(FragmentManager.java:483)
at com.android.settings.SettingsActivity.switchToFrag ment(SettingsActivity.java:955)
at com.android.settings.SettingsActivity.onCreate(Set tingsActivity.java:581)
at android.app.Activity.performCreate(Activity.java:5 933)
at android.app.Instrumentation.callActivityOnCreate(I nstrumentation.java:1105)
at android.app.ActivityThread.performLaunchActivity(A ctivityThread.java:2251)
... 10 more

(cherry picked from commit e021753d82b456ec5626e732f06d4e658c5c0398)

(cherry picked from commit 798c99c7d9ac56ce7caf10347fb0d7aeb41f9596)
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 25f18eda62240a464ec3ca78527f73c3f5d4c729)

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

Change-Id: I2b277c674d4ca2bd88b1752611cfc7a6efbcb0fe

(cherry picked from commit 49e9d6df94c74a5ff941594d44161a4ebe63665b)

(cherry picked from commit c7f647429c9b7a99a08683ff410149827a225fc3)
Settings App: Fix to resolve NULL pointer exceptions

This fix resolves any NULL pointer exceptions and
Array Index Out of Bounds exceptions seen in
Settings Application code space.

CRs-Fixed: 760115
Change-Id: I8c2b7b8e19d362a5c5789d8693bcd3656c32e38d

(cherry picked from commit 281f89d1b90b85cb7ca9dbf541846805007e8c09)

(cherry picked from commit 8a20f9cfb05a1262c87ed7a0f76b437d2d9d9b84)
Superuser: Remove ACCESS_SUPERUSER permission [1/2]

I can't explain this any better than Chainfire, so for that
reason, I'm gonna go ahead and quote him:

Android 5.0 Lollipop now requires custom permissions to be
unique unless the declaring packages are signed with the
same cryptographic keys (same author, usually), or package
installation will fail. As all modern root management
packages now declare this permission, this means you cannot
easily install a different one and start using that one,
as its initial installation will fail, unless you are using
a recovery-based installer that also cleans away the old one.

So let's remove the permission

PS1: Intial commit
PS2: Rebase, test results: works

Change-Id: I7870bc6d82e1f81f168f9389be839034e4ede62d

Patchset: 3
http://review.cyanogenmod.org/#/c/80049/

(cherry picked from commit bd7b1364ded4674ec6f4c9160281e8914943d27e)

(cherry picked from commit 35d3e8ae3c7b2983eca9b132671534d54f936645)

(cherry picked from commit ef4e1addd62525236f9aeb52891d7603b6879402)
Settings: ListView part + add Display and animations sub menu

Change-Id: I5f1dc04b5044b9e4d7a2b42a1e72a4c1e5eaf93b
(cherry picked from commit 5bf157c4727050947ec7a30d2c1d565f15e518a0)

Conflicts:
	res/values/cmr_arrays.xml
	res/values/cmr_strings.xml
	res/xml/aicp_lab_prefs.xml