Gallery2: fix the display error of camera manu when rotate it

including: manu of native camera and camcoder

Crs-fixed: 529692 532833
Change-Id: I302358fcf9fbde722d8b032b89ee6c0d39d76a8b
Camera App: return after synchronized block

For some boundary condition when surface allocated is null, due to
return within synchronization block it is giving ANR. This change
will ensure that return take place outside synchronization block.
It will also ensure to notify an object if already in wait state
before invoking wait on it.

CRs-Fixed: 529666
Change-Id: I8532aa410840785923388a879701be9e98b0154f
stop recording from camcorder app in case of error.

This change makes sure that stopvideoRecording is called
for all error returns to the video recording app.

Change-Id: I70a942dab24e2665d76b3ff060e7ccf3d134e429
Gallery2: reduce the camera switch animation duration to 200ms

It is too long for the animation duration when switching from
the back sensor to front or vice-versa which costs 400ms. Reduce
it to 200ms to enhance the KPI.

Change-Id: I0ef532aa88104de3ea0ea859b36f8d8cbf457194
Camera: Fix crash during open and close camera

When we open camera for the second time after opening camera,
switching to camcorder and exit camcorder rapidly, crash will
be observed. It's due to the assertion of double open.
When app receives pause event, it should cancel the switch
animation, as we as it's listener.

Change-Id: Id351d3e5db63c54646d592b728a4624e3d6e1211
Camera: Do not create start preview thread if one thread is alive

It will have exception if two same thread tried to manipulate
same UI component, check the thread status before create a new
one.

Change-Id: I6f9a5c03f46360d15fdcebcd52c48b924f5b42ad
CRs-fixed: 545574
Camera: Block shutter button during mode switch

Video recording will crash if start recording before startpreview is
done, so we need to disable shutter button before preview is ready.
Move the function which block shutter button after showVideoSnapshotUI
as the button will be enabled inside this function.

Change-Id: I9b7c4e352bd1f15742a4bdb7494a2e53f25d7a99
CRs-fixed: 545612
Gallery2: reduce the latency between cam&camcorder switch

There are animations of fadeIn and fadeOut effect when switching
from camera to camcorder or vice-versa which all last 300ms, thus
the black UI observed too long. Set the animator duration to a tiny
value for reducing this latency.

Change-Id: I9cee228e641ad82e7001e091944a30515f96ab2e
Camera: reduce the camera button animation duration to 100ms

It is too long for the animation duration when touch the button
which costs 600ms. Reduce it to 100ms to enhance the KPI.

Change-Id: I9a105c561419594e5a81e83f7ae3786e4eb86b8d
camera: improve snapshot KPI

In camera snapshot, thunbnail slide animation is start in JPEG
callback, make it start in raw data callback so that it can make
use of JPEG encode time which in turn shorten the snapshot time.

Change-Id: I1ce8a768a1cb54e8244725bdcb1e49d3ca5a914b
camera: Fix camera startup racing with orientation change

 * When launching the camera via the lock screen widget on some devices,
   the orientation change shows up late, and we get an
   onConfigurationChanged in the middle of setting up the textures,
   causing an infinite wait in the UI thread.
 * Ignore these events until the preview is up and running, orientation
   will be checked later.

Change-Id: Icf5013e039324d617acd1c1108d37c655776c1c3
Gallery: Fix filmstrip source index

Change-Id: I0213871f47fb386ddce5728f0079eb7884e6d9d4
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
Add 20.7MP resolution

Change-Id: I25b06b3829864f99a01d6911d5850a41ee496628