Bluetooth remote controler does not switch screen ON

Jörg Sprenger shared this problem 4 days ago
Known

I occasionally use a small Bluetooth remote control on my bike for rudimentary control of Locus Map. I currently use a waterproof version with 5 buttons, which is actually intended for media control. The middle button is used to answer phone calls and transmits the code 25.

In the expert settings, I have used this button for Screen on\off. Switching the screen off works immediately, but switching it on never does.

All other buttons work as usual. I have had similar experiences with various remote controls, but I don't understand the (in)logic behind it, as the explanation of this function actually says “send xy and the screen goes off, send xy again and it comes on”.

Does anyone have any enlightening ideas?

Replies (9)

photo
1

Hello,

unfortunately with one of recent Android updates (few years ago) app stopped receiving key events from remote controllers when the app is hidden on background (or when the screen is turned off).

For now, we unfortunately do not have a working solution to this, sorry.

photo
1

Hi Menion

Another remote controler, I used 3 weeks ago, had no problem to switch off AND on. So, there must be a solution :-)

photo
photo
1

It works for me when I deactivate the lock screen. There are also ways to deactivate the _lock screen when locus is active. To do this, you have to use Tasker.

photo
1

A small addition, I have found a few Bluetooth controllers, but none of them are waterproof. One of them is an ACGAM1, which sends the same keyboard codes in one configuration as my current controller with the problem. Both send the code 85, with both I can set the screen off, but only with the Acgam1 I can switch it on again, even if I have previously switched it off with the waterproof controller.


There seems to be something more/different than just sending the 85.


I.e. I have read the other posting, but in that specific moment, I do not have enouph time an energy, to deal with tasker or other addons. Maybe, later, I will.

photo
1

One more hint, you see the keycode-protocol, first two strike are with the problematik controler, third and fourth one with not waterproof one.


Press buttons to see the keycodes:

KeyDown : action=0 code=85 repeat=0 meta=0 scanCode=164 flags=8 label='0' chars='null' number='0'

KeyUp : action=1 code=85 repeat=0 meta=0 scanCode=164 flags=8 label='0' chars='null' number='0'

KeyDown : action=0 code=85 repeat=0 meta=0 scanCode=164 flags=8 label='0' chars='null' number='0'

KeyUp : action=1 code=85 repeat=0 meta=0 scanCode=164 flags=8 label='0' chars='null' number='0'

KeyDown : action=0 code=85 repeat=0 meta=0 scanCode=164 flags=8 label='0' chars='null' number='0'

KeyUp : action=1 code=85 repeat=0 meta=0 scanCode=164 flags=8 label='0' chars='null' number='0'

KeyDown : action=0 code=85 repeat=0 meta=0 scanCode=164 flags=8 label='0' chars='null' number='0'

KeyUp : action=1 code=85 repeat=0 meta=0 scanCode=164 flags=8 label='0' chars='null' number='0'


I can't see any difference.

photo
1

Hi

For me the only keycodes I know of which wake the screen are: (this on Samsung A71 Android 13, and Samsung Tab A8 Android 14)

Dec 04 Hex 04 "BACK"

Dec 66 Hex 42"ENTER"

Maybe there are more but I haven't found any.

The media control keycodes are also active with screen off and device locked, and can be intercepted and used , but they don't by themselves wake the screen:

Dec 85 Hex 55MEDIA_PLAY_PAUSE

Dec 87 Hex 57MEDIA_NEXT

Dec 88 Hex 58MEDIA_PREVIOUS

Dec 89 Hex 59MEDIA_REWIND

Dec 90 Hex 5aMEDIA_FAST_FORWARD

(Dec 86 Hex 56MEDIA_STOP - not sure on that one. A lot of miniature controllers don't have a key for that anyway)

Not sure how your previous controller could work by sending 85 unless it also before that sent e.g. an "Enter", though there might be phone hardware/OS variations of course.

You also mentioned code 25 which is VOLUME_DOWN. I don't see how that could wake the screen.

It's also possible to get tasker to turn the screen on by mapping one of the media keys to a task which, for example, uses the plugin Autoinput Screen On which does work. (tasker has at least one other way to turn the screen on which doesn't now work because google blocked it)

Anything else needs the screen to be already on. Then any key can be detected and used even with the device locked. If you want to actually see an app displayed/used then the device has to be unlocked of course.

For myself, I gave up on the complications, and google continually making it more difficult, so while on an activity I ensure the device is unlocked and screen not fully off by using:

Always-On-Display. This puts the screen into a low power mode without actually fully turning it off, so all key codes are available. The extra battery use is negligible though that probably depends on the type of screen tech the phone uses.

Smart Lock (aka Extend Unlock) / Trusted devices : so when the bluetooth controller is connected the phone is kept unlocked. If I lost the phone it would lock. The bluetooth device is securely connected to my belt.

Then I use the Keymapper app to map keycodes to actions including tasker profiles/tasks, and Locus Map Intents.

Hope that helps a bit.

photo
1

Hi Alan, maybe you are right, but it is true, that with different controlers, the screen-on worked fine, the agcam1 uses the key 85 succusful.


I don't know, why same key leads to different results.


Using a third-party app like tasker, I don't know how to use it in between a period of a few weeks, but maybe later.

photo
1

Sorry, what I said above was a bit misleading so thought I'd better add to it. That assumed that the phone had some form of password/PIN defined and active with relatively short lock timeout. For me that's essential in case I lose the phone.

If you remove the password completely then any key will wake up the screen, as it does not lock.

I re-checked the behaviour when a password/PIN is defined:-

On my Android 13 phone, with a password defined, if I set the timeout period between the screen off and the lock activating to e.g. a few minutes then until the lock activates :

1/ If I turn the screen off by the side button, then any of my bluetooth keys will wake the screen up, until the lock timeout period activates after which they wont turn the screen on at all except for the Enter and Back keycodes.

2/ HOWEVER if instead I use the LM hardware controller option to toggle off the screen using e.g. keycode 85 (or anything else) , the screen turns off. Then if I press same key immediately , before the lock timeout period , nothing happens at all, which I think might be what you are seeing also.

On my Android 14 tablet its slightly different, despite having identical display/lock screen settings:- after the lock timeout the buttons now will turn the screen on but only as far as the password challenge.

Same for the LM hardware controller option but immediately after the screen turns off.

I also checked the LM Broadcast Intent screen off/on/toggle method and that has the same behaviour as the hardware controller method.

So it seems when LM turns the screen off it is actually locking it not just turning the screen off.

I think the only way currently to get past that is to disable locking - e.g by the Smart Lock (Extend Unlock) method, or else remove the password completely, or else using the LM "Unlock the screen" option which allows access to only the LM app but without unlocking the device.

Q. What are your display timeout and screen lock settings ? Might help understand why it worked before.

Question for the devs: is there a means of turning the screen off without locking it ? I suspect there is no Android API for that, but I know tasker has a method of doing it described here:

https://tasker.joaoapps.com/userguide/en/help/ah_turn_off_display.html. Could something similar be done in LM , for those who aren't tasker users ?

I've tried that and it does work - screen goes black and doesn't lock until the lock timeout expires. Keycodes can therefore do screen on.

Myself, I gave up on all this as too complicated , and just use the android always-on-display and smart-lock/trusted-device as described previously, but thats just to allow all keycodes to work, not to view LM - I still have to swipe right to get to that which is probably an issue if cycling.

photo
1

it is not necessary to disable the phone lock. It's very inconvenient. it is enough to make the blocking period as long as possible. then, to turn off / turn on the screen, you need to press the power button or use the Tasker to send the phone the code for pressing the power button.only this will require a phone root.

You cannot use LM to turn off the screen. LM does not know how to turn off the screen, instead LM locks the phone.

Leave a Comment
 
Attach a file