Fix fetching icons from packages.

Change-Id: I857d35bb601425be56b5eb730d63344e1173e4a2
Fix a number of multi-user bugs.

In particular, expanded desktop mode couldn't be enabled for non-primary
users as GlobalActions wrote the setting to the primary user's settings
DB.
Also fix some other cases where we didn't track the settings for
multi-user correctly.

Change-Id: I3bec45cb84903120639c2e85c1d71ec9a491933c

Conflicts:
	policy/src/com/android/internal/policy/impl/GlobalActions.java
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
PowerMenu : Profile entry fix

Always reinflate views
Jira : https://jira.cyanogenmod.org/browse/CYAN-1017

Change-Id: Ib348bb4c9a85b6433a86eeed1b0de9deff9d50bc
Add config_hasRemovableLid

If a device features a dock with a removable lid, lidOpenRotation
overrides the rotation even if it was undocked (technically the lid is
still open).

This setting tells the framework whether to apply lidOpenRotation to
undocked devices.

Change-Id: I1051278a45875b2139b75db28467f9b8de2936d6

Conflicts:
	core/res/res/values/config.xml
	core/res/res/values/symbols.xml
Port "Bind VolUp+VolDown to toggle the ringer"

Squash of http://review.cyanogenmod.org/#/c/20256/ and
http://review.cyanogenmod.org/#/c/22716/

Change-Id: Ied3767969482a7ea44f7f0e9222a2f78fe8f507c

Conflicts:
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Add a config resource to force HDMI rotation on some devices.

If the hardware composer HAL does not provide full support for
multiple displays, it may be necessary to force the HDMI rotation
when not docked.  (When docked, we can use the dock's orientation.)

This configuration is not expected to be used on newer devices
with the requisite HAL support and may be removed in the future.

Bug: 8511721
Change-Id: I1ff50f00ee7fe621aceff94bd938ecf6385c3f38

Conflicts:
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Add missing display overscan method
Fix some more activity stack derps
FLAG_ACTIVITY_NEW_TASK re-added to floating windows

ActivityStack modified to not cancel results if window is floating and "new".

Change-Id: I45f3dcc816092daa4192be91828592a0b2b2ac59

Conflicts:
	services/java/com/android/server/am/ActivityRecord.java
app loading: boost boost hints

Change-Id: I56b49c61ccfa258880b7104470f9c2cdf4542184
Bluetooth: Disable bluetooth only if BT Sevice is connected

Bluetooth service is imidiately disconnected from the adapter
after SSR OR if any bluetooth services is crashed OR framework
is crashed. As Bluetooth  service is not connected OR Bluetooth
is not enabled, So BT disable should be ignored & bluetooth
persist setting should not be changed.

CRs-Fixed: 499116

Change-Id: I19de939346d014cdf918e11711f2d6066e55d054
Add support for handling mobile provisioning networks.

When a sim is new or it has expired it needs to be provisioned
with the carrier. Basically provisioning is associating a sim with
a user account. When a sim isn't provisioned then operators will
restrict access to the network and only allow certain addresses
or services to be used.

This set of changes allows two types of provisioning networks to be
recognized. The first is a network that causes all DNS lookups to be
redirected to a different address than was intended. This is exemplified
by how T-Mobile works.

The second technique uses a special apn for provisioning. An example is
AT&T where lwaactivate is the provisioning apn and broadband is the
normal apn. We first try broadband and if we are unable to connect we
try lwaactivate. When we see the activate we identify it as special and
the ApnContext.isProvisioningApn will return true.

In the future our plan is to create a new network type that can be added
to the apn list, but for now it identified by name.

Here is a list of significant changes:

 - CaptivePortalTracker now only test WiFi networks instead of all networks
 - checkMobileProvisioning checks for provisioning networks and doesn't
   try to ping.
 - IConnectivityManager.aidl changes:
   * getProvisioningOrActiveNetworkInfo was added to and used by Manage
     mobile plan in WirelessSettings so even when there is no active
     network it will still allow provisioning. Otherwise it would report
     no internet connection.
   * setSignInErrorNotificationVisible is used by both
     CaptiviePortalTracker and checkMobileProvisioning so they use the
     same code for the notifications.
   * checkMobileProvisioning was simplified to have only a timeout as
     returning the result is now harder as we abort simultaneous call
     otherwise we'd could get into loops because we now check every time
     we connect to mobile.
 - Enhanced MDST to handle the provisioning network.
 - Added CONNECTED_TO_PROVISIONING_NETWORK to NetworkInfo to make a new
   state so we don't announce to the world we're connected.
 - TelephonyIntents.ACTION_DATA_CONNECTION_CONNECTED_TO_PROVISIONING_APN
   is sent by the low level data connection code to notify Connectivity
   Service that a provisioning apn has connected. This allows CS to
   handle the connection differently than a normal connection.

Bug: 10328264
Change-Id: I3925004011bb1243793c4c1b963d923dc2b00cb5

Conflicts:
	core/java/android/net/MobileDataStateTracker.java
	core/java/android/net/NetworkInfo.java
	services/java/com/android/server/ConnectivityService.java
Better API for low disk space warnings.

Provides uniform interface to ask about low disk thresholds; can
be mocked by other tests.  Opens door to adjust thresholds based on
disk type.

Switch monitor service to using new API, and use filesystem paths
from Environment instead of hard-coding.

Change-Id: Ifdb536e36a453f1b67bc65849037ec3cc0232cf2

Conflicts:
	core/java/android/os/storage/StorageManager.java
	services/java/com/android/server/DeviceStorageMonitorService.java
Unwanted code in input manager service
geofence: Low power geofence HW implementation

HW implemntation overwrites the SW implementation

Change-Id: I8762b0b2e3c5001622f9c8aa2a845ee64104faa3

Conflicts:
	services/java/com/android/server/LocationManagerService.java
Cleanup notification manager service
framework: Allow specifying max wallpaper width

For some devices with very high-res screen (1920x1200), the wallpaper
width suggested by the launcher may be too large for the GPU and so
we need to limit it. (2048 for the above mentioned screen)

We don't need to limit the height since that's the height of the
screen.

Change-Id: I5b25bd931db0b2610e260921f28b92d8b0966aa6

Conflicts:
	core/res/res/values/symbols.xml
Add Dock USB Audio Support for Samsung Car / Desk Docks 1 of 2.

Ported from CM10, original patch: http://review.cyanogenmod.com/20586

Also includes patches:
DockAudio: Always route audio back to normal on undock.
http://review.cyanogenmod.org/24830

Bugfix: Dock events can have state greater than 1
http://review.cyanogenmod.org/24995

------------------------------------------------------

Samsung docks have a non-sensing USB adio port.
Samsung get around this by having a separate Setting to route the Audio
The Changes made will only add the extra Observer if the Kernel supports the endpoint

  /sys/class/switch/dock/state

A new BroadcastReciever (SettingsChangedReceiver) is used to watch out for users changing the
Preference

The choice is made in the GalaxyS2Settings.apk (see 2 of 2)

  device/samsung/i9100/DeviceSettings/src/com/cyanogenmod/settings/device/DockFragmentActivity.java

After OnBootComplete and when the checkbox is changed, an Intent is triggered to this class.

When a Dock Event is caught if it is one the Samsung endpoint "dock" then if the users preference is
checked,
then the event is allowed to go on and route the audio.  If it is not checked then it is ignored.

Change-Id: I8e8f5001d5c651b07bb6af496bbf806732be21fa
Fix HTC headset handling.

HTC's headset driver adds additional bits to the switch state, which
we're unable to deal with. Fix that by masking out those bits and
keeping only the valid ones.

Change-Id: I29f0de9520ebb56d61acbc9a6dfcfc73e1f297d8
DockAudio: Route audio via dock for Samsung devices

This patch simply removes the audio routing checks for Samsung
devices and routes audio via the dock when the mobile is docked.

There is no option to disable audio routing out through the dock

Change-Id: Ie3f99101b051326913d06f1c78894d50035f6e62