[GUIDE] How to enable Ambient Display Proximity Wake feature on OOS

Portgas D. Ace

Recognized Contributor
Jun 12, 2014
4,325
3,107
253
Bergisches Land
As most of you might know, OnePlus removed the proximity wake option from OOS lately, replacing it with the lift to wake feature. If you want to use the proximity wake feature, you either have to switch to a custom ROM or use an outdated version of OOS. Both options might be suited for most people, but in case you prefer to use latest OOS and still want to use proximity wake, I have some kind of workaround.

PLEASE NOTE: it seems that the given shell command does not work on Android Oreo (OOS Open Beta as of writing). Check the latest posts of this thread for any progress.

I came across this shell command, which will trigger the ambient display:

Code:
am broadcast -a com.android.systemui.doze.pulse com.android.systemui
A big shoutout to @Quinny899 for providing me the code to trigger ambient display by shell command.

You can use this command with Tasker to trigger it when the proximity sensor is covered for some seconds or even when you wave your hand over it. I haven't had the time to get such a profile working until now, but I know that it can be archived easily.

In case you use the above command, ensure you check the "use root" option in Tasker's context menu for the shell command!

EDIT: I managed to get this working :good: Below my implementation. I am sure there is room for optimization, but this is just a basic task and it works for me (OOS 4.5.13 with Tasker 5.0u6).

You need three profiles. Two of them will check the proximity sensor state while screen is off, the third one actually triggers the ambient display while screen is off and proximity sensor has been covered (by waving over it for example).

First of all, we need to ensure that Tasker will monitor the proximity sensor while screen is off. For this, open the three-dot menu, select Preferences and navigate to the Monitor tab. Set "Proximity Sensor" to "On". That's it.

Second, you have to enable the Ambient Display option via Settings -> Display, otherwise this won't work at all (thanks to @Devildire for confirmation)


Let's have a look at the needed profiles:

Code:
[B]PROFILE [I]Prox OFF[/I]
[/B]State -> Sensor -> Proximity Sensor -> invert
State -> Display -> Display State -> "Off"

[B]TASK [I]Proximity uncovered[/I]
[/B]Variable -> Set -> %Prox = false

[B]PROFILE [I]Prox ON[/I]
[/B]State -> Sensor -> Proximity Sensor
State -> Display -> Display State -> "Off"

[B]TASK [I]Proximity covered[/I]
[/B]Variable -> Set -> %Prox = true

[B]PROFILE [I]Wake Ambient Display[/I]
[/B]State -> Display -> Display State -> "Off"
State -> Variables -> Variable Value -> %Prox = true

[B]TASK [I]Wake Proximity Display[/I]
[/B]Task -> Wait -> 1s
Task -> IF -> %Prox = false
Code -> Run Shell -> am broadcast -a com.android.systemui.doze.pulse com.android.systemui (DON'T FORGET TO CHECK "USE ROOT")
That's it. Now turn off your screen and try to wake the ambient display by waving your hand over the proximity sensor.

EDIT: Tasker profiles can be found in post #7.

EDIT #2: @Arstoien provided us with an improved version of my basic tasks, check it out here.
 
Last edited:

Portgas D. Ace

Recognized Contributor
Jun 12, 2014
4,325
3,107
253
Bergisches Land
OP updated with instructions. Feel free to comment and share your experience or any kind of optimization proposes. Please note that the implementation is only a rough imitation of the original proximity wake feature, most likely this implementation needs some polishing.
 

saccentekennedy

Senior Member
Nov 15, 2012
361
141
63
Hey there. Sounds intriguing... I'm not understanding the stacked profiles... It seems you've got it triggering with two conditions. How do you do that?

Or... Would it be possible to upload the profiles and tasks for importing?
 

Portgas D. Ace

Recognized Contributor
Jun 12, 2014
4,325
3,107
253
Bergisches Land
Please find attached the requested profiles.

EDIT: You might want to change the wait time within the wake ambient display task to 1s instead of 300ms, this one actually works way better.
 

Attachments

Last edited:

dre-z

Senior Member
May 21, 2010
143
29
0
Essen
Mhm I have root, Tasker has a root-entry in magisk, added the profiles in post #7, changed the proximity sensor to yes, but it is not working.
 

saccentekennedy

Senior Member
Nov 15, 2012
361
141
63
Ok... So I've discovered that this breaks pocket mode... Every time I took my phone out to unlock with my finger, it had already registered several attempts my leg had made. I guess it makes sense this might be a problem.
 

Portgas D. Ace

Recognized Contributor
Jun 12, 2014
4,325
3,107
253
Bergisches Land
Mhm I have root, Tasker has a root-entry in magisk, added the profiles in post #7, changed the proximity sensor to yes, but it is not working.
As said before, this is just a rough workaround, it works for me (but not as perfect as the former in-built option). It works if you move your hand slowly over the sensor.

Ok... So I've discovered that this breaks pocket mode... Every time I took my phone out to unlock with my finger, it had already registered several attempts my leg had made. I guess it makes sense this might be a problem.
Hmm, I don't have this issue, but we might add another trigger option to the wake ambient profile: only trigger if display is face-up. This way it won't be triggered if the device is in your pocket.
 

Stupifier

Senior Member
Jun 8, 2010
1,906
680
133
After looking over what you steup in Tasker........The biggest question is "What does the phone do when it is in your pocket?" I think if you can figure out a solid Tasker-based solution to that question, this will be something worth using. Great work.
 

Portgas D. Ace

Recognized Contributor
Jun 12, 2014
4,325
3,107
253
Bergisches Land
@dre-z:

try changing the wait time within the wake ambient display task to 1s instead of 300ms. Works better for me and might enable the whole thing on your device. 300ms to wait until your hand moved over the sensor completely seems to be a bit too short.
 

dre-z

Senior Member
May 21, 2010
143
29
0
Essen
@dre-z:

try changing the wait time within the wake ambient display task to 1s instead of 300ms. Works better for me and might enable the whole thing on your device. 300ms to wait until your hand moved over the sensor completely seems to be a bit too short.
I think I am doing something wrong. Doesn't work at all. Thanks for your help anyways :)
 

Devildire

Senior Member
Oct 27, 2014
69
27
0
I use the downloaded profles and yes, root is checked. Using OP5 up to date OOS.

Edit: maybe there is something wrong with shell execution. Can you give me information about what I have to enter using tasker's "send intent" action instead?
 
Last edited: