anselm94 / Torchie-Android

Hold volume buttons to turn on/off torch anytime
https://torchieapp.wordpress.com/
GNU General Public License v2.0
63 stars 26 forks source link

Shortcut Buttons Toggling Accessibility Permission on/off instead of flashlight (Android 11 - App Version 3.2.1) #38

Open Owen-G opened 3 years ago

Owen-G commented 3 years ago

@anselm94

I am using a Samsung Galaxy S10+ running Android 11 with Samsung's OneUI Version 3.0. When I try toggling the flashlight with the shortcut buttons ("Volume up & down for 3 seconds" or "Volume Up & Power Button"), it enables and disables Torchie's Accessibility Permission instead of the actual flashlight while the screen is on or on the lock screen. If the screen is turned off, the shortcut buttons work properly to turn on/off the flashlight.

I hope this bug can be solved but I do know that Android has become more Privacy secure and making these types of apps harder and harder to use on newer versions of Android.

kaoneko commented 2 years ago

I too experienced the described behaviour, however I found out that torchie always works when leaving a slight pause between pressing one volume button and the other (as happened naturally when I tried pressing both with my thumb).

So, to be clear, on my Pixel 4a running the stock Android 11 ROM, with the screen on:

Which volume button you press first and which last doesn't matter though.

Hope this helps anyone! 🔦🙏🏻💡

Edit: I just found out the solution can be even simpler. In Android's Settings > Accessibility > Torchie Quick make sure Torchie Quick shortcut is turned off. Now pressing both volume keys at the same time should always work! (Unless you have the same setting turned on for a different accessibility service.)

kaoneko commented 2 years ago

The "bug" is caused by the fact that both Torchie and Android use the same shortcut, holding down both volume keys. Android uses it to toggle accessibility services (if you turn it on for multiple accessibility services it will even display a pop-up asking you which one you want to toggle) and Torchie uses it to toggle the flashlight. The user may faultily conclude that they need to turn on the accessibility shortcut in Android's settings to make Torchie work, as I did, and this causes the unintended behaviour described by Owen-G.

e-t-l commented 1 year ago

If the screen is turned off, the shortcut buttons work properly to turn on/off the flashlight.

I did NOT experience this. I CANNOT get Torchie to toggle when the screen is completely off. In the in-app Settings, all checkboxes are checked and Screen Off is set to Indefinite. Yet Torchie will only toggle the torch on or off if the screen is on. I have the Accessibility Quick Shortcut set to Off, but I tried it with it On as well with no effect.

Running Android 13 on Pixel 7