Fix keystore access when utilizing quick unlock

Change-Id: Ia37b380312268f26235858612c93a84eb06e76ea
framework: fix notification icons not animating till ticker is updated

Fixes Android issue #15657

Change-Id: I7e9d3fedcd3643c50ee1367d07e2d5233dc02f2b
Merge "Fix keystore access when utilizing quick unlock" into ics
Give consistent names to properties controlling camera shutter sound

There is a property named "ro.camera.sound.force" which control if camera sound should be played
even if phone is in silent mode. This is standard property and it is not affected by this change.

Another property (used for HTC vivo/vivow/mecha devices) disables camera shutter sound on system level.
Currently it is named "persist.camera.shutter.disable". Renamed to "ro.camera.sound.disabled" to
keep consistent naming with previous option. Also, this property is intended to be read only
and therefore should live in "ro.*" namespace.

Adding support for third property, "persist.sys.camera-mute" which will allow control over camera
shutter sound if it is not disabled by prevoius property.

imported from gingerbread f62a0e8b12f06215454eee2a30f648e3d190be78

Change-Id: I447f9bc61ca20022d5b62ef9ea231d6a1d0b38d7
libstagefright: Enable hardware thumbnail generation

Hardware video decoder will be used to generate
thumbnails if the software decoder fails.

- Enabled for 8660 and 8960
- Add property to disable use of sw decoders for thumbnail creation
- Additional debug logs in metadata retriever

Change-Id: I249d7be146b5d07468826f28f7843a208ed39c1b
libstagefright: Add HW thumbnail support for 8x55.

 Adding changes to support HW Thumbnail generation for 8x55
target.

Change-Id: If43ff1cd7764407890a86c555f3baebec8e99ae4
libstagefright: use hw codec only for thumbnail mode

     - Makes sure StagefrightMetadataRetriever use hw only codecs
       for thumbnail mode.
     - In cases where hw codec fails and exits without fully starting
       SFMetadataRetriever may allocate sw codecs further down the
       list
     - Attempting to start thumbnail mode for SW codecs will result
       in assertion fail

Change-Id: I6190d8c3190703ead44d20f4a988110fdb549ec7
(cherry picked from commit 798e5085870ed79764324fb9b22b0b1cfeeead7e)
libstagefright: Software decoder is the first choice for thumbnail generation

Set the flag to use software decoder only for the
first call to extract video thumbnail.

Change-Id: I09b3b3da5bfe57f21b0fecfbcc5aff7337bb91a2
CRs-Fixed: 323190
StagefrightMetadataRetriever - fixed source start assertion failure on MPEG4Source

 - OMXCodec calls start on MPEG4Source
 - in occasional cases during thumbnail generation when buffers cannot be allocated
   by OMXCodec, init() will fail along with start() with MPEG4Source still started.
   StagefrightMetadataRetriever will then attempt to start OMXCodec again which calls
   start on MPEG4Source, causing mStarted assertion failure in MPEG4Source start()
 - this patch calls stop on MPEG4Source in case when decoder->start() fails by calling
   destructor of MPEG4Source (which stops the source safely) and remaking the source
   using the getTrack() call in Extractor

CRs-Fixed: 326063, 325461, 323538
Change-Id: Ib16444f6d3a0589fdb26e79d8323ae1edf90a5a1
StagefrightMetadataRetriever: use cm platform naming

Change-Id: I8bd00396c6ba34237a4b6217e8a37f62a331df9d
frameworks/base: Handle Out of Memory Exception when creating video thumbnails.

Adds code to handle an out of memory exception when generating the thumbnail
from a recently recorded video clip.

Change-Id: Ifcbe007272ffef85744fca1414ea5eacccd0154c
CRs-Fixed: 277571
libstagefright: Fixing a crash in EOS for thumbnail generation.

Initializing an uninitialized variable and fixing
a crash. At EOS OMXCodec::read was returning OK and
a NULL buffer. This is not a valid return combination
as client expects buffer to be non-NULL when there
is no error. With this change OMXCodec::read
will return ERROR_END_OF_STREAM with a NULL buffer
which is a valid return combination. This change
is specific to hardware thumbnail generation.

Change-Id: I83ebdc69e2195b903ea652cb46bf91df48457eec
libstagefright: fix thumbnails for videos with non multiple of 4 width

- videos with width not a multiple of 4 will fail thumbnail
  generation
- this fix changes the dest width in converter routine to the
  rounded up nearest multiple of 4
- this fix will not impact already working videos as they are
  already at the nearest multiple of 4 in width

(cherry picked from commit 18720176cbd6b1817b1396e1c7768ce6f44db910)

Change-Id: I104c2f26706876c5314304508f87a8e35b6d4659
Crs-Fixed: 331371
Hardware key custom rebinding (1/2)

Framework changes to allow rebinding of the actions performed on the following
key press events: Home long-press, menu press, menu long-press, search press,
search long-press, app-switch press and app-switch long-press.

The available actions are: Nothing, open/close menu, recent apps switcher,
search and voice search.

Patch Set 2: Added in setting to show action overflow in app interface.
             Devices without hardware search key default to using long-press on
             menu to search.
             Some other clean up
Patch Set 3: Added app-switch key customisation
             Other misc. tweaks

Change-Id: I63b67cb97084281fccf83466da075b7af89ab5ed