Camera: Powerkey shutter (2/2)

Ported from cm-10.1

Including cm-10.1 camera commit:
aa4ae80a41fbab763891c5ef6d67a9e5b4bb981b Don't mess around with pref local ID for power shutter initialization.

Includes http://review.cyanogenmod.org/56986
PS2: Make Camera2 a privileged app
PS5: Sign with platform certificate instead of making it a privileged app.
PS6: Add write permission to PREVENT_POWER_KEY
PS7: Move PREVENT_POWER_KEY permission to CameraActivity
PS8: Revert to PS5

Signed-off-by: Michael Bestas <mikeioannina@gmail.com>
Change-Id: I0992baa558eefd306d00fbece59cb5c512d9448b
Camera: Cleanup hardware key handling

* Fix power shutter behaviour in camcorder mode
* Disable volume change while in panorama mode, volume buttons should only
handle camera operations while in the camera
* Add camera/power/volume key shutter handling in panorama mode

On devices with a hardware camera key:
* Disable power & volume shutter features
* Volume buttons control the zoom

On devices without a hardware camera key:
* When power shutter is disabled, volume buttons control the shutter (like AOSP)
* When power shutter is enabled, volume buttons control the zoom

Change-Id: I141946d5b6f5aec8b1e9a9f99270d30295596079
Camera: Handle keys only while in app

Thanks to Lars Greiss (SlimRoms)

Change-Id: I63f757d25260fba4683f494f8b4daf178a2b4e13
Merge "Camera: Powerkey shutter (2/2)" into cm-11.0
Merge "Camera: Cleanup hardware key handling" into cm-11.0
Merge "Camera: Handle keys only while in app" into cm-11.0
Camera: Fix saturation, contrast, sharpness parameters

* Old-style QCOM HALs use <setting>-max, new style HALs use
  max-<setting> for these parameters.

Change-Id: I3b0dbd04f072cb69d09c44b5b3af1097560205b3
Camera2: RU translation

PS1: Restored strings that are marked as translatable again,
     translated some more error messages.
PS2: Translated Storage configuration option.

Change-Id: I93c897ada51ea60bd5a2f52799709b4269d8287b
Camera2: CA translations

Change to Transifex

Change-Id: I94e5dc1e9943643c8699697c86b97d0b2e844118
Signed-off-by: arnau <arnaullv@gmail.com>
Camera2: actually fix ArrayAdapter on MoreSettingsPopup

Like CAF already discovered googles attempt to handle the
ArrayAdapter listview does not work as expected if the scroll view
is larger then the screen. CAF tried to fix it with this commit on landscape
view

https://github.com/SlimRoms/packages_apps_Camera2/commit/c5b0bfcf2340f02ca65ad3d8c08b5c7d74776ea1

which is only a dirty workaround fix for the actual root cause and only works
on landscape partly and if the complete layout is loaded new completly not.

Whatever to fix it we need to override and set getItemViewType(int)
and getViewTypeCount() to actually allow to handle propper two row
layouts like it is needed in MoreSettingsPopup (either checkbox layout
or menu layout). The actual detection which type of preference
we need is handled in getItemViewType.

Change-Id: I6b48ca83daa5f10a7783dfa29c63e9c0bc562167
Camera2: fix possible NPE on configurationchange

Step to reproduce:
- open camera from lockscreen
- during it opens turn your phone
- result: crash

Due that the camera is in middle of the initialization mParameters
is null at this point. Just check against null to prevend the crash.
The correct resizing happens so or so during the ongoing initialization

Thanks TJKV from xda for the report

Change-Id: I0aab385172d7ff571adf525004305fd3b34d499c
Camera2: add option to prevend autofocus cancel if preview stopped

There are camera HALs which cannot handle the autofocus cancel call if the preview
stopped in startPreview(). Add an option for this HAL's to do not cancel autofocus in this cases.

Change-Id: I0767cc7279405d17afc0b00120cb43e5bb309220
Camera2: tweak volume key zoom and cleanup

- cleanup unused code
- cleanup codestyle
- add more zoom steps for smother zooming
- show zoom circle indicator during zoom

Change-Id: I5214fc2620a0c5167bfdc8e85f7115966c3b8bcf
Camera2: Modify AOSP EL translations

Modify the AOSP image size translations like I did in all previous android
versions, the current greek translation does not sound right and it's not used
in any other products (cameras, etc.) in it's current form.

PS2: Trigger Cid

Change-Id: I675fc72eb11fdb267b01faebeea15f9aced5f4ec
Camera2: LT translations

Additional strings have been translated, improved translations, minor fixes

Change-Id: I87922e476cab820ca43513ce6f728d64a8581392
Camera2: NL translation

Change-Id: Ia7791ca6dd8ce33c7e356a543cb8f0c137edd36a
Camera2: PT-BR Translations

Change-Id: I2e9b2904f2003bd58371cc7a5182f374b8d51f54
Camera2: EL translations

Change-Id: If8e7b53ba3bbe5a50b82066272fd654f0d027a69
Camera2: DA translation

Patch 4: Unneeded string removed

Change-Id: I09ae6941b7a257e3f21fc329032cd5c4617fe43d
Merge "Camera2: EL translations" into cm-11.0