[One (M7) Android Development] Gelunox:
Camera crashes when taking a photo.

When I take a photo directly from the camera app the photo gets saved before the app crashes. If I take a quick photo from, for instance Telegram, the camera app just crashes and the app doesn't receive any image.

Here's an ADB log when taking a picture from the camera app:

03-31 14:54:59.121 7934-8046/com.android.camera2 W/LegacyRequestMapper﹕ convertRequestMetadata - control.awbRegions setting is not supported, ignoring value
03-31 14:54:59.121 7934-8046/com.android.camera2 W/LegacyRequestMapper﹕ Only received metering rectangles with weight 0.
03-31 14:54:59.121 7934-8046/com.android.camera2 W/LegacyRequestMapper﹕ Only received metering rectangles with weight 0.
03-31 14:54:59.416 7934-8018/com.android.camera2 I/RequestThread-0﹕ Received jpeg.
03-31 14:54:59.416 7934-8018/com.android.camera2 I/RequestThread-0﹕ Producing jpeg buffer...
03-31 14:54:59.422 7934-8052/com.android.camera2 D/ImageReader_JNI﹕ ImageReader_lockedImageSetup: Receiving JPEG in HAL_PIXEL_FORMAT_RGBA_8888 buffer.
03-31 14:54:59.434 7934-8046/com.android.camera2 W/LegacyRequestMapper﹕ convertRequestMetadata - control.awbRegions setting is not supported, ignoring value
03-31 14:54:59.434 7934-8046/com.android.camera2 W/LegacyRequestMapper﹕ Only received metering rectangles with weight 0.
03-31 14:54:59.434 7934-8046/com.android.camera2 W/LegacyRequestMapper﹕ Only received metering rectangles with weight 0.
03-31 14:55:00.195 7934-7955/com.android.camera2 W/CameraBase﹕ mediaserver's remote binder Camera object died
03-31 14:55:00.195 7934-7955/com.android.camera2 W/AudioSystem﹕ AudioFlinger server died!
03-31 14:55:00.195 7934-7955/com.android.camera2 W/CameraBase﹕ Camera service died!
03-31 14:55:00.197 7934-8018/com.android.camera2 E/Camera﹕ Error 100
03-31 14:55:00.197 7934-8018/com.android.camera2 E/RequestThread-0﹕ Received error 100 from the Camera1 ErrorCallback
03-31 14:55:00.198 7934-8018/com.android.camera2 I/CameraDeviceState﹕ Legacy camera service transitioning to state ERROR
03-31 14:55:00.198 7934-7956/com.android.camera2 W/AudioSystem﹕ AudioPolicyService server died!
03-31 14:55:00.201 7934-7970/com.android.camera2 E/CAM_FatalErrorHandler﹕ Handling Camera Access Failure:
java.lang.Exception
at com.android.camera.FatalErrorHandlerImpl.onGenericCameraAccessFailure(FatalErrorHandlerImpl.java:84)
at com.android.camera.one.v2.Camera2OneCameraOpenerImpl$1.onError(Camera2OneCameraOpenerImpl.java:154)
at android.hardware.camera2.impl.CameraDeviceImpl$CameraDeviceCallbacks$1.run(CameraDeviceImpl.java:1697)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.os.HandlerThread.run(HandlerThread.java:61)
03-31 14:55:00.201 7934-8046/com.android.camera2 E/RequestThread-0﹕ Received device exception:
java.lang.RuntimeException: getParameters failed (empty parameters)
at android.hardware.Camera.native_getParameters(Native Method)
at android.hardware.Camera.getParameters(Camera.java:1979)
at android.hardware.camera2.legacy.RequestThreadManager$5.handleMessage(RequestThreadManager.java:859)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:148)
at android.os.HandlerThread.run(HandlerThread.java:61)
03-31 14:55:00.202 7934-7970/com.android.camera2 E/CAM_CameraUtil﹕ Show fatal error dialog
03-31 14:55:00.277 7934-8124/com.android.camera2 W/AudioTrack﹕ dead IAudioTrack, PCM, creating a new one from processAudioBuffer()
03-31 14:55:00.277 7934-8124/com.android.camera2 I/ServiceManager﹕ Waiting for service media.audio_flinger...
03-31 14:55:04.202 7934-8046/com.android.camera2 E/RequestThread-0﹕ Timed out while waiting for request to complete.
03-31 14:55:04.202 7934-8046/com.android.camera2 W/RequestHolder﹕ Capture failed for request: 0
03-31 14:55:04.202 7934-8046/com.android.camera2 I/CameraDeviceState﹕ Legacy camera service transitioning to state CAPTURING
03-31 14:55:04.202 7934-8046/com.android.camera2 E/CameraDeviceState﹕ Cannot call capture while in state: 0
03-31 14:55:04.202 7934-8046/com.android.camera2 W/RequestHolder﹕ Capture failed for request: 0

I also noticed my phone randomly reboots from time to time, usually when I haven't touched it for a while and it's just lying around on my desk somewhere.