Allow mounting of multiple volumes via mass storage (framework part)

(cherry-picked from CM10)

The volumes to mount is taken from storage_list.xml (allowMassStorage)
rather than ro.additionalmounts in CM7.

Hand ported from the following patches:

commit 0233209827d95221399b1fe0185f79863fc6bf26
Author: Tony Layher <layhertony@gmail.com>
Date:   Sun Jan 2 12:46:38 2011 -0500

    forward port of 93bb95929a0c017498625a87654b4d114fe17b96 to allow mounting and sharing of mulitple volumes to MountService.

    Change-Id: I9fa3994e6e7b85360b451f57c1cdd4df921bc035

(the second part of the above patch was not ported)

commit 678fadf517126c8468ef2d8dcaea9c9fce96035b
Author: Josh Stone <cuviper@gmail.com>
Date:   Sun Nov 7 13:38:58 2010 -0800

    MountService: Remount all volumes after USB disconnect

    If USB was removed while UMS was enabled, the MountService was only
    remounting the primary share.  Any other shares, like the HTC Inc's
    emmc, were left in limbo.  This patch now iterates over *all* shared
    volumes to remount after disconnect.

    Change-Id: Ie6fd49ad80ba6fa0e4e194a386549cac786b4bbe
    Signed-off-by: Josh Stone <cuviper@gmail.com>

commit b1da9ed003edcd10ccda56fdf087e8f1b0f77b2a
Author: Josh Stone <cuviper@gmail.com>
Date:   Sat Jan 22 12:03:53 2011 -0800

    MountService: Only notify PackageManager for true ASEC changes

    MountService can be dealing with multiple mounts (emmc, sdcard), but
    only the EXTERNAL_STORAGE has any ASEC mounts on it.  Since the PMS
    updateExternalMediaStatus doesn't specify the path, we need to make sure
    it's only called for the real ASEC mount.  Otherwise we get into nasty
    race conditions when multiple mounts are coming and going, like during
    UMS transitions, and sdcard-installed apps tend to break.

    Change-Id: I85c6a601e84afd30b44270b0892686c2d864ce8d

commit c8c58f3d14fbb8c77ab1e90541e59fb74bef54cf
Author: Josh Stone <cuviper@gmail.com>
Date:   Sun Mar 6 12:34:50 2011 -0800

    MountService: Unmount secondary volumes more carefully

    Use the same message handler for unmounting both the ASEC external-
    storage path and any secondary paths like emmc.  This seems to help with
    additional race conditions encountered on Inc.

    Change-Id: Icca71756fa6721bd85da1f35b8b8c7fc7caa1eb1

commit 47495ab860ed97499e0c4268bf40b1f9c429bf99
Author: atinm <atinm.dev@gmail.com>
Date:   Sun Apr 10 14:50:41 2011 -0400

    Allow multiple shareable SD Cards by using getShareableVolumes()
    to get all the volumes that are shareable and allowing
    sharing/unsharing for all of them rather than just the hardcoded
    getExternalStorage calls.

    Unmount immediately if PM is not updating and not an ASEC
    mount. Change from Josh Stone.
    Change-Id: Iaf1a7a4484deac373e1c1d7bf16d5f22ca49fd64

    Only allow package manager for sdcard (packages aren't on
    external card).

    Change-Id: I0d148ea52dc1285905a9dd061d1ceedcfb761b52

    Take out extra logging.

    Change-Id: I6beb007700ef4be04c3eb273bbf2069c87b30011

Change-Id: I5ea83afeda6cdaf63dd15857b3827bb00afbd6d2
(cherry picked from commit fe12a3008d7743911168813677610283fddd4c79)
(cherry picked from commit 850f5577344e9702c2cb49435230f4d942f8d5ca)
MountService: Account for switchable vold pair

Switch the volume properties when persist.sys.vold.switchexternal is
in effect.

Change-Id: Id475a4704c17a3da418758994b7ad73a3928c99b
(cherry picked from commit 62c518f3e3293885a4f7045aed2ad8c234d0d97a)
fix HALO silence bug when notification is dismissed

(cherry picked from commit 9e76c018d13318364349ba8ca25058a05fc65fb2)
Allow multiple emulated storages at the same time.

Only do multiuser mapping for primary emulated storage as per google docs.
Allow all non-primary emulated storage to have id other than 0 so that
it could be distinguished from the primary volume.

Change-Id: I7b70b9067fd6211055fb9074710f48107d7b0e8e
(cherry picked from commit 02066e5844345600b3454d4233761727eb914b42)
Fix hardware keys mess (1/2)

Squashed commits from CM

Fix virtual key press detection.
Virtual key events can be injected from anywhere, not just
PhoneWindowManager.

Change-Id: Ia9529c6534a208bf713912fc63f81a016754c6a6

policy: fix menu key for devices with no physical menu key
Initialize key behaviour correctly for the case where the respective key
isn't present in hardware.

Change-Id: I424f879dcf5e09c0897d7ebf7646efe36661d108

Fix ordering of home keypress handling
* Home keypress handling was done out of order, causing an extra go home
  action to be executed.

Change-Id: Ieb2f6ffbf6d1e18a5d4602975f48717089e5c9dc

Reimplement AOSP's home-key behavior configuration
Add support for resource-based long-press and double-tap behaviors,
bringing back the functionality introduced by Google at change
I4564d9e4d127f782ed5bd8eb613ef8f2255176cc on top of our own
hardware key rebinding code

commit caca881
Author: Jeff Brown <jeffbrown@google.com>
Date:   Thu May 9 13:34:33 2013 -0700

    Support double-tap home to go to recents.

    Add config resources to enable the following behavior for
    certain devices:

    * press home - go home
    * long-press home - launch assist intent
    * double-tap home - open recents

    Bug: 8891502
    Change-Id: I4564d9e4d127f782ed5bd8eb613ef8f2255176cc
    (cherry picked from commit b780569)

Change-Id: I578700abf8c51e613a4227cdf9f6c3bff90feec9

Detect whether overflow button should be shown based on menu key state
Some devices may have hardware keys but not contain a hardware menu key.
Hardware keys are also able to remapped. The overflow button detection logic
currently does not take that into account. This change allows detects
whether any key is capable of emitting the MENU_ACTION keystroke in
order to determine whether the overflow button should be shown or not.

Change-Id: I8699bd0242560314f8eadc54b187c69c992cf875

Adds ability to answer call with hardware HOME button (preparation to…
… winter time)

Change-Id: Ic11449acf87c6b4d932142b74158af7441658b3d

Patch set 1 : Upload the change
Patch set 2 : Only change the real Author
Patch set 3 : Bugfix:
              Add register for the ContentObserver (Settings.Secure.RING_HOME_BUTTON_BEHAVIOR) in PhoneWindowManager,
              and correcting the logging functions and deleting some unneeded comments

Framework: Forward port Long press back to kill app
Original author: DaneshM

Change-Id: I54f4fb861897fe713cffa15422535c5091a0c095

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
(cherry picked from commit 5e23540367aa83ca5f539ff2bc1b93fd51ebf807)
Telephony: Introduce config item for Hot Swap support

When a Uicc Card is inserted or removed, Android pops up a prompt
to the user to reboot the device. This prompt is unnecessary if the
modem supports Hot Swapping of cards.

Introduce a new config item to indicate if the modem supports
hotswapping. Frameworks can then check this before propmting the
user.

Change-Id: I0f2c3134525aa2301fd667d0a1819f4419eecae0
(cherry picked from commit 1e091269119f88f5085426cd7fe5bbabf2384ff1)
Re-add clock padding

Change-Id: Ib55039497f648f6c987330a2ae6f84c6c6617908
(cherry picked from commit dcecbfe21246acd19fbb47ee90f8f19c010a676f)
halo, wrong touch calculation, nap trigger fixed

Change-Id: Ib09163d71cddb2cbe8f375313e0c1e03b37fd504
(cherry picked from commit 7bd2b4a756d774d96218eaf41014d8a147a6c922)
halo, still wrong multitouchhandling

Change-Id: Id9c00c25add4a493309f170eb97acf0a06c378d0
(cherry picked from commit 07ad69e033f571bf834e507f70479bc493ad9d6b)
halo fancy flÃoip

Change-Id: Id40356ef28e96c055448f0a399da444da77f7c7d
(cherry picked from commit 1f9843348ec1dd2c91ece2061a8246d37b0e567a)