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

onSetTorchOn() #128

Closed
Bajranghudda1 opened this issue Jan 29, 2016 · 8 comments
Closed

onSetTorchOn() #128

Bajranghudda1 opened this issue Jan 29, 2016 · 8 comments
Assignees
Milestone

Comments

@Bajranghudda1
Copy link

I have a button, and onClick it first time i call setTorchOn() and and second time i call onTorchOff() (like a toggle button).
But the issue is sometimes onSetTorchOn() method is unable to ON the torch, for to ON, i have to tap again torch button, i think its library issue.

My test is like this....
i call setTorchOn() 100 times and in which 10 times torch was unable to ON.
i call setTorchOn() 10 times and in which 2 times torch was unable to ON
i call setTorchOn() 50 times and in which 3 times torch was unable to ON

Can you see this into, thanks in advance :-)

@Priyavrat-1
Copy link

Hello,
I am facing the same issue. Quick help will be appreciated here.

Thanks :)

@rkistner
Copy link
Member

rkistner commented Feb 3, 2016

Will look into this before the next release.

@rkistner
Copy link
Member

@Bajranghudda1
Are you only getting the issue after rotating the device (or another pause and resume), or also in between?

It seems like one current issue is that the TorchListener is not called when e.g. after rotating the device, so you may be calling e.g. onTorchOff() when it is already off. I'll look into improving that for version 3.3.0.

@rkistner rkistner reopened this Feb 11, 2016
@rkistner rkistner modified the milestones: v3.1.0, 3.3.0 Feb 11, 2016
@Bajranghudda1
Copy link
Author

@rkistner

Thanks for your quick reply, i must say you people are really doing well 👍

My screen orientation is only portrait, and there is no such case of rotating the device and i am sure that there is no resume and pause like case.

Actually on each bar code before to scan i need to turn on (setTorchOn()) and when barcode detected (in callback), i make it off (setTorchOff()) and i do all the time for all items scan.

@anhadmathur
Copy link

Hi,
I am using CompoundBarcodeView and doing the same like @Bajranghudda1 is doing,
After look into this issue #128 I checked it in my app and I found this issue, sometimes it doesn't turn on.
I am calling setTorchOn() and setTorchOff() on a toggle button.
Plese look into this.

Thanks (: Peace V

@Bajranghudda1
Copy link
Author

@rkistner

For auto flash light you doing isAutoFlashLightEnabled(boolean), and for this you using light sensor and if darkness density is 45.0f (will turn of flash) and 450.0f will turn off flash, i think it is worst if instantly light sensor has been covered by user's shadow.

I think this torch auto On/Off can be improved by using logic like android's Camera app does, i tested Camera app not using Light sensor for detecting darkness.

@Bajranghudda1
Copy link
Author

Hello @rkistner ,
I made some more test and found that this issues is device specific.
My test is below in logcat are -

It's working fine in below devices.... Moto G, Samsung Dues (GT-I8262), Samgung S4**

I/CameraConfiguration﹕ Requesting flash mode value from among: [torch, on]
I/CameraConfiguration﹕ Supported flash mode values: [off, auto, on, torch]
I/CameraConfiguration﹕ Can set flash mode to: torch
I/CameraConfiguration﹕ Setting flash mode to torch
I/CameraConfiguration﹕ Requesting flash mode value from among: [off]
I/CameraConfiguration﹕ Supported flash mode values: [off, auto, on, torch]
I/CameraConfiguration﹕ Can set flash mode to: off
I/CameraConfiguration﹕ Setting flash mode to off

But its not working only in *Samsung Note 4 *

D/ViewRootImpl﹕ ViewPostImeInputStage ACTION_DOWN
I/CameraConfiguration﹕ Requesting flash mode value from among: [torch, on]
I/CameraConfiguration﹕ Supported flash mode values: [off, auto, on, torch]
I/CameraConfiguration﹕ Can set flash mode to: torch
I/CameraConfiguration﹕ Setting flash mode to torch
D/dalvikvm﹕ GC_FOR_ALLOC freed 3740K, 28% free 47553K/65364K, paused 22ms, total 25ms
D/ViewRootImpl﹕ ViewPostImeInputStage ACTION_DOWN
I/CameraConfiguration﹕ Requesting flash mode value from among: [off]
I/CameraConfiguration﹕ Supported flash mode values: [off, auto, on, torch]
I/CameraConfiguration﹕ Can set flash mode to: off
I/CameraConfiguration﹕ Setting flash mode to off

@rkistner
Copy link
Member

rkistner commented Sep 8, 2019

Closing as a device-specific issue.

@rkistner rkistner closed this as completed Sep 8, 2019
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

No branches or pull requests

4 participants