Camera: don't display picture size unless supported

Otherwise the option will force close when selected

Change-Id: I2047c90ab08e7d7abcf11d817b5ddf106df2c732

Conflicts:
	src/com/android/camera/PhotoMenu.java
Revert "Camera: add config option to disable snapshots during videos"

This reverts commit 5f4b6fb6fa44057a30897dd99ca6b9cde13bd8f9.
VideoModule: check for videosnapshot support in onSingleTapUp

onSingleTapUp is now triggered through PreviewGestures instead of
ActivityBase, so the check in initializeVideoSnapshot() is no
longer enough to prevent triggering video snapshot on unsupported
devices.

Change-Id: I5f6e14f1125a9d47e03bb35fdc4ff358c589b73e
Camera: Update storage hint in full screen state change listener.

When user swipe from gallery to camera, storage hint was not updated
based on the latest storage space. This change will call update storage
hint in full screen state change listener callback.

Change-Id: I9950cb165ae49a7d062c012f24e63898045d0c6c
CRs-fixed: 522710
Gallery2: camera: disable all camera controls ASAP when swtich the camera

Camera switch button is a pieItem, there is a fadeInOut animation for these
kinds of menus. And the onClick event deliver to upper layer happens after
the end of the animation which lasts 600ms. We should add another event
callback before the animation to disalbe all camera controls as soon as
possible.

Change-Id: Iddcb9e9452aa0ff6ea8485c08c9c56b067995fb5
Gallery2: Clear undefined buffer before first draw

Clear undefined buffer before first draw.

Crs-fixed: 526603 523916
Change-Id: I1cfdb621bdcf08dc8994adddb0111a1aaf941f56
Camera: Fix camcorder crash during pause and resume

When camcorder is suspended in background, if it receives resume
and pause event in very short interval, crash will happen.
After receiving resume event, the onresume method will be called,
and it will start another thread for starting preview. And soon,
the main thread receives pause event, the onpause method which will
close camera is called.
There will be a racing between the main thread and start preview
thread. If close camera get done first, crash will be observed.
To avoid the racing, the close camera operation should wait for the
start preview operation, and the join method is used here for
synchronization.

CRs-Fixed: 526007
Change-Id: Idf6a8660378bf1a65af1f5194a35d30822f1dcf6

Conflicts:
	src/com/android/camera/VideoModule.java
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 concurrency issues with camera messages

Without this, multiple threads are
trying to access same data and
resulting in crash.

Change-Id: I1de6f6b85e257f40a4426c7684227606f81c720a
CRs-Fixed: 542706

Conflicts:
	src/com/android/camera/CameraManager.java
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: 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