[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