Fix for ambiguous and broken disk formatting dialog

This patch ensures that the path-string from StorageNotification is converted
to the appropriate StorageVolume so that it can be correctly passed to the
formatting class. It also displays this path to the user so that it is clear
what will be deleted.

While trying to use a USB flash drive over OTG, the drive's FS somehow got
corrupted, so Android gave me a notification to re-format it. Okay, so then
a dialog pops up that doesn't specify what volume/device it will format, and
I incorrectly assumed it would be the USb drive. However this activity defaults
to the main internal memory for some reason, and wiped my data. Thank God for
them internets... (Dropbox)

Change-Id: I5621dff3cfd12a173b0d793398cf729333f97263
DefaultContainerService: implement additional methods

For usage in Settings->Storage

Change-Id: I2d45198cc6ea3b84af1547873380eae2c04c0b93
A little sweet suprise for everyone...

Thanks to Somber73 for the artwork
Activity chooser "Always" button is not working

When ResolverActivity is created with a custom list of matching
applications (rList) as in NFC case, and the alwaysUseOption is
set to true, the prferredActivity is not saved even if the user
presses the "always" button.

When a list is provided the variable mBaseResolveList will be
!= null. This will set mOrigResolveList = null.

When an activity is choosen and one of the buttons are pressed
onIntentSelected is called. The first thing this method does
is to check mAdapter.mOrigResolveList != null, however in this
case mOrigResolveList is always null, and the value is not
saved as PreferredActivity.

This problem was introduced in
6d8dfbd8149942f25f2b9643a12f1fb38f3be834.

Change-Id: I9eac41b7861b5e68ad3978af0dc0285f2a34eb88
ProcessCpuTracker: Fix ArrayIndexOutofBoundsException in tempSpeeds

If time_in_state file is not available mCpuSpeeds is created with size 0
and subsequent call if the file becomes available there is an
ArrayIndexOutofBoundsException.
This change avoids the crash by breaking out of the loop, also adds error
logging

CRs-Fixed: 553569
Change-Id: Id5e219ca1cd3f058f714aecd5902ec2f6c11ae03
ProcessStats: Handle changes in the scaling frequnency

Switching from MP to IKS mode results increase in number of operating points
and results in bug #1183781 . The patch makes sure that whenever the available
scaling frequency changes it resets the existing values and sets them as per the
new values.

Change-Id: Ic74cdc2015f3c4ddd61cb116d1f4b4ed1204a3bf
Signed-off-by: Vishal Bhoj <vishal.bhoj@linaro.org>
ProcessStats: Fix another crasher

Prevent occurences of:

java.util.NoSuchElementException
	at java.util.StringTokenizer.nextToken(StringTokenizer.java:208)
	at com.android.internal.os.ProcessStats.getCpuSpeedTimes(ProcessStats.java:574)
	at com.android.internal.os.ProcessStats.getLastCpuSpeedTimes(ProcessStats.java:546)
	at com.android.server.am.ActivityManagerService.updateCpuStatsNow(ActivityManagerService.java:1676)
	at com.android.server.am.ActivityManagerService.batteryNeedsCpuUpdate(ActivityManagerService.java:1728)
	at com.android.internal.os.BatteryStatsImpl$MyHandler.handleMessage(BatteryStatsImpl.java:129)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loop(Looper.java:137)
	at com.android.server.am.ActivityManagerService$AThread.run(ActivityManagerService.java:1431)

Change-Id: I66f30739455dd726b708467f814f53c445f327b2

Conflicts:
	core/java/com/android/internal/os/ProcessStats.java
fix NoSuchElementException error with CPU ProcessStats

Credit to Eugene373

p2: update commit message
p3: cleaned up tabs
p4: also added aosp changes from this commit - https://github.com/android/platform_frameworks_base/commit/ca894b396b93344ac255746e12730cb269d4d856

Signed-off-by: Jonathan Steadman <xxwhitehawk@gmail.com>
Change-Id: I3c71dbd5fb8e42811c47d6431003101943cb388a
Fix DataInputStream leaks

Fix fixes
-In viewstateserializer, try to close before throwing or returning, and throw early if inputstream is null
-other stuff

Change-Id: I7f3b16057582566b82a85841829ff6ed11cd570e

Conflicts:
	core/java/android/webkit/ViewStateSerializer.java
ZygoteInit: increase GC threshold amount when preloading to postpone GC

Patch Set 2: Hardcode it better to 1MB.

Change-Id: I7a6e195b82ebe2f4bd5bbb506e19200d452fa3e5
Grant qcom_oncrpc group to system_server

 * Needed for RPC-based QC GPS

Change-Id: Idebc5f6f8e7f8c136d931d7638338d3611895d8a

Conflicts:
	core/java/com/android/internal/os/ZygoteInit.java

Conflicts:
	core/java/com/android/internal/os/ZygoteInit.java
frameworks: Add class for changing app moving setting

Change-Id: Ic9f0eed496f014fdc110946759e2041ef808e5c4
Add torch tile by default if supported

 * New configuration variable config_enableTorch has been moved from
   the settings app that devices should overlay onto.

Change-Id: I2e4cb81390548cf055eae2836280fe9bdc65f0b0

Conflicts:
	core/java/com/android/internal/util/cm/QSConstants.java
	core/java/com/android/internal/util/cm/QSUtils.java
	core/res/res/values/config.xml
	core/res/res/values/symbols.xml
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsController.java

Conflicts:
	core/res/res/values/symbols.xml

Conflicts:
	core/res/res/values/liquid_symbols.xml

Conflicts:
	core/res/res/values/config.xml
	core/res/res/values/liquid_symbols.xml

Conflicts:
	core/res/res/values/config.xml
	core/res/res/values/liquid_symbols.xml

Conflicts:
	core/res/res/values/config.xml
	core/res/res/values/liquid_symbols.xml

Conflicts:
	core/res/res/values/liquid_symbols.xml
[1/2][SQUASHED] Base: On-The-Go mode

Squashed on-the-go of following commits:
NamelessRom/android_frameworks_base@c9515a3
NamelessRom/android_frameworks_base@e28324c
NamelessRom/android_frameworks_base@755e04c
NamelessRom/android_frameworks_base@ede7578
NamelessRom/android_frameworks_base@7350979
NamelessRom/android_frameworks_base@19c8631
NamelessRom/android_frameworks_base@5c63f5a
NamelessRom/android_frameworks_base@2a15bce
NamelessRom/android_frameworks_base@1fa20bc
NamelessRom/android_frameworks_base@bfbfdae
NamelessRom/android_frameworks_base@90ac0f6

Change-Id: I8f8f109673613ae4c8a86f6b235c487203c8609c

Conflicts:
	core/java/com/android/internal/util/cm/QSConstants.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsController.java

Conflicts:
	core/java/android/provider/Settings.java
	core/java/com/android/internal/util/cm/QSConstants.java
	core/res/res/values/cr_strings.xml
	core/res/res/values/cr_symbols.xml
	packages/SystemUI/res/values/cr_config.xml
	packages/SystemUI/res/values/cr_strings.xml
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsController.java
	policy/src/com/android/internal/policy/impl/GlobalActions.java

Conflicts:
	core/java/android/provider/Settings.java
	core/res/res/values/liquid_strings.xml
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsController.java

Conflicts:
	core/res/res/values/config.xml
	packages/SystemUI/src/com/android/systemui/quicksettings/QuietHoursTile.java

Conflicts:
	core/java/com/android/internal/util/liquid/QSConstants.java
	core/res/res/values/liquid_symbols.xml
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsController.java

Conflicts:
	core/res/res/values/liquid_strings.xml
	core/res/res/values/liquid_symbols.xml
Add Fast Charge QS Tile [1/2]

Change-Id: I9e28bb14549c176cacfe2a861b1e5f56cd9e242f

Conflicts:
	core/java/com/android/internal/util/slim/DeviceUtils.java
	core/java/com/android/internal/util/slim/QSConstants.java
	core/res/res/values/config.xml
	packages/SystemUI/res/values/custom_strings.xml
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsController.java

Conflicts:
	core/java/com/android/internal/util/liquid/DeviceUtils.java
	core/res/res/values/config.xml
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsController.java

Conflicts:
	core/java/com/android/internal/util/liquid/DeviceUtils.java
	core/java/com/android/internal/util/liquid/QSConstants.java
	packages/SystemUI/res/values/liquid_strings.xml
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsController.java

Conflicts:
	packages/SystemUI/res/values/liquid_strings.xml

Conflicts:
	core/java/com/android/internal/util/liquid/QSConstants.java
	packages/SystemUI/res/values/liquid_strings.xml
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsController.java
QuickSettings : Add BatterySaver Tile (1/2)

Conflicts:
	core/java/com/android/internal/util/liquid/QSConstants.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsController.java

Conflicts:
	core/java/com/android/internal/util/liquid/QSConstants.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsController.java
Framework: add camera tile (1/2)

Modified by liquid0624 to work with SlimRoms quick settings

Change-Id: Id0beb3dd559536bb5571ddc87cb0bcb4945b1a77

Conflicts:
	packages/SystemUI/res/values/liquid_strings.xml
Framework: add compass tile (1/2)

Add a compass tile to quick settings.
Clicking on it enables the sensor and clicking again disables it.

Screenshot: http://goo.gl/2frdpy

Modified by liquid0624 to work with SlimRoms quick settings

Change-Id: Icd9d12929f0491f6958f30de139ef39bb4c2e037
Show submenu from menu list on hardware MENU key press

Submenu is not shown when menu list is open by pressing
hardware MENU key. But it is shown properly when menu is
open from overflow button.
This change will unify the behavior of MENU key &
overflow button.

Crs-Fixed: 622050
Change-Id: I91e336df845febf048583989c8c6b831e04856b1
Display: Initialize mRotation to panel orientation.

    - Fixes the homescreen layout to be prepared based on the panel
      orientation.
    - Disables the rotation animation from 0 to panel orientation after
      bootup.

Conflicts:
    core/java/com/android/internal/view/RotationPolicy.java

Change-Id: Ie77e53ade087df05e102c45bf9d12bdaf09583f7