Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix high battery drain after using flashlight #8

Merged
merged 1 commit into from
May 17, 2021

Conversation

adiatul16
Copy link

After turning off the flashlight via the tile, the camera is kept open, preventing the device from entering deep sleep (and destroying battery life).

Properly close the camera after turning off the flashlight in order to fix the high battery drain.

Change-Id: Ib3b1fa77f8f1d22b94ab969dff834015a7ebe59b
Signed-off-by: adiatul16 adiatul16@gmail.com

After turning off the flashlight via the tile, the camera is kept open, preventing the device from entering deep sleep (and destroying battery life).

Properly close the camera after turning off the flashlight in order to fix the high battery drain.

Change-Id: Ib3b1fa77f8f1d22b94ab969dff834015a7ebe59b
Signed-off-by: adiatul16 <adiatul16@gmail.com>
@neobuddy89 neobuddy89 merged commit dbaff67 into crdroidandroid:11.0 May 17, 2021
neobuddy89 pushed a commit that referenced this pull request May 30, 2021
Fix crashes like this:
05-03 20:55:09.029  6254  6254 F DEBUG   :       #00 pc 00000000  <unknown>
05-03 20:55:09.029  6254  6254 F DEBUG   :       #1 pc 000ec8ab  /system/lib/libcameraservice.so (android::CameraHardwareInterface::notifyCallback(android::hardware::camera::device::V1_0::NotifyCallbackMsg, int, int)+18) (BuildId: 078b8118f1d0503988dc8f86045848d8)
05-03 20:55:09.030  6254  6254 F DEBUG   :       #2 pc 0002e6cd  /system/lib/android.hardware.camera.device@1.0.so (android::hardware::camera::device::V1_0::BsCameraDeviceCallback::notifyCallback(android::hardware::camera::device::V1_0::NotifyCallbackMsg, int, int)+96) (BuildId: a964b5ab287096bfb4e9fb1357483757)
05-03 20:55:09.030  6254  6254 F DEBUG   :       #3 pc 00013783  /system/vendor/lib/camera.device@1.0-impl-htc_msm8960.so (android::hardware::camera::device::V1_0::implementation::CameraDevice::sNotifyCb(int, int, int, void*)+46) (BuildId: 183c013753a49cdceaf880f00b6083b7)
05-03 20:55:09.030  6254  6254 F DEBUG   :       #4 pc 00038b99  /system/vendor/lib/hw/camera.vendor.msm8960.so (android::QCameraStream_preview::processPreviewFrameWithDisplay(mm_camera_ch_data_buf_t*)+128)
05-03 20:55:09.030  6254  6254 F DEBUG   :       #5 pc 000086ff  /system/lib/libmmcamera_interface2.so
05-03 20:55:09.030  6254  6254 F DEBUG   :       #6 pc 00008855  /system/lib/libmmcamera_interface2.so (mm_camera_msm_data_notify+248)
05-03 20:55:09.030  6254  6254 F DEBUG   :       #7 pc 0000736f  /system/lib/libmmcamera_interface2.so
05-03 20:55:09.030  6254  6254 F DEBUG   :       #8 pc 000a6b67  /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+20) (BuildId: 1c34385a63ae9f807822c87c6b4126d2)
05-03 20:55:09.030  6254  6254 F DEBUG   :       #9 pc 00060101  /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30) (BuildId: 1c34385a63ae9f807822c87c6b4126d2)

In case of HTC One M7, the nullptr appears because of this call:
https://github.com/AICP/frameworks_av/blob/q10.0/services/camera/libcameraservice/CameraFlashlight.cpp#L528

And while we're on it, lets fix some more possible nullptr's too.

Change-Id: I2f67756d576d62560a2e65af55ab868bfc3e36ba
Signed-off-by: Julian Veit <claymore1298@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants