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
Set Settings.Global.WIFI_SCAN_ALWAYS_AVAILABLE default value

To be able to customize the "WiFi scan always available"
setting we need to set a default value.

Change-Id: I3673f2613ab9b6a947aed7e29d4cc876140c2180
ProcessList: use different polling interval when screen off

We are using the same time interval for both screen off and screen on.
For process on top: ActivityManager.PROCESS_STATE_TOP, we will poll PSS
information every 120 sec.
During polling PSS, we are grep /proc/%d/smaps which is a 10k lines file.
This cost quite a lot of CPU resource. But when screen off, we don't need to update
TOP process PSS so frequently since we are not operating it. Lower polling
circle to every 15min to reduce power.

Change-Id: Ia4cd26290d44d066f034d5270ce5523650a3c493
Keyguard: don't refresh ui when screen off

KeyguardStatusView is doing refresh all the time,
which cause high power when screen off.

Change-Id: Ifabdde4419a23e919cd52fe77e78ec3160575af1
UI not updated correctly in expanded statusbar

Sometimes when getting status changes in expanded statusbar the
text disappear. Both NetworkController and PhoneStatusBar handles
UI updates and they are not in sync. This fix allows PhoneStatusBar
to update UI when NetworkController is updating the UI.

Change-Id: I46b8a24ecc732e441f836692c6584a78d8108dff
onAccountsUpdated shouldn't be called back after listener unregistered

There is a problem of AccountManager that onAccountsUpdated() is
called back even after the OnAccountsUpdatedListener is unregistered.
It may cause application crash.

For example, when rotating a tablet 180 degree with Settings apk
running, com.android.settings.Settings is re-launched 2 times
successively. (Destroy->Create->Destroy->Create)
It repeats adding&removing OnAccountUpdatedListener.

When dialog was being opened in the following cases,
NullPointerException at BackStackRecord.getBreadCrumbTitle()
was happened on 10 inch tablet which has 2 panes on Settings.
* Settings > Language&input > Language
* Settings > Language & input > Text-to-speech output > Speech rate
* Settings > Wi-Fi > Menu > Advanced > Keep Wi-Fi on during sleep
* Settings > Wi-Fi > Menu > Wi-Fi Direct > Rename device

This fix prevents the undesirable callback.

Change-Id: I081f69c90539cca821cf686b4587495135f375e4
Wrong notification tone played for secondary user sometimes

Media should have support for multiple user when get the
default ring tone uri from settings provider database.

Change-Id: I2d120c155dba1094cab49b0bab58525f17321797
Add torch overlay
Add OctOS shine and lockscreen handle
Adjust KitKat easter egg to display "K" no matter what
The way is currently working, it pulls the first letter of the build_id for the easter egg. This is making it to where some devices show a "J" instead of a "K", the way it was meant to be.

Author: Whitehawkx
Change-Id: I6e91bdc5695e2b2e8317a4ba20df33d6f744437f
Frameworks: Statusbar clock and date customizations(1/2)
Some things changed on kitkat + our old code needed in general a bit
rework. All done with this patchset.

This commit add support for:

- Clock and date enable/disable
- Clock and date position
- AM/PM styles multilang support
- color
- Date format
- Date style

Author: kufikugel
Change-Id: I73d854ed5cfb57fa19e4b5554bb10cb2e1ce9b65
Power Menu config + Screenshot & Reboot(1/2)

Conflicts:
	core/res/res/values/symbols.xml
Navigation bar custom height
xxhdpi reboot and screenshot power menu drawables
Navbar enabled but defaulted to off(1/2)
LED customization
original commit CM
Implement DeviceUtils helper class needed by some mods
Quicktoggles

Patchset 1: Invert actions
Patchset 2: Basic drag and drop handler (temporally stored, no animations)
Patchset 3: Animations and hover effect
Patchset 4: White color, better view swaping method, fixed bugs
Patchset 5: Edit mode (long press on user tile), Overshoot interpolator for scale animation (still temporal)
Patchset 6: Removed interpolator, added animation on entering/leaving edit mode, Stuff sticks through reboot
Patchset 7: Fixed view swapping for real
Patchset 8: Fixed jerky animations
Patchset 9: Fixes for phonestatusbar, preparing for activation method
Patchset 10: Airplane toggle -> Aint nobody got time for dat. Disable activation on user tile (waiting another method to come up to my mind)
Patchset 11: Better drag handler, edit mode on tablets only
Patchset 12: New icons, animations, back to hovering
Patchset 13: Fix behaviour with temporary tiles and slow animations
Patchset 14: Edit mode on phones (credits to Curtis Mayers: https://gerrit.paranoidandroid.co/#/c/241/)
Patchset 15: I'm not the only nitpicky here right?

Change-Id: I967f94428606f8f909cb428eaaa6d12e9d59808e

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