Camera2: some aapt warnings cleanup

during the move from Gallery2 into new Camera2 package some
unused values were moved as well. Remove them

Change-Id: I4a514c76ccc70c61bb0a97ecafda7e1f9ede9f35
Camera2: wait for previous saving picture done during panorama capture

If saving pano picture thread is still running during onResume,
we need to wait until it completes.

CRs-fixed: 637244
Change-Id: I9ae5cb75a930421325d2e7d4d1b30306c867c6cf
Camera2: save the picture when rotate the device

If we rotate the device, the panoroma can not mosaic image, so if
we rotate the device, we should stop capture immediately and save the
previous capture frames.

Change-Id: I4ba304957d4083b4ae58c084239d6dc3d7f4dc89
CRs-fixed: 627105
Camera2: add new mime type for panorama picture

Add mime type 'image/jpeg', along with 'jpeg',
So the DISPLAY_NAME of captured picture is correctly saved.

Change-Id: I40a3c660311f1a3c69078ae3580dd74def9d69ba
camera2: Fix memory leak when suspend/resume camera

Clear Overrides Map when init, to prevent memory leak.

Change-Id: Iaca466f91fb7dc6273b03c2f148439fb1795b1d6
Camera2: Fix histogram cover the capture button issue

The change increase the histogram layout marginLeft, then
the histogram layout will not cover the capture button
layout when camera in landscape mode.
Crs-fixed: 622533

Change-Id: I58dc5518f6d96b759c352aea86e14b1acdccb1ea
Camera2: avoid histogram covering shutter button.

Histogram covers shutter button when the phone is rotated 90 or 180
degrees. Move it a little nearer to the center.

Change-Id: I85b187c95b9cf9ef680765042b9679a9e58577ee
CRs-Fixed: 657271
Camera2: update the flash icon when set HDR on

When HDR is on the flash mode should be set to off. And
the icon should be show as off too

Change-Id: I2cca985694e8a5a8058d6bf5467d5375514acfab
CRs-fixed: 645595
Camera2: fix The flashlight still is on after set scene mode not auto

If we set flash mode is on when scene mode is auto, the flash mode won't
be reset when change to other scenemode and still is on.

Set the flash mode is auto when scene mode is not auto.

CRs-Fixed: 678466

Change-Id: If3874c03dc70297326b6cd7dcceb1f4efde85956
Camera2: fix flash light turn on after resume camera activity

If user choose an app to open video, onResume will be called after
the choose dialog is dismiss. The function opencamera will be called
and the value mPreviewFocused will be set true, which lead to flash
light turn on when setCameraParameters.

The value mPreviewFocused won't be true if not in Camera Preview, we
can use the visible of mCameraControls to judge.

CRs-Fixed: 680450

Change-Id: Ia04ae0fb77f05fb991e5262f86cbe6f308db7709
Camera2: the menu button should not visible in some cases

When we start camcorder from other activity, we touch home key, then
back to the activity, this button will cover with the save button.The
patch will fix this issue

Change-Id: I74dc5f556d2a30af651d53b39c2bb4397a59884e
CRs-fixed: 633613
Camera2: enable WNR in video mode

Enable WNR to reduce noise in 720P recording preview.

Change-Id: I74471446b5fba0216b292f8fca81bf6e09b5d997
CRs-Fixed: 669247
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: Check if codec supports HFR resolution/fps.

Some codecs can have limitation on the max HFR fps and video
size combination. So, query the video encoder capabilites first
and report error if codec doesnt support the combination.

Change-Id: Ic2032176067a6f92d1363471d1a767d5ef589591
Camera: Change video capture duration with HFR

While capturing a video with HFR, duration is getting stored
properly in metadata but not in media database. While checking
details, duration is showing actual captured duration, not the
playback duration. After rebooting the phone, then media table
is getting updated with proper duration.

Fix made: After capture, change duration value as per user selected
HFR option.

CRs-Fixed: 627354

Change-Id: Ifb7c607e3545c4d2a2e0b1b7666cb0567640d416
Camera: Block DIS and Timelapse for HFR

DIS and Timelapse is not supported for HFR scenario.
If user'll start recording with timelapse or DIS with HFR
then crash observed from lower layer.

Fix Made: User'll be notified that HFR/HSR selection is not allowed
for TimeLapse and/ DIS mode. After that, HFR selection will be set to
off and the option will be disabled. It'll not be vice versa as
DIS/TimeLapse has higher priority than HFR for their existance in
primary popup rather than being in secondary.

[mikeioannina]: removed HSR code

Change-Id: I42ed3d3d20727ddda1b15c21b3ba85c8c41a82ef
CRs-Fixed: 627373, 627362
Camera: Disable DIS option for unsupported resolution

DIS will not work for unsupported resolution.
If user'll start recording with DIS alongwith 720p resolution
using front camera, then it'll crash.

Fix: Block in UI, so that user'll not be able to select DIS with
unsupported resolution after intimating through toasts.

Change-Id: Ie788d456a7b15061f16a44ca34ccd3d1e6d90071
CRs-Fixed: 644268
Camera: Block HFR option for Video HDR

Video HDR can’t work with HFR and that caused AEC behaviour change.

Fix Made: User'll be notified that HFR/HSR selection is not allowed
for HDR mode. After that, HFR selection will be set to off and the
option will be disabled. It'll not be vice versa as HDR has higher
priority than HFR.

[mikeioannina]: Removed HSR code

Change-Id: I4b0f8362667a53e46a83223cab77b7248e1410e2
CRs-Fixed: 652078
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
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