summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/PhotoModule.java
Commit message (Collapse)AuthorAgeFilesLines
* Drop new focus indicator into Camera2.Paul Rohde2016-01-151-19/+2
| | | | | | | * Create a new custom focus view that interacts with physical lens diopter changes. * Replace all occurances of the old focus indicator with the new one. Change-Id: Ia02646ce4d1eb059ecb8a1dfccc15dfc9c167e1b
* SnapdragonCamera: Hide all camera setting when countdown timer startslikaid2016-01-141-0/+1
| | | | | | | | | | | | Camera setting including module switcher scene mode filter mode and front/back camera switcher should not be used during countdown timer, since it may cause unexpected concurrent errors. Hide all the camera settings when countdown timer starts, show them again after countdown. Change-Id: I79c2add63c61d304fe0948e1c9fefe3a8c1a6fee CRs-Fixed: 900086
* SnapdragonCamera: Set color effect as none when turn HDR onlikaid2016-01-141-3/+11
| | | | | | | | | | Some color effects has special tone, if do HDR for specific color effects like Negative, we'll get unreasonable pictures. Disable the color effect when HDR on and set it as none effect. Change-Id: I8dca19b081504abaa85728b6d67b85699a184abb CRs-Fixed: 894360
* SnapdragonCamera: fix crash taking Macro+ from MMSLikai Ding2016-01-141-1/+4
| | | | | | | | For capture intent, preview stops as soon as first jpeg callback arrives, but Macro+ has 7 callbacks. Make preview stop after all jpeg callbacks. Change-Id: Id29cc745aa2030edb60bc15da10d9123fa95bfd0
* SnapdragonCamera: fix NumberFormatException when input value invalidelikaid2016-01-141-6/+33
| | | | | | | | | | NumberFormatException occurred when converted the invalid input values, for example, user only input "." for some float values. Catch the NumberFormatException and show invalid input toast. Change-Id: Ie10b204950d43cca22a06532f04b9569fa545cbb CRs-Fixed: 862960
* Snap: Remove touch AF/AEC optionSteve Kondik2016-01-141-48/+11
| | | | | | | * Drop the use of the touchaf-aec parameter entirely. No camera needs this anymore. Change-Id: I83154a75e5375901dc6c0fc93aef23637cfdf425
* Snap: Support for HTC's HDR modeSteve Kondik2016-01-131-10/+2
| | | | | | | | | | * HDR was never actually working on CM because we did not instruct the camera to take all exposures. The HAL tells us that we'll get one JPEG, but we should snap 3 times. We handle this behavior in the framework now, but we should honor the num-jpegs-per-shutter value in the JPEG callback. Change-Id: I7124bf08985ae23b21ac4e294fb889ac4106946b
* Snap: special handling of hdr-mode parameter for lge devicescodeworkx2016-01-111-17/+39
| | | | Change-Id: Iefee1f15f5649c2f93c59fcbdedcf953e9e0bc54
* Don't do touch-to-focus for touches outside of the preview.Danny Baumann2016-01-111-6/+0
| | | | | | | | | | Issue was twofold: - Preview size was updated from the root view instead of the preview surface view. As the preview rect is already correctly updated from the surface view, remove the redundant size update code. - Touches outside of the preview rect weren't discarded properly. Change-Id: I1c9a4398aa51a828b5362fcd7bcd5a7a7e4691db
* Move mApplicationContext to init()LuK13372016-01-111-2/+1
| | | | | | | | | | | | | | Fixes following NPE: 01-11 17:36:42.607 4329 4391 E AndroidRuntime: FATAL EXCEPTION: Thread-235 01-11 17:36:42.607 4329 4391 E AndroidRuntime: Process: org.cyanogenmod.snap, PID: 4329 01-11 17:36:42.607 4329 4391 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference 01-11 17:36:42.607 4329 4391 E AndroidRuntime: at com.android.camera.PhotoModule.updateCameraParametersPreference(PhotoModule.java:3492) 01-11 17:36:42.607 4329 4391 E AndroidRuntime: at com.android.camera.PhotoModule.setCameraParameters(PhotoModule.java:3714) 01-11 17:36:42.607 4329 4391 E AndroidRuntime: at com.android.camera.PhotoModule.startPreview(PhotoModule.java:2715) 01-11 17:36:42.607 4329 4391 E AndroidRuntime: at com.android.camera.PhotoModule.-wrap14(PhotoModule.java) 01-11 17:36:42.607 4329 4391 E AndroidRuntime: at com.android.camera.PhotoModule$OpenCameraThread.run(PhotoModule.java:265) Change-Id: I6ca0dfe402cab46dd7b6f102921062f3c7ec8d43
* Snap: support setting default preview resolution via overlaycodeworkx2016-01-101-43/+13
| | | | Change-Id: I14c17aec6e5d582cc1f884eba40868a58cab1d03
* Snap: Fix NPE if mCameraDevice == nullBjörn Fries2016-01-111-2/+1
| | | | Change-Id: I27ee6f3b6b6bec95661741a0907708e6ebd79752
* Snap: support usage of preview size 2560x1440 via system propcodeworkx2016-01-101-0/+7
| | | | Change-Id: I52b0f7aab55d0a001fc1149fbd82c8188f57be9d
* Snap: initial materializationjrizzoli2016-01-091-9/+7
| | | | | | | Just for initial ship Change-Id: I8d6c0d71d1b94e6eb2f43ab962fb92de0e6c7093 Signed-off-by: jrizzoli <joey@cyanogenmoditalia.it>
* SnapdragonCamera: Restart preview in a corner caseSuman Mukherjee2016-01-081-0/+3
| | | | | | | | | | | Issue: If user sets feature.restart flag as 1, turn off ZSL,HDR 1x and capture an image with HDR, then after capture preview is not getting restarted. Fix: Set the needRestartPreview flag based on above condition. Change-Id: I4e2c9db20d5148de2b6b63288dc0d3eb75ee5a9c
* Read camera state from HAL instead of local state variable.Santhosh Kumar H E2016-01-081-1/+2
| | | | | | | | | | | | | Camera open thread opens the hardware and triggers preview. State of preview is updated over a handler message to UI thred. In between this surface window re-creation happens in UI thread. To set new window to HAL, preview should be in stopped state. Since state updation hasn't completed yet, UI thread reads old state and sets window while HAL is in previewing state. This lead to crash. To avoid the error read the camera state from HAL through framework API rather local state variable. Change-Id: Ieee86edc601f43b85773392a9a44853b4a56cde8
* Update camera state immediately after start preview.Santhosh Kumar H E2016-01-081-2/+21
| | | | | | | | | | | | | | When user delete all the images in gallery to come back to camera, surface view gets created, destroyed and recreated. Since camera state is updated over handler message after start preview, by the time handler thread updates the state background thread would have stopped the preview. So during surface recreation, state variable is read wrong and it doesn't allow start preview. This change makes sure state variable is updated immediately after start preview and only UI updation is moved to main thread through handler message. Change-Id: I289814821d5c3652b06301d1d4a854e9e40670b6
* SnapdragonCamera: fix screen flash on resumingLikai Ding2016-01-081-1/+7
| | | | | | | | | Currently preview cover will be hidden shortly after preview started, but if the actual first frame comes late, the main screen will flash. Register a oneshot preview callback to hide preview cover. CRs-Fixed: 881290 Change-Id: I5d93e57f0b9aa338c6b34461d5e3ee31806b6706
* Snap: fix typo in PhotoModulecodeworkx2016-01-091-1/+0
| | | | Change-Id: Ied37999553d04dcc970da23ccce4dd7c9abf3b48
* Snap: 100 chars!codeworkx2016-01-081-1/+2
| | | | Change-Id: Ia48f48fcd8b8546ca68969198a60f568bae805d6
* Snap: restart preview when shutter-speed gets disabledcodeworkx2016-01-081-1/+13
| | | | Change-Id: I3884b23f1c855cfffeb20ca6e2a760732370d772
* SnapdragonCamera: Query camcorder profiles before usageSai Kumar Sanagavarapu2016-01-071-1/+2
| | | | | | | | 1. Use generic camcorder profile query mechanism instead of hardcoding profile enums in app. 2. Fix NPE during startpreview if mFocusManager is null. Change-Id: I7bfc00f68f512c3029ca8ba75863583f1b376094
* SnapdragonCamera: Correct AutoHDR callback data size checkEmilian Peev2016-01-071-1/+1
| | | | | | | | | | | | | | | | | | Currently the AutoHDR functionality which handles metadata callbacks always assumes that the length of the callback data buffer will be equal to 12 bytes. It will always try to read and convert 3 32-bit integers. The check before this processing is incorrect as it allows buffers which are less than 12 bytes to be processed as well. This can lead to array out of bounds exceptions, which are also possible during FD snapshot metadata callbacks that don't contain any faces. In this particular scenario the metadata callback buffer size will be 8 bytes. Change-Id: I4094aaa56aa4135d2d806861353d49c8d7f9985c CRs-Fixed: 799110
* Camera: Avoid 'takePicture()' in preview ready stateEmilian Peev2016-01-071-1/+4
| | | | | | | | | | | | | Depending on timing 'takePicture()' could be triggered while the preview surface holder is still not available. The camera preview in such scenario can be started but will not run without a valid surface holder. Triggering snapshot in this case is not allowed and can lead to runtime exception. CRs-Fixed: 769441 Change-Id: I6c4f013e9ca8b5903abbfe69394dc0871669d7c2
* Snapdragon Camera: Unlock AE&AWB before snapshotEmilian Peev2016-01-071-6/+7
| | | | | | | | | | | | | | Currently the application contains logic which will lock AE&AWB before snapshot if AF didn't get triggered. Unlocking happens during image capture though and will get ignored because the camera state is already set to 'SNAPSHOT_IN_PROGRESS". This sequence of events can have side effects w.r.t. flash. To avoid this AE&AWB should always be unlocked before snapshot. Change-Id: Ie72bb7f5721419e448b2d1976f5873327dd3ada4
* Snapdragon Camera: Unlock AE&AWB during longshotEmilian Peev2016-01-071-0/+7
| | | | | | | | | Both AWB&AE are currently locked during longshot. This can have side effects for cases which utilize torch flash. CRs-Fixed: 770028 Change-Id: Ie6b547d2863c8fb1ff0b9124082a6fb6144cbac9
* Snapdragon Camera: Avoid null pointer exception during shutter focusEmilian Peev2016-01-071-2/+4
| | | | | | | | | An additional check needs to be added for the focus manager initialization during handling of the shutter button focus event. Change-Id: Icc12bd47b52af36e2ec5c1415d1147ba925a585b CRs-Fixed: 766843
* Snapdragon Camera: Override flash mode to off during non-auto sceneEmilian Peev2016-01-071-5/+4
| | | | | | | | | | | Currently the flash mode on application side will be set to 'auto' during scenes different from 'auto'. Due to the manual white balance modes used in these scenes it makes more sense to actually have flash mode set to off. Change-Id: Ief40a76de2f6481eb27b0e47e28ac8b4573429df CRs-Fixed: 765000
* Snap: add support for mw_continuous-picture focus modecodeworkx2016-01-071-12/+26
| | | | Change-Id: If165370b52d7454c69e2cdeb9d837d049010b0e8
* Snap: add support for shutter speedcodeworkx2016-01-061-0/+9
| | | | Change-Id: Id3393280c7c1c2f292d71587ba099e8dbafd1340
* add options to restart preview onPictureTakencodeworkx2016-01-051-0/+17
| | | | Change-Id: I7ce9d6f2323e367743e6d4c9662b846d3052f2a4
* add support for luminance-condition parametercodeworkx2016-01-051-0/+12
| | | | Change-Id: Idf845a5f55abf9b72f61ac4bac59ee2258043482
* add support for non-standard iso keys and valuescodeworkx2016-01-051-7/+7
| | | | Change-Id: I3a948495cdf84dae3c1734d50ff91b4a5d3d9fc0
* Snap: Add touch-to-focus timeout duration settingsjt11342015-09-201-0/+5
| | | | | | Signed-off-by: Michael Bestas <mikeioannina@gmail.com> Change-Id: Ib2c2c152a52b2616dd0da6f071f572d34fe64065
* Snap: Remove CAF beautification featureMichael Bestas2015-09-201-92/+2
| | | | | | | | | | | | Revert "SnapdragonCamera: Move the files to the correct location" This reverts commit c25b2d510285512dbb60547353190433f1dbb984. Revert "SnapdragonCamera: Add beautification feature to SnapdragonCamera." This reverts commit c1cea7c15b2e463f37c17f2a4ce61ce689ec7088. Change-Id: If01e4f438a58e4210a3eddf090d426895ecbae87
* Snap: Cleanup qcom string resourcesMichael Bestas2015-09-201-10/+5
| | | | | | | | | | | * Remove tons of unused strings * Make some strings shorter to fit better in the settings popup * 'Off' should be always the first option, else the app behaves unexpectedly * Use consistent strings for all on/off options * Replace string references to entryvalues for all qcom options with the actual parameters * Group arrays & strings based on the option Change-Id: I092ce765013e7a80a2928df8e7d1b7e7bfd67905
* SnapdragonCamera: Reset camera state after taking pictureSultanxda2015-09-191-0/+5
| | | | | | mCameraState gets stuck to SNAPSHOT_IN_PROGRESS after taking a picture using autofocus/not ZSL, thus breaking camera capture. Properly reset the camera state after taking a picture to fix this.
* Snap: fix NPE if device doesn't support AE bracketingLuca Stefani2015-09-171-2/+2
| | | | Change-Id: I44a19b1508cb58a4f249dd00bc9038a069f9db62
* Camera: remove fine/normal/superfine jpegquality and use always intLars Greiss2015-09-171-46/+4
| | | | | | | | | | | We use now a set of int values the user can exactly assign. Showing as well the normal fine superfine as choice is just a duplicate. As well we can get rid of the weird converts of the mixed values. To take care that the user does not get into problems we updated the db version and we make a convertion. Change-Id: I2615666bc1c929c0c045840fad1ece55fb0640af
* Camera2: Add option to set max screen brightnessMichael Bestas2015-09-171-0/+7
| | | | | | * Set maximum screen brightness while the user is inside the camera app Change-Id: I8b16ba47a933bc7d6b0c1cd62bfd6ca54875ce1e
* Camera2: Headset shutter modeDave Daynard2015-09-171-0/+5
| | | | | | | Use play button on headset to take a picture/video/panorama Use media next/previous for zoom Change-Id: I25c22646b041e5e0941fbe361eccfe77a2a1e42f
* Camera: Handle keys only while in appMichael Bestas2015-09-171-10/+7
| | | | | | Thanks to Lars Greiss (SlimRoms) Change-Id: I63f757d25260fba4683f494f8b4daf178a2b4e13
* Camera: Cleanup hardware key handlingMichael Bestas2015-09-171-4/+17
| | | | | | | | | | | | | | | | | * 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: Powerkey shutter (2/2)Michael Bestas2015-09-171-0/+25
| | | | | | | | | | | | | | 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 [mikeioannina]: Updates for L Signed-off-by: Michael Bestas <mikeioannina@gmail.com> Change-Id: I0992baa558eefd306d00fbece59cb5c512d9448b
* Camera: Change volume hard key button to zoom functionSu Liu2015-09-171-5/+11
| | | | | | | | Able to capture image through volume hard key button in camera application, change the function to zoom function. Change-Id: Iab9fc2492b2e2ff89cd58c21bac2f147f47b77e2
* Revert "SnapdragonCamera: Forbid volume key can take picture"Michael Bestas2015-09-171-5/+1
| | | | | | This reverts commit e73e717b8be1ba834161914af4debc61c1feb8be. Change-Id: Iee719f34f6016f89ec0bb1c078bfa25c2f718436
* camera: Make some parameter lookups saferSteve Kondik2015-09-171-21/+45
| | | | | | | | * Unsupported parameters that return int values will throw an exception at the framework level if they aren't supported. Handle this better and prevent crashes. Change-Id: If5a3807dba33167ef95e4ec9e9cbeb15ed4ed591
* Camera: Fix saturation, contrast, sharpness parametersEthan Chen2015-09-171-3/+3
| | | | | | | * Old-style QCOM HALs use <setting>-max, new style HALs use max-<setting> for these parameters. Change-Id: I3b0dbd04f072cb69d09c44b5b3af1097560205b3
* Camera2: More thorough compatibility fixesRyuinferno2015-09-171-3/+6
| | | | | | | Certain chipsets (such as omap) have contrast, sharpness and saturation set, but no max integer given for those Change-Id: I58efaef4d0a511aefc803a440e0c3aa3dbdc9483
* Camera2: Preview needs to be stopped when changing resolutionPawit Pornkitprasan2015-09-171-0/+6
| | | | | | | | This was done in startPreview as a hack, but was removed in f729b85e12cfa2674048d8cce2f724014b8fc910. Specifically add it back when the resolution is changed. Change-Id: I306abd788bafdff4e6fba7eec4e6ff05bb3cc47c