Camera: Bring Samsung camera fixes and features to 4.3

Squashed commit of the following:

commit 2f774cdc9f056ee7688f0fbb60624eb1baddb41f
Author: codeworkx <codeworkx@cyanogenmod.org>
Date:   Mon Dec 10 22:50:41 2012 +0100

    camera: add support for samsung and htc camcorder modes

    Change-Id: I68e6995a51dffa3b5851eb4b7a3a72e60d201d5b

commit 2f0e1b5a87b4625280deeed168b4acdca703e729
Author: Steve Kondik <shade@chemlab.org>
Date:   Tue Feb 12 13:30:57 2013 -0500

    camera: Add options to better control video preview size

     * usePreferredPreviewSizeForEffects is needed to fix camcorder effect on
       some MSM8660 devices.
     * Add ignorePreferredPreviewSizeForVideo to use the best size reported
       by the driver instead of the preferred-preview-size-for-video value,
       which may report something really awful.

    Adapted for cm-10.1 from similar commits in jellybean.
      https://github.com/CyanogenMod/android_packages_apps_Camera/commit/5ea90585dfce5a38f0c91d2ae07145770a0ea569
      https://github.com/CyanogenMod/android_packages_apps_Camera/commit/7310af07d00910033adbd2dce6aaf8b04cd1f220

    Change-Id: I58d4f81333a26dbd6d1ce35037b9c32fbd7d5b69

    Conflicts:
    	src/com/android/camera/VideoModule.java

commit 8969fd7025f166ee55c7fe5fe9964690c69b7a10
Author: codeworkx <codeworkx@cyanogenmod.org>
Date:   Mon Dec 10 23:04:04 2012 +0100

    camera: allow setting video-size before recording starts

    Needed for some samsung cameras.

    Change-Id: Ib87071bdd900aa1a42253bf6e2038b0af51f065b

    Conflicts:
    	res/values/config.xml
    	src/com/android/camera/CameraSettings.java
    	src/com/android/camera/Util.java
    	src/com/android/camera/VideoModule.java

commit 7cb706a3e5291b402c537f84ea30f5f8dca58e53
Author: Ricardo Cerqueira <cyanogenmod@cerqueira.org>
Date:   Wed Jul 31 10:02:22 2013 -0400

    Many camera HAL's stop the preview while taking a picture without generating events to upper layers
    Use "previewStopsDuringSnapshot" to avoid sending a stop while it is already stopped

    Forwarded from 10.1 camera - original commit 115d7184ee43703e4fcd3c248beea9b4090d0111

    PatchSet2 : credit original Author
    PatchSet3 : rebase to depend on 4.3 changes commit
    PatchSet4 : remove trailing spaces

    Change-Id: Ie7defc85d31bbbd9d132b8b488014b880cc1640d

commit afe0881439dedcd0fd665a8813c6260882b2a4cf
Author: Shareef Ali <shareefalis@cyanogenmod.org>
Date:   Sun Jul 28 12:37:36 2013 -0500

    Camera: fix derp and upgrade to 4.3 API

    Change-Id: I8079e35e753edbbcfd36d3d8a173e831621a5481

commit 7f11966b79c646c9ddf38634ad0726ad73befe8d
Author: Shareef Ali <shareefalis@cyanogenmod.org>
Date:   Mon Jul 22 03:08:42 2013 -0500

    Camera: HDR: don't reset focus manager when HDR is active.

    HDR takes time to compute. So disable any refernce to zsl except
    for actual take it in zsl command.
    due to a recent commit http://review.cyanogenmod.org/#/c/45730/
    I didn't know it was merged in less than 24 hours as HDR commit.

    Change-Id: I2aa3f4146575329c6fefb259b099371080842dab

commit b2ecd462457040a3408fe88079f6069013c31377
Author: Dheeraj CVR <cvr.dheeraj@gmail.com>
Date:   Thu Jul 18 14:40:48 2013 -0700

    camera: fix image capture review mode when zsl is enabled

    Choosing "Take Photo" to change a contact image doesn't show
    the captured imaged after taking a snap if ZSL is enabled.
    Also observed on apps that use the native camera to capture
    an image like Whatsapp.

    In ZSL mode, the preview is not stopped, due to which the
    review mode (ImageCapture) doesn't show the captured frame.
    Hence stop the preview if ZSL mode is active so that the
    preview can be restarted using the onReviewRetakeClicked().

    Also, reset the autofocus and set the camera to idle only
    when the ZSL mode is active. This fixes issues with non ZSL
    cameras where autofocus works even during the review mode
    after taking the snap since the camera state is set to idle.

    Change-Id: I2aa3f4146575329c6fefb259b09937108084fdab

commit 09a082533d7224443f5f7b0e41cc67a09af2b1d2
Author: Dheeraj CVR <cvr.dheeraj@gmail.com>
Date:   Wed Jul 24 18:34:42 2013 -0700

    camera: dont call cancelAutoFocus if the preview is stopped

    Most sensors cant cancel autofocus when preview
    is stopped.

    Change-Id: I66c2ddcedf3ed42a00e8364daab2b2906ba3301c

commit 5076f24ac501900692f3aaef6cfa0ba45deaaf6c
Author: Shareef Ali <shareefalis@cyanogenmod.org>
Date:   Fri Jul 19 23:53:01 2013 -0500

    Camera: HDR:  fix rotation issues.

    * fix fake rotate with real rotate by replacing the image with actual rotated image.
    * ps2: add more rotation mode

    Change-Id: I751cee4b9694180912d3bb0509fd12e295fbcb18

commit 41222dc4557a7e57f22149db7a9d80f61701682a
Author: Shareef Ali <shareefalis@cyanogenmod.org>
Date:   Sat Jul 13 22:29:23 2013 -0500

    Camera: HDR: fix low exposure on samsung hardware.

    /* samsung actually speficify max HDR range via exposure compinsation */
    Change-Id: I48b31965cf5acb6b9abcd2a62b1d341bfcab649c

commit de966f526165c3482445a6b506ab2184caff5a12
Author: Shareef Ali <shareefalis@cyanogenmod.org>
Date:   Thu Jul 4 02:45:09 2013 -0500

    Camera: HDR: convert YUV422P / YV16 format to JPEG

    Change-Id: I6310793e5e2d10e2d5e3d374aafe9761273259fc

commit 178ef452b7d2d9140a12eedf9f93e11a9c76465b
Author: Shareef Ali <shareefalis@cyanogenmod.org>
Date:   Tue Jun 25 18:39:36 2013 -0500

    camera: reset camera surface on previewstart()

    fixes aspect ratio on camera switch bug

    JIRA: CYAN-1085

    Change-Id: Ic91e0454588a987e72e5336ab9d01bdd249f13e6

    Conflicts:
    	src/com/android/camera/PhotoController.java
    	src/com/android/camera/PhotoModule.java
    	src/com/android/camera/Util.java
    	src/com/android/camera/VideoController.java
    	src/com/android/camera/VideoModule.java

commit 3fc823f6b47228ab9843d828dd983bc2b1dd8e3e
Author: Jorge Ruesga <jorge@ruesga.com>
Date:   Sat May 25 21:46:43 2013 +0200

    Camera: Wait for camera initialization

    Patchset 2: Capture specific exceptions instead of a generic exception

    Change-Id: Id62d0dedc630c3815dca7b101fdbf731154be3ca
    JIRA: CYAN-1190
    Issue: https://jira.cyanogenmod.org/browse/CYAN-1190
    Signed-off-by: Jorge Ruesga <jorge@ruesga.com>

commit 65dd92063dcdede7e053ca0ec36f4f453c3d4391
Author: Steve Kondik <shade@chemlab.org>
Date:   Wed May 8 11:35:20 2013 -0700

    camera: Fix hang when changing picture size

    Change-Id: I46d060d470b96be56d84f273accf54702e72b321

commit 66003f2c1f73ce7857ca3aee52db1c8870ac8a8e
Author: Steve Kondik <shade@chemlab.org>
Date:   Sat May 4 03:17:08 2013 -0700

    camera: Add support for ZSL on new Samsung devices

     * The camera driver on new Samsung devices requires that we send a
       magic command to the hardware in order to get ZSL behavior with
       continuous preview. On previous devices, this worked as long as the
       "cam_mode" parameter was zero (instead of null) and "camera-mode" is
       set to 1. On JF, we need to do all of these things.
     * The command we need to send is 1508, but I do not know what this
       value actually corresponds to. It was discovered by reverse
       engineering.

    Change-Id: I6bccc9cd228784045eef81719892121749af4fa5

commit 57f2a7a15eaa1979a17fe0f074c258c03e90baee
Author: Steve Kondik <shade@chemlab.org>
Date:   Wed Feb 29 12:59:19 2012 -0800

    camera: Restart the preview if record size changes

      * Needed to release the buffers on many cameras when the record size
        changes but the preview size does not. Without releasing the buffers,
        we can run out of ION space and end up with a mangled recording.

    Change-Id: I3ebee850b3e20b3920368c8e052a428f6dd9e3e5

commit c359b9edc7a089965a425efe80a59a9a268fce5a
Author: Steve Kondik <shade@chemlab.org>
Date:   Sat Dec 15 20:31:59 2012 -0800

    camera: Add ZSL support for Samsung/Qualcomm cameras

     * Preview management for Samsung/Qualcomm cameras
     * Add workaround for broken face detection on front camera

    Change-Id: Ib36bd21c9a76b45bced3eee2f25acc35b5d82b30

commit 637e1c973abc0b231722c9eb177abb108da50cad
Author: Ricardo Cerqueira <github@cerqueira.org>
Date:   Mon Dec 10 10:15:22 2012 +0700

    Camera: Allow a device to request the focus modes at build time

    By default, if a HAL supports touch-to-focus, mode selection is
    disabled. Make that an option for devices where manual modes
    work better without TTF (Macro, for instance)

Change-Id: Id47fba2a9d156b157440485a0fa516871076d9f9
caf updates + fixes + several new resolutions + audio mode features

+ string seperation

Change-Id: Ia59215b746009896c4183f1f2d07ed1b59d55b35
Gallery2: fix HDR crashes && fix exposure from being set.

* HDR transcoding is done on a different thread. got rid of the
stall in the transcooding step and possibliy fix race conditions.
* lock out the exposure step from being set, also fix an issue
of setting is being set by a method that is called on idle.

Change-Id: I9558558777a11cc8f6b633e397c809aa6993ceaf
Storage location configuration options

Based on d050f80 and 2bb0437 in the former Camera package

PS2: Whitespace cleanup

PS3: Fixed filmstrip preview from camera.

PS4: Check volume availability

PS5: Load the settings when either the camera opens
  or when the gallery opens

PS6: Remove unused import

PS7: Rebase

PS8: Change icon to stat_notify_sdcard, add credit for
  original sources

PS10: Code style cleanup, include icon, and add setting
  to the camcorder settings

PS11: Rebase, reword commit message

Change-Id: Ic484149f1f051aea5c5c8440bbc322e9924683a7
Translating Gallery2 to Russian

Fixed encoding

Fixed encoding again :(

Change-Id: Ia317ab3cc091d48bef155c7e620769165e3a2a75
Videocamera: Fix the settings panel freeze

The panel freezes after change time-lapse or quality settings

Change-Id: I06c0d15e0a6434a796e8f9b3c0e4e4d8622935f5
Fix up audio effects dialog

- Entirely remove string referencing Snapdragon, as there's nothing
  Snapdragon specific in the audio effects
- Remove title of the switch, it only duplicates the dialog title
- Improve margins

Change-Id: I5d2da3b16dcf60ece9b5db36cf2fc65c4a23c275
Merge "Fix up audio effects dialog" into jb4.3
Camera: add Smart capture

add back smart capture feature. Recoded and addapt to the
new aosp camera. This time each camera and video can set it
seperatly.

drawables by kbeezie

Change-Id: I87a895c21c53d11cab573df4fd76f1628ca03b1a
Camera: ensure that camera exists to fix possible NPE

on keyguard it can happen that the camera already is released
but GET_PARAMATERS is accidentaly called after that
check for mCamera != null to avoid this scenario

Change-Id: I663674b516d9b9bd916456f6341ec2eecc33b299
Camera: add True View back

like smart capture recoded partly and changed to new aosp camera

drawables by kbeezie

Change-Id: I2e0a29a34da09eabad281c8173e42533ac580bb8
The cropped picture can't be saved if it is in /extsd

Add WRITE_MEDIA_STORAGE to access the non-primary storage

Change-Id: Ie245171e9e1e60e84a3cd17ce06793918152044c
Signed-off-by: guoyin.chen <guoyin.chen@freescale.com>
Camera: Add a GPS indicator

This will add a GPS indicator to the preview of the photo camera.
The indicator is placed as an overlay at the upper top corner
of the photo camera preview.

It shows one of three icons depending on the GPS state:
    - acquiring fix
    - GPS fix acquired
    - GPS disallowed in system settings

changes to 4.2.2 version
    - gps icon animates during getting a fix
    - show on video mode as well

Drawables by blunden.

Change-Id: I2f91d6aa12b2629f2c19c564cf646dcc385a7ab9
Camera: add color effects

drawables by kbeezie

Change-Id: I389d621e73bd14e6c85c62edc75c93b5282d4c3a
Camera: finish Settings in new google style

for whatever reason google missed to change the video camera
settings into the same conistent PIE style like camera. As well
with the comming features it is a bit complicated to add so much
icon in one PIE layer

This commit does:
- most common features are in first level
- second level more options are now in real more options which are less common
- settings is now a new 3rd PIE level where only real settings are included which
  the user normal just set one time
- Video settings completly overworked and have now same PIE style like
  Camera and no oldschool popup menu style.

Change-Id: I026099d3c530fe9a3d4dc877ff09e2896c0abdb3
Camera: add jpeg quality setting

Change-Id: I812203e6a020d31ac848fe8e5032fa53ac950239
Camera: add gallery shortcut into cameraswitcher

Change-Id: I0c7c93250a81b7c5e4fe65eb9515bf9d1f08af8c
Camera: seperate color effect for video and camera

more user friendly

Change-Id: I45443ac13b8ce7e6ca98f2c75e184579b2de9d9c
Camera: add jpeg quality option for video snapshots

and keep them seprate to the camera option

Change-Id: I74ee9e796e6fadb875ebe2a7dea955e6af97b5b2
Change I87a895c21c53d11cab573df4fd76f1628ca03b1a translated to Russian

Change-Id: I15324e08218bf1494baf11e7e589712cf089e4b6