Re-add auto brightness configuration UI (1/2)

- Add a button into the new brightness dialog that allows opening the
  auto brightness setup
- Enable auto-brightness adjustment (setting for general brighter/darker
  adjustment) and twilight adjustment

- this commit adds as well the complete auto brightness ehancements we had
  on 4.3

Change-Id: I7fd11ddaa112396dcb7508692aacb93bfe3da256

AutoBrightness, set class name to mm
Framework: Generic Blacklist support (4 of 5)

Change-Id: Id6c85c9a537713ec77d00deb7f7fe5a9150be2cd
Make contacts app aware of blacklist being disabled (1/3)

Change-Id: Ic59f370a6e78390c9b2b1510e0ec85b2f4af9146
Add back increasing ring feature.

Change-Id: Id950d3c19a05e4efb9ed0b36be6a7482dd173965
Frameworks: Advanced low battery indicator options (1/2)

Based on a idea I saw on Liquid and from CR3C0 (thanks guys) which we
modified to an extended version

This commit introduces following new SlimBean modes to indicate low battery

     * 0 = show dialog + play sound (default)
     * 1 = fire notification + play sound
     * 2 = show dialog only
     * 3 = fire notification only
     * 4 = play sound only
     * 5 = none

Due that notification is a unique SlimBean feature some words on it. Notification
behaviour is the same as Pop-up. User can dismiss it manually or it is
dismissed automatically if charger is connected, click on notification opens
PowerUsageSummary. Also you get a status bar ticker message about the notification
and notification is always on first place of list. And last if vibration is enabled
notification vibrates.

Patchsets:
 - codestyle corrections

Patchst
 - add PowerUsageSummary intent

cheers

Change-Id: I84476626b0ff5424454a1132ea4ef77a696070c1

Conflicts:
	core/java/android/provider/Settings.java

remove unused settings
Frameworks: add Battery Styles the new way 1/2

Ported from slim

=================================================================

fb: add Battery Styles the new way 1/2

google draws now the battery icon which fits perfectly into our
concept. Beside that the batteryview is as well used on QS.
So we readd our battery icons (icon, percentage, icon with percentage
circle, circle perc, dot circle, dot circle perc) back and all are
drawn. As well the icon does not only change on statusbar as well
on QS it is reflected.

As usual color options are present for the User to style the icon

Change-Id: Iae9021af56a21b8d39efc5162186eb17ecc933e2

Conflicts:
	core/java/android/provider/Settings.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java

remove unused methods

remove unsed method

change to magicmod name

add Battery Styles the new way 1/2  --fix derp
Frameworks: Fix first animation to QS

on click of qs settings button

Change-Id: I7fbc4bc162aabeedb6b88c3046403c12ebb2e6bf
Frameworks: correct the google animation on flipping to QS to be nicer

Ported from slim

==================================

that the carrier text on flipping to qs hides when QS is already present
is not very nice from UX perspective. Correct this behaviour to hide
it directly when the user goes into QS. Same for notification shortcuts

As well reflect this behaviour on manual flippsettings

Change-Id: Ib181bef2022b974e05ec8ebeb195e08cd41a4ffc

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java

remove unsed method
fb: show percentage on icon in bold and use for

only percent more width in statusbar and QS
As well show on percent with icon on fully charge not the bolt
and instead the value 100

Change-Id: I4e0b837ff6e217e1c9f78d967aa57c3e2f1bf2ad
fb: follow new 4.4 transition on center clock and circle battery

Change-Id: I50657071f290e0646193d079ab9319ed15f667b6
Re-Add WiFi reloading config

frameworks/base: support devices with SoftAp that don't require firmware reload

Change-Id: I01e868ad2824c4cb0fdfdae866d794b39cf78095
fb: statusbar reflect am/pm based on the global user settings 12h/24h format (1/2)

Change-Id: I7d6eec4d62f0e1072f11e8e131608b78f17539d9
Improve scrolling cache

Scrolling cache helps make short scrolls/flings smooth but will
cause stutter when long flings are made. This patch disables
scrolling cache when long flings are made.

This patch also fixes a related bug where scrolling cache will
not be enabled properly when transitioning from flinging to scrolling.

Patch Set 2: Calculate threshold based on maximum velocity (Sang Tae Park)

Credits: Pawit Pornkitprasan

Change-Id: I1fdbaad92263c9f983a32900e74eba1f0367902b
Signed-off-by: Arham Jamal <arhamjamal@gmail.com>
Fix to NullPointerException when activity is relaunched

When ChooseTypeAndAccountActivity is relaunched and resumed
by ActivityManager a call is made to onActivityResult without
first triggering onResume. This leads to mAccounts object
still being null.

Fixed by properly setting mAccounts object if it is null prior
to use after function onCreate has been called.

Change-Id: Ife7e1e052c473970d923fa43ee6189eb62a1113b
Keyguard: Set WIDGET_CATEGORY_KEYGUARD when AppWidgetHostView is created

Allows the default lockscreen widget to inherit the keyguard widget
host category.  Without this, only widgets added through
KeyguardActivityLauncher are assigned the correct
OPTION_APPWIDGET_HOST_CATEGORY.

Change-Id: Ic97818d85ca5f00da0ce43bb36006d66a6935363
StorageManager: fix android.process.media process stop while plug a discontinuous partitioned SD Card

While get volume state, throw an IllegalArgumentException, catch
this exception in StorageManager and return null to MtpService to
avoid process stoping.

Change-Id: Iebb5c38e375d3f54505d9b9d64fcd0f02a2b60c1
Author: Li Gang <gang.g.li@intel.com>
Signed-off-by: Li Gang <gang.g.li@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 47459
Remove possible leak when exception occurred.

nameUtf8 is not released after exception.
In addtion, Fix code going down after ThrowException.

Change-Id: Id46e8ed55acd98e982ae532f7da2c0c48847f010
frameworks/base: Fix to remove exception in tonegenerator

- Framework reboot happens, if tonegenerator fails to create
  a track in audioflinger.
- The cause for framework reboot is, an exception thrown by
  tonegenerator if fails to init.
- Fix is to remove the exception and delete the tonegenerator
  instance.
CRs-fixed:466491

Change-Id: Ie7b87f787d8a885cc70be9af4ba9d04ecd691cc2
framework: packageinstaller :fix logical error in size calculation

fix logical error in available size calculation.

Change-Id: Ic6ce312cf1c146030a20187fcb27b24fbe4c321a
libaudioeffect_jni: GREF leak fix for JB

- Excessive JNI global reference in AudioEffects.
- Global references created during native setup
  are not deleted.
- Global references are deleted in setup failure
  and during native release.

(cherry picked from commit a04a2bf4563dc20c52f4d4239e01f80b220077a5)
CRs-fixed: 413633

Change-Id: Ia4340a2128850101b394e00c8e1db9db49f516fd