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

Search This thread

Portgas D. Ace

Recognized Contributor
Jun 12, 2014
4,338
3,130
Bergisches Land
This has been working a treat for me, thank you! I was curious, would there be a way to tweak the profiles to emulate the always on ambient display of the Pixel 2?

+1
I was thinking that too, would be awesome to have an AOD.

I am not sure if this is possible on Nougat right now, but maybe we will get it working on Oreo (either by some kind of workaround or natively from within OOS). There are some apps in the Play Store that claim to be working on OOS Nougat, but haven't tried any of those yet.

Anyone know if this will work on the OP5 Oreo open beta?

Someone reported that it doesn't work on Oreo OB, but if you are already on Oreo, just give it a try and report back.
 
  • Like
Reactions: neildalal

Augustin79

Senior Member
Apr 9, 2015
330
79
I feared so. Seems that OP removed the code from OOS completely. But maybe we can find another workaround in the near future.

Just a thought/question: I see that when I activate Tasker from Quicksettings the "persistent notification" says "No active profiles". Is this right or something wrong in Tasker? (When entering Tasker the imported "Proximity sensor on"-profile seems active there... So I was just wondering if the profile isn't running in Tasker and that's why it's not working. What's your thought on this?
 

Portgas D. Ace

Recognized Contributor
Jun 12, 2014
4,338
3,130
Bergisches Land
Just a thought/question: I see that when I activate Tasker from Quicksettings the "persistent notification" says "No active profiles". Is this right or something wrong in Tasker? (When entering Tasker the imported "Proximity sensor on"-profile seems active there... So I was just wondering if the profile isn't running in Tasker and that's why it's not working. What's your thought on this?

Not sure about this, but I guess Tasker only shows a profile as currently active if it is triggered properly (so not via quick setting tile, for example) when all triggers are met. And as this profile uses the "screen is off" trigger, it won't be shown at all. But as said before, not sure about this one.

Can you add some notification (either toast message or regular notification) to your profile and trigger it manually? When you see the notification, you'll know that the profile works as intended, but the shell command isn't running properly.
 

Augustin79

Senior Member
Apr 9, 2015
330
79
Not sure about this, but I guess Tasker only shows a profile as currently active if it is triggered properly (so not via quick setting tile, for example) when all triggers are met. And as this profile uses the "screen is off" trigger, it won't be shown at all. But as said before, not sure about this one.

Can you add some notification (either toast message or regular notification) to your profile and trigger it manually? When you see the notification, you'll know that the profile works as intended, but the shell command isn't running properly.

I think you're right about this, however I'm not very experienced with Tasker so after testing I can't say 100% for sure.

Never thought I'd miss this "mod" as much I do, really hope someone will figure it out for Oreo (where the ambient notifications are much nicer than in Nougat as well)
 

Augustin79

Senior Member
Apr 9, 2015
330
79
Considering the OS "pocket mode" uses the proximity sensor, I don't expect Tasker polling it while screen off to add to the battery drain much. has anyone got some observations on the matter?

Btw, here is imo better solution than the one suggested by the OP. It's also all in one profile. It should activate much sooner than 1 second after the proximity has been activated BUT keep "waiting" for as long as 2 seconds. Adjust to your needs. Just make sure that the profile has "enforce task order" disabled and the entry task has Collision Handling to "abort existing task".

Hi Arstoien! I really miss this mod since ugrading to Oreo open beta 1. Do you think this will be possible to recreate on Oreo in time, or has Oreo "killed" this altogether you think?
 

Arstoien

Senior Member
Oct 31, 2012
1,437
1,508
Hi Arstoien! I really miss this mod since ugrading to Oreo open beta 1. Do you think this will be possible to recreate on Oreo in time, or has Oreo "killed" this altogether you think?
Unfortunatelly I don't know of a way to catch a broadcast that activates the ambient display. It's easy to recreate by turning on the screen for X seconds but that's obviously not ideal. If it's a Tasker challenge, count me in, but I'm not familiar enough with Android itself to be able to do that :(
 

Augustin79

Senior Member
Apr 9, 2015
330
79
Unfortunatelly I don't know of a way to catch a broadcast that activates the ambient display. It's easy to recreate by turning on the screen for X seconds but that's obviously not ideal. If it's a Tasker challenge, count me in, but I'm not familiar enough with Android itself to be able to do that :(

Am I right in thinking we're in need of a shell command that triggers ambient display on Oreo in order to make a tasker profile similar to the one that was originally introduced in this thread?
 

Arstoien

Senior Member
Oct 31, 2012
1,437
1,508
Am I right in thinking we're in need of a shell command that triggers ambient display on Oreo in order to make a tasker profile similar to the one that was originally introduced in this thread?
Yes, that's how the original profile works. So if there is such a command, the same should be easily achievable.

PS: I should have probably made it clearer that this was the reason it did not work in Oreo, sorry.
 
  • Like
Reactions: ben0512

Portgas D. Ace

Recognized Contributor
Jun 12, 2014
4,338
3,130
Bergisches Land
Am I right in thinking we're in need of a shell command that triggers ambient display on Oreo in order to make a tasker profile similar to the one that was originally introduced in this thread?

Yes, that's how the original profile works. So if there is such a command, the same should be easily achievable.

PS: I should have probably made it clearer that this was the reason it did not work in Oreo, sorry.

Haven't looked into detail, but this might be helpful. If not, maybe Quinny899 can help us out here, he was the one originally providing the intent to trigger ambient display on Nougat.

https://www.xda-developers.com/ambient-lock-screen-music-pixel-2/
 
  • Like
Reactions: neildalal

Augustin79

Senior Member
Apr 9, 2015
330
79
Haven't looked into detail, but this might be helpful. If not, maybe Quinny899 can help us out here, he was the one originally providing the intent to trigger ambient display on Nougat.

https://www.xda-developers.com/ambient-lock-screen-music-pixel-2/

Unfortunately this is the answer I got from Quinny last night when I asked him about the possibility of recreating this on OP5 Oreo: "I don't control what OnePlus do (it still works on AOSP so it's their problem) and don't even have a OnePlus device so probably not."

So for now it's not looking like we're getting any closer to a functioning shell command for this.
 

Portgas D. Ace

Recognized Contributor
Jun 12, 2014
4,338
3,130
Bergisches Land
Unfortunately this is the answer I got from Quinny last night when I asked him about the possibility of recreating this on OP5 Oreo: "I don't control what OnePlus do (it still works on AOSP so it's their problem) and don't even have a OnePlus device so probably not."

So for now it's not looking like we're getting any closer to a functioning shell command for this.

Hmm, that's too bad.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 16
    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.
    3
    @saccentekennedy

    If you want to add another trigger to a profile, just long-press the first trigger condition and Tasker will prompt you with a popup window where you can select to add another trigger option.

    If anyone else is interested, I might upload the profiles later.
    3
    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.
    3
    Considering the OS "pocket mode" uses the proximity sensor, I don't expect Tasker polling it while screen off to add to the battery drain much. has anyone got some observations on the matter?

    Btw, here is imo better solution than the one suggested by the OP. It's also all in one profile. It should activate much sooner than 1 second after the proximity has been activated BUT keep "waiting" for as long as 2 seconds. Adjust to your needs. Just make sure that the profile has "enforce task order" disabled and the entry task has Collision Handling to "abort existing task".
    2
    Already did that. I also added a short vibration right before the shell command which triggers properly. SU logs also show the root request.

    I might have found a solution. Do you have enabled the ambient display option within Settings -> Display? I disabled this option and the ambient display won't come up anymore. Enabling it again results in the proximity wake working again.

    @dre-z, this might also solve your issue.