Camera2: correct image size recorded in media provider db

Photos taken in camcorder can't be previewed on PC via MTP mode. The
root cause is that, the actual image file size does not always match
the _size column in media provider database. During the saving process,
EXIF data are rewritten, but the size sent to media provider is not
updated accordingly.

Record bytes written in ExifOutputStream and OrderedDataOutputStream so
that after rewritting, the correct image size could be sent to media
provider.

Change-Id: I74d91e86d712c121eb50daecaf879ab4f5be97fc
CRs-Fixed: 711522
Automatic translation import

Change-Id: I392a4e2fd9f2ed6451bfa87cb859ef20c5667293
Camera2: Make menu not pop up in take picture interface

When we click menu key in view interface and take picture
interface,the menu will both pop up.

Modify condition to achieve not pop up menu in take picture
interface.

CRs-fixed: 652961

Change-Id: Ifc2e3b4535fdf48c110673a3ec633ecdc93cc37a
Camera2: fix sawtooth in camera preview

Under certain combination of preview/screen resolution, sawtooth is
seen on preview image. In setTransformMatrix(),
scaledTextureWidth/Height is unnecessarily rounded to integers,
losing precision. Removing the rounding fixes the problem.

CRs-Fixed: 705322
Change-Id: Ia78b012cf530528b3677a8684279862a81b145ed
Camera2: enable antibanding when dis is enable

banding will seriously impact DIS algorithm, so we need to
set anti-banding to auto when DIS is enabled.

Change-Id: I5ce9e907c68be803b35a929659fc1a9e0ac78642
CRs-fixed: 619074
Camera: cancel auto focus after snapshot done if in CAF mode.

When snapshot in CAF mode, CAF will be locked and update focus
status. Application needs call cancelAutoFocus() to resume CAF
after snapshot, otherwise CAF will keep in lock state.

Change-Id: I2aa3965e407d01efa9dd38b1cb840404390f29ce
Camera2: enable WNR in video mode

Enable WNR to reduce noise in 720P recording preview.

Change-Id: I74471446b5fba0216b292f8fca81bf6e09b5d997
CRs-Fixed: 669247
Camera: Decrease downsample factor for smaller resolution

After image capture, animation takes place with a downsampled
image (by factor 4). Due to downsampling smaller resolution
(QCIF and others) image size for animated thumbnail is going
below the allocated size and it appeared very small.

Fix: For image size of resolution CIF downwards, use downsampling
factor as 2 without affecting performance for other resolution.

Change-Id: I1098fc1a8f6fb880d5c36ebd2eaeec4415c75fe1
CRs-Fixed: 662891
Camera: Don't enable shutterdown for count down timer

For count down timer case, capture process should take place after
timer expiry. Otherwise flash is getting turned ON immediately after
pressing shutter button and then again during capture.

Fix made by not allowing to do anything related to capture process
except turning timer ON.

Change-Id: I843c88ccc9c03235dc6a2a7638221c778bfc6551
CRs-Fixed: 623445
Camera2: Remove CAF video duration code

Change-Id: I583e212f3c43a5ddf80fdb16557b3ddd9e3161c2
Revert "camera: add support for samsung and htc camcorder modes"

* This is moved to the device specific camera wrappers

This reverts commit e43890784fd08ac92de08691c7c6ba545c7ecb80.

Change-Id: I74ac0654ccf1e04cbb69e2fa8a2a651990b484a9