summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/CameraActivity.java
Commit message (Collapse)AuthorAgeFilesLines
* Snap: prevent NPE when checking if controls are visibleJoey Rizzoli2016-12-231-0/+3
| | | | | Change-Id: Id054ccc9445722bcb08953fd40e43a82bdd13ae2 Signed-off-by: Joey Rizzoli <joey@cyanogenmoditalia.it>
* Stop data loader on activity destroy.Danny Baumann2016-12-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes this crash: 11-29 13:02:30.837 18338 18338 E AndroidRuntime: java.lang.IllegalArgumentException: You cannot start a load for a destroyed activity 11-29 13:02:30.837 18338 18338 E AndroidRuntime: at com.bumptech.glide.manager.RequestManagerRetriever.assertNotDestroyed(RequestManagerRetriever.java:136) 11-29 13:02:30.837 18338 18338 E AndroidRuntime: at com.bumptech.glide.manager.RequestManagerRetriever.get(RequestManagerRetriever.java:127) 11-29 13:02:30.837 18338 18338 E AndroidRuntime: at com.bumptech.glide.manager.RequestManagerRetriever.get(RequestManagerRetriever.java:88) 11-29 13:02:30.837 18338 18338 E AndroidRuntime: at com.bumptech.glide.Glide.with(Glide.java:587) 11-29 13:02:30.837 18338 18338 E AndroidRuntime: at com.android.camera.data.LocalMediaData$PhotoData.loadUri(LocalMediaData.java:535) 11-29 13:02:30.837 18338 18338 E AndroidRuntime: at com.android.camera.data.LocalMediaData$PhotoData.loadImage(LocalMediaData.java:507) 11-29 13:02:30.837 18338 18338 E AndroidRuntime: at com.android.camera.data.LocalMediaData$PhotoData.fillImageView(LocalMediaData.java:485) 11-29 13:02:30.837 18338 18338 E AndroidRuntime: at com.android.camera.data.LocalMediaData.getView(LocalMediaData.java:232) 11-29 13:02:30.837 18338 18338 E AndroidRuntime: at com.android.camera.data.CameraDataAdapter.getView(CameraDataAdapter.java:101) 11-29 13:02:30.837 18338 18338 E AndroidRuntime: at com.android.camera.data.FixedFirstDataAdapter.getView(FixedFirstDataAdapter.java:117) 11-29 13:02:30.837 18338 18338 E AndroidRuntime: at com.android.camera.ui.FilmStripView.buildItemFromData(FilmStripView.java:928) 11-29 13:02:30.837 18338 18338 E AndroidRuntime: at com.android.camera.ui.FilmStripView.update(FilmStripView.java:2072) 11-29 13:02:30.837 18338 18338 E AndroidRuntime: at com.android.camera.ui.FilmStripView.-wrap12(FilmStripView.java) 11-29 13:02:30.837 18338 18338 E AndroidRuntime: at com.android.camera.ui.FilmStripView$4.onDataUpdated(FilmStripView.java:1803) 11-29 13:02:30.837 18338 18338 E AndroidRuntime: at com.android.camera.data.FixedFirstDataAdapter.onDataLoaded(FixedFirstDataAdapter.java:152) 11-29 13:02:30.837 18338 18338 E AndroidRuntime: at com.android.camera.data.CameraDataAdapter.replaceData(CameraDataAdapter.java:269) 11-29 13:02:30.837 18338 18338 E AndroidRuntime: at com.android.camera.data.CameraDataAdapter.-wrap1(CameraDataAdapter.java) 11-29 13:02:30.837 18338 18338 E AndroidRuntime: at com.android.camera.data.CameraDataAdapter$QueryTask.onPostExecute(CameraDataAdapter.java:359) 11-29 13:02:30.837 18338 18338 E AndroidRuntime: at com.android.camera.data.CameraDataAdapter$QueryTask.onPostExecute(CameraDataAdapter.java:358) 11-29 13:02:30.837 18338 18338 E AndroidRuntime: at android.os.AsyncTask.finish(AsyncTask.java:660) 11-29 13:02:30.837 18338 18338 E AndroidRuntime: at android.os.AsyncTask.-wrap1(AsyncTask.java) 11-29 13:02:30.837 18338 18338 E AndroidRuntime: at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:677) 11-29 13:02:30.837 18338 18338 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102) 11-29 13:02:30.837 18338 18338 E AndroidRuntime: at android.os.Looper.loop(Looper.java:154) 11-29 13:02:30.837 18338 18338 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6095) 11-29 13:02:30.837 18338 18338 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 11-29 13:02:30.837 18338 18338 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) 11-29 13:02:30.837 18338 18338 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) Change-Id: I43c6eb85651e5ee69647114a5ec819ed98c61720
* Use transparent navigation bar.Danny Baumann2016-12-231-24/+28
| | | | | | | Ensures a 16:9 preview isn't scaled on a 16:9 screen just due to the navigation bar being shown. Change-Id: I7ca7778b0405d3e9ac7ae1db3e7a56cacd703e3b
* Fix some photo UI layout issues.Danny Baumann2016-12-231-3/+3
| | | | Change-Id: I04a68fe2e379db4a228d19cbe6444a10a8024ce0
* snap: Panorama fixesSteve Kondik2016-11-221-0/+4
| | | | | | | | * Fix animations and transitions * Disable warped preview overlay, this looks terrible and needs rewritten. Change-Id: I9474219c57fc204dd16797aa8921296e61cc9d37
* snap: Improve transitionsSteve Kondik2016-11-171-34/+20
| | | | | | | | * Synchronize animation to filmstrip with input * More code cleanups, introduce BaseModule * Animations are hard Change-Id: Ie664bb2059a28b3a9f3957fb491ec28fede521e5
* snap: UI checkpoint #2Steve Kondik2016-11-131-14/+16
| | | | | | | | | | * Fix bugs from previous commit * Factor out recording controls * Clean up layouts * Asynchronous control for video module * Performance improvements Change-Id: I9d5833cecbd9280845b740ee8a3c47f023470625
* snap: Use reveal animation when switching modesSteve Kondik2016-11-131-40/+99
| | | | Change-Id: I7a4b4fe2c29426b57020e3a5102d89b62d46c241
* snap: UX improvements v1Steve Kondik2016-11-131-2/+11
| | | | | | | | | | | | | * Make the camera controls do sane things- get rid of the manual placement of every widget and use layouts * Animate everything correctly * Show ripples when clicking the shutter * Clean up a metric ton of dead code * Moved more code into BaseUI * Make setting up the camera controls less verbose and magical * Fixed up panorama layout Change-Id: Iaed44ca0201a2e2641e1c2460d3ff9ec3eae2d85
* CameraNext: Use Glide for async bitmap loadingcretin452016-11-091-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is what Camera2 code uses. Addresses SAMBAR-766 CameraNext: Fix rotation not updated The thumbnail generated by Glide is not updated when user rotate the image manually. This is because exif is rewrite using nio mmap, however there is no nio unmap available in java. Even though the file channel is closed, the rotation modification is still in buffer, when Glide tries to dtermine the orientation of the image, it still reads the old data. Use force to ensure data is sync to disk and buffer flushed. HAM-1389 Fix memory leaks Two leaks were occuring. One was an unused Parameters in AndroidCameraManagerImpl that was holding onto excess PhotoModules. The second was Glide images for video previews that were never being cleared on recycle. issue-id: CYNGNOS-2731 CameraNext: don't call Glide to load image after Camera exits There is a race condition where the filmstrip can still be trying to load a new image just as the camera exit, and Glide gets upset if it is handed a destroyed activity context to work with. So just check for that condition and go home. Change-Id: I9e76ab40d23213c7a74c26779e345207d5fd7bae Ticket-Id: CRACKLING-1068
* Reenable left swipe for FilmstripSteve Kondik2016-11-091-42/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * These commits are from the CameraNext application in COS. * Credits: Ed Carrigan, Ed Mancebo, Wilhelm Fitzpatrick Revert "SnapdragonCamera: Fix preview broken when coming back from gallery" This reverts commit 5b8948f83a65e8f9bd1b419bd11511e48dc34887. Revert "SnapdragonCamera: fix crash after photo deletion" This reverts commit 171d2b253a752ca104ccf4a58f4e9d6d82bd7b28. CameraNext: Fix camera crash on device unlock This patch from the plugin branch also fixes CYNGNOS-1878 Due to the bug below, when the camera is fore-grounded when device is unlocked, the SurfaceView is getting recreated, which caused it to be in a weird state when we were trying to reattach the preview to it. ----- Fixed Black Screen On Back. The issue was that mCameraView was not being populated when it should have been (after it had been added to the view hierarchy). The problem was the SurfaceView was being removed from the hierarchy when it shouldn't have been. Issue-Id: CP-129 (cherry picked from commit 4010462fe0b4cf1c15624cfca7d6a3d4d380613a) CameraNext: avoid scaling camera preview in filmstrip (cherry picked from commit 823ed983c4dccac3959635f1a14fcfe47cd7b120) CameraNext: fade camera preview to black during film strip transition Instead of scaling and translating the camera preview to make room for film strip images, we leave the preview in place and cover it gradually with the black preview cover. CameraNext : Add offset calculation for left navbar Also prevent preview from translating while hidden - was causing occasional glimpses of it in filmstrip. CameraNext : Ensure vertical/horizontal swipes don't conflict Ensure that the user can't swipe horizontally while trying to delete the image. Avoids all sorts of synching issues between mViewItem and the data adapter since the buffer is trying to constantly keep its center to be the current visible item CYNGNOS-1069 CameraNext: fix crash on entering filmstrip via thumbnail tap mVerticalViewId was getting initialized in onUp, but if filmstrip was entered without a swipe, no onUp occurred. Fixed by directly initializing the field on object creation. CameraNext: Fix ZoomView in the filmstrip The ZoomView was getting covered in the Z axis while scrolling. issue-id: SAMBAR-862 Revert "SnapdragonCamera: fix camera preview broken when resume from gallery" This reverts commit 0acc1f027637c4f0126883be68f97817d7306032. Change-Id: If4dd591c5c752a7fa33c669c15875c0077446a37
* Snap: Only override power keyScott Mertz2016-11-021-2/+2
| | | | | | | | Partially revert "Snap: Use new window manager flag for prevent system keys." CYNGNOS-2958 Change-Id: I1e726aa77a6db17c8586c19ddc3b9b31b4077194
* Snap: Use new window manager flag for prevent system keys.Adnan Begovic2016-11-021-2/+2
| | | | | Change-Id: I94ed12ddd33729a4fb486f7fb68f1bbab788b239 TICKET: FEIJ-522
* Snap: Extend user menu, disable dev menucodeworkx2016-11-021-0/+4
| | | | Change-Id: Iaa64372e5d196fd0117a32a386686bdb1fd51e45
* Snap: Fall back to REVIEW intent before VIEW intentEthan Chen2016-11-021-1/+15
| | | | Change-Id: Ie8f1dac602957cb871d0f8c7043ac0f434f4bfac
* Snap: Don't crash when hardcoded gallery intent failsEthan Chen2016-11-021-8/+16
| | | | | | | * startActivity may also throw IllegalArgumentException in addition to ActivityNotFoundException when the component can't be found. Change-Id: Ia3124591c625f4c249f3c6f76a226e8178df6e9d
* CameraActivity: Handle NPE when film strip view is nullLuK13372016-11-021-1/+3
| | | | Change-Id: I0de4ec0f2cb4653822249ea97e8a07c890fc7231
* Camera2: Add option to set max screen brightnessMichael Bestas2016-11-021-0/+20
| | | | | | * Set maximum screen brightness while the user is inside the camera app Change-Id: I8b16ba47a933bc7d6b0c1cd62bfd6ca54875ce1e
* Camera: Handle keys only while in appMichael Bestas2016-11-021-1/+10
| | | | | | Thanks to Lars Greiss (SlimRoms) Change-Id: I63f757d25260fba4683f494f8b4daf178a2b4e13
* Camera: Cleanup hardware key handlingMichael Bestas2016-11-021-1/+3
| | | | | | | | | | | | | | | | | * 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 Bestas2016-11-021-0/+16
| | | | | | | | | | | | | | 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
* SnapdragonCamera: Preview button should not work in secure modeJing (Mia) Wang2016-10-041-3/+11
| | | | | | | | | When camera is in secure mode, it will still listen to the preview event although the circle is invisible to the user. So disable the event listener of preview button. Change-Id: Ic4f1dbf32163a7f210e3f4b87599699f44e8f7b0 CRs-Fixed: 1002685
* SnapdragonCamera: Always strong release when going to Camera2Jay Wang2016-09-271-1/+2
| | | | | | | | Always strong release the camera when transitioning to CaptureModule/Camera2 mode. CRs-Fixed: 1058832 Change-Id: I51efd338879a93a2c7b84f025c274e3147e4d82f
* SnapdragonCamera: Fix memory leak when updating thumbnails.Jay Wang2016-09-271-2/+13
| | | | | | | | | Fix a memory leak with jpeg data buffers saved for updating thumbnails. Ensure that all references are freed and released when exiting. CRs-Fixed: 1054441 Change-Id: Idc79f51f0e70b0b3e39d614ff3dd7f5d1f85aaad
* Merge "SnapdragonCamera:Fix instance of SettingsManager is null" into ↵Camera Software Integration2016-09-231-6/+8
|\ | | | | | | camera.lnx.1.0.c7-dev
| * SnapdragonCamera:Fix instance of SettingsManager is nulljunjiez2016-09-141-6/+8
| | | | | | | | | | | | | | | | | | | | | | When there are two CameraActivities, one of them is destroyed, the instance of settingsManager will be destroyed too. When the other CameraActivity invokes SettingsManager.getInstance(), it may return null and cause exceptions.Create and hold a instance of SettingsManager in each CameraActivity to make sure it's not null. Change-Id: Id2c355bf63f61e09f914113082db2876f28b9658 CRs-Fixed: 1060909
* | Merge "SnapdragonCamera: Fix Camera launch latency" into camera.lnx.1.0.c7-devCamera Software Integration2016-09-171-3/+3
|\ \
| * | SnapdragonCamera: Fix Camera launch latencyByunghun Jeon2016-09-131-3/+3
| |/ | | | | | | | | | | | | | | Call setModuleFromIndex() first before calling setContentView() so that camera open will happen faster Move query() cursor after setModuleFromIndex() Change-Id: I8407cb795248f4b814d8292014b6ddc79d2af7f8
* | Merge "SnapdragonCamera: Fix ANR after capturing pictures continuously" into ↵Camera Software Integration2016-09-161-5/+36
|\ \ | | | | | | | | | camera.lnx.1.0.c7-dev
| * | SnapdragonCamera: Fix ANR after capturing pictures continuouslyqimengp2016-09-081-5/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When finish once capture picture, camera need get available space of SDCard/Internal storage and update available number to UI. It is a I/O operation and may block a few millisecond. Currently camera get available space in UI-Thread. So capturing pictures continuously may cause ANR, though it is happened rarely. By moving this operation to non-UI thread, can solve this issue. Change-Id: I397e07117f88e56cbe2ad0b893e2bad8b3075ab5 CRs-Fixed: 1022382
* | | Merge "SnapdragonCamera:Fix location permission dialog disappeared" into ↵Camera Software Integration2016-09-161-13/+11
|\ \ \ | |_|/ |/| | | | | camera.lnx.1.0.c7-dev
| * | SnapdragonCamera:Fix location permission dialog disappearedjunjiez2016-09-081-13/+11
| |/ | | | | | | | | | | | | | | | | Request loaction permission for the first time of launching Camera, and add android:configChanges in manifest to avoid PermissionActivity to be created when rotate screen. Change-Id: Ibaffad1629830beccf41e32ea5e224abd765ffb6 CRs-Fixed: 1059678
* / SnapdragonCamera: fix crash when deny storage permissionjunjiez2016-09-041-3/+8
|/ | | | | | | | | | The permission group of storage will not be granted automatically by system when one permission in the group is granted and this will only happen when device is not in default mode. So we need to request both read and write storage permissions. Change-Id: Id8ab4d2dd74a958c17fe3fab19bfe0a61909a602 CRs-Fixed: 1051976
* Merge "SnapdragonCamera: fix invoke camera failture caused by permissions" ↵Linux Build Service Account2016-08-181-2/+1
|\ | | | | | | into camera.lnx.1.0-dev.1.0
| * SnapdragonCamera: fix invoke camera failture caused by permissionsjunjiez2016-08-081-2/+1
| | | | | | | | | | | | | | | | | | When the other apps want to invoke camera by intent, if the permission needed by camera is not granted, camera will restart and the intent will be lost, so check the permission first before invoke camera with intents Change-Id: I2c403d2cd78453cc8afcda374969dac87a6becf6 CRs-Fixed: 1047924
* | SnapdragonCamera: Fix crash when switching between camera1, camera2Byunghun Jeon2016-08-161-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | Camera1 uses CameraHolder for opening/releasing camera and it does not release right away when closing camera. This is done to optimize opening/closing but since Camera2 does not use CameraHolder, state is not proper when switching between camera1 and camera2. So ignore the timer and release right away when going from camera1 to camera2. Change-Id: Ibc40297817ebfca04e19097bd463f78aec4d75cd CRs-Fixed: 1019338
* | SnapdragonCamera: Bestpicture scene filterJack Yoo2016-08-161-0/+9
| | | | | | | | | | | | | | Adding best picture selection scene filter Change-Id: Ifa0f544e80d161eaef743d611c712d8db48e5631 CRs-Fixed: 1050663
* | SnapdragonCamera: Fix Gallery view photo no edit and delete buttonqimengp2016-07-281-1/+1
|/ | | | | | | | | | Enter gallery from SnapdragonCamera, there are no edit and delete button, because gallery in readonly mode. To solve this issue SnapdragonCamera should add "from-snapcam" parameters to start intent, when enter Gallery to browse photos. Change-Id: I1d0ced45dad150052093e00b8347cd094f4c8bf4 CRs-Fixed: 1036897
* Merge "SnapdragonCamera: Remove custom location permission request window" ↵Linux Build Service Account2016-07-251-0/+34
|\ | | | | | | into camera.lnx.1.0-dev.1.0
| * SnapdragonCamera: Remove custom location permission request windowJay Wang2016-07-191-0/+34
| | | | | | | | | | | | | | | | When user enables the GPS locaion setting, use Android's run-time permission request interface to get the permission. Change-Id: Ib17171aeff5ccf20e2b00da08243dee1a3383611 CRs-Fixed: 1038039
* | SnapdragonCamera: Adding ubifocus post proc filterJack Yoo2016-07-071-0/+15
|/ | | | | | | Introducing ubifocus to camera2. Change-Id: I611bea207b9cbbde56a23720b22a5a5e3daa215f CRs-Fixed: 1035245
* Merge "SnapdragonCamera: Add video to Camera2 module" into ↵Camera Software Integration2016-07-041-1/+2
|\ | | | | | | camera.lnx.1.0-dev.1.0
| * SnapdragonCamera: Add video to Camera2 moduleByunghun Jeon2016-06-291-1/+2
| | | | | | | | | | | | Add video to Camera2 module and combine the UI Change-Id: I0bcd86eb6b95fe2180856780ddd794682259e799
* | SnapdragonCamera: Fix first-time crash and cleanup permissionsJay Wang2016-06-261-3/+5
|/ | | | | | | | | | | As onCreate skips the creation of setting manager when the critical permissions are not granted, this causes the onDestroy to call setting manager destroy function with null pointer. Fix the issue with null check. In addition, remove unused permissions from manifest file Change-Id: I99b5f09449aacfb7eb9a5771e446df75956a9827 CRs-Fixed: 1034202
* Merge "SnapdragonCamera: Sharpshooter post filter" into camera.lnx.1.0-dev.1.0Camera Software Integration2016-06-201-1/+1
|\
| * SnapdragonCamera: Sharpshooter post filterJack Yoo2016-06-081-1/+1
| | | | | | | | | | | | | | Adding Sharpshooter post process filter Change-Id: I8f3c1962db437e7dfbe2973f806a3f9a26480eb7 CRs-Fixed: 1023183
* | SnapdragonCamera: Multiple fixes in SettingManagerJay Wang2016-06-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | - Setting manager instance was not destroyed when camera activity onDestroy is called and a new instance is created again when onCreate is called. Make change to destroy the setting manager during onDestroy. - Include high resolution picture sizes to the picture size list Change-Id: Id6cb52da1419f7e723304236b5d2c204d217398c CRs-Fixed: 1025845, 1025789
* | Merge "SnapdragonCamera: Fixed M permission issue" into camera.lnx.1.0-dev.1.0Linux Build Service Account2016-06-101-25/+28
|\ \
| * | SnapdragonCamera: Fixed M permission issueJay Wang2016-06-021-25/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Resolved NPE while sending permission request - Made change to request non-critical permissions once only, but the critical permssions all th time. - Removed unused contant defines CRs-Fixed: 1019847 Change-Id: Ib997244cbcc041d86c094c7ee7a902bff56e92ad
* | | Merge "Fixes to M permissions." into camera.lnx.1.0-dev.1.0Linux Build Service Account2016-06-101-2/+11
|\| |